I'm trying to access an i2c device via bonescript and I'm getting an error.
Here's the OS info:
*uname -a*
Linux yoder-debian-bone 4.4.15-ti-r37 #1 SMP Tue Jul 19 17:04:02 UTC 2016
armv7l GNU/Linux
*cat /etc/dogtag *
BeagleBoard.org Debian Image 2016-08-01
Here's the code:
var b = require('bonescript');
var bus = '/dev/i2c-2';
var TMP006 = 0x40;
b.i2cOpen(bus, TMP006);
b.i2cReadByte(bus, onReadByte);
function onReadByte(x) {
if(x.event == 'callback') {
console.log('onReadByte: ' + JSON.stringify(x));
}
}
Here's the error:
/usr/local/lib/node_modules/bonescript/src/iic.js:15
if(m.ports[args.port[0]].path) path = m.ports[args.port[0]].path;
^
TypeError: Cannot read property 'path' of undefined
at Object.m.doOpen
(/usr/local/lib/node_modules/bonescript/src/iic.js:15:29)
at Object.newFunction [as i2cOpen]
(/usr/local/lib/node_modules/bonescript/src/my.js:425:31)
at Object.<anonymous> (/root/exercises/sensors/si7021/si7021.js:11:3)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
Here's the plea:
How do I fix this?
Thanks...
--Mark
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/76e240a1-bb95-475e-a509-4823c5c58b17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.