node-red-contrib-i2c icon indicating copy to clipboard operation
node-red-contrib-i2c copied to clipboard

"Error: Invalid I2C bus number 1"

Open taisau opened this issue 5 years ago • 3 comments

Just updated and see in the node red debug window: "Error: Invalid I2C bus number 1"

taisau avatar Jun 27 '20 00:06 taisau

to which version - I think 0.7.1 should fix it.

dceejay avatar Jun 27 '20 09:06 dceejay

The fix is missing only on in node

clik86 avatar Jun 27 '20 18:06 clik86

to fix it replace code: // The Input Node function I2CInNode(n) { RED.nodes.createNode(this, n); this.busno = n.busno || 1; this.address = n.address; this.command = n.command; this.count = n.count; var node = this;

with // The Input Node function I2CInNode(n) { RED.nodes.createNode(this, n); this.busno = parseInt(n.busno || 1); this.address = parseInt(n.address); this.command = parseInt(n.command); this.count = parseInt(n.count); var node = this;

lukaszgradzik avatar Jun 28 '20 15:06 lukaszgradzik