node-rasp2c icon indicating copy to clipboard operation
node-rasp2c copied to clipboard

Loading doesn't parse proper i2c device

Open StrictlySkyler opened this issue 10 years ago • 0 comments

Just saw this when using your otherwise lovely tool on my RPi compute module – it looks like it's determining which i2c bus to use asynchronously, defaulting to '0'. This is a problem for short, or quickly executing, scripts – they call to /dev/i2c-0 instead of /dev/i2c-1, which they should be finding instead.

I'm fairly certain this is because if the exec call on line 11 or rasp2c.js. Might I suggest instead using exec-sync? It'd add a dependency, yes, but it'd allow for synchronously determining which i2c device to use before making any calls.

If you'd prefer, I'm happy to modify it and submit a pull-request – just lemme know.

Thanks!

StrictlySkyler avatar Jan 19 '15 05:01 StrictlySkyler