Probably because the /sys directory layout has changed.
I'm not much of an actual Bonescript user, but I've been playing with it to
help out a friend and I've found it very fragile with changes in kernel
versions, and various Debian supporting packages.
Honestly I don't think all the bonescript101 embedded webpage example code
has run correctly since the final Angstrom distribution.
On Tuesday, August 2, 2016 at 11:52:22 AM UTC-5, Mark A. Yoder wrote:
>
> 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/3b830d4d-a7d4-4398-9bed-0eab4f9561f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.