You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Cape connected to a BBB board that has an RTC chip connected to I2C2 and an I/O expander that connects to I2C1. If I run the code for each separately in different javascript files things work well. When I combine the two codes together, the software crashes.
Here is a snippet of what I have:
var b = require("bonescript")
// RTC
var port = '/dev/i2c-2';
var address = 0x68;
var writeArray = [];
var readArray = [];
// GPIO
var port2 = 'dev/i2c-1';
var gpioAddress = 0x27;
var timerOperation;
var gpioWriteArray = [];
b.i2cOpen(port, address, {}, setupRTC);
readRTCTime();
console.log("UTC Time: " + getTime());
console.log("UTC date: " + getDayAndMonth());
console.log("Alarm is set for 20 seconds from now");
b.i2cOpen(port2, gpioAddress, {}, setupMCP23008);
^^^^^^^^^ crashes here with the following dump ^^^
UTC Time: 22:32:48
UTC date: 11/11/2014
Alarm is set for 20 seconds from now
/usr/local/lib/node_modules/bonescript/iic.js:15
if(m.ports[args.port].path) path = m.ports[args.port].path;
^
TypeError: Cannot read property 'path' of undefined
at Object.m.doOpen (/usr/local/lib/node_modules/bonescript/iic.js:15:26)
at Object.newFunction as i2cOpen
at Object. (/var/lib/cloud9/javascripts/testJig/RTC_GPIO.js:27:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
ls -l /sys/bus/i2c/devices/i2c-* yields the following output:
lrwxrwxrwx 1 root root 0 May 15 03:41 /sys/bus/i2c/devices/i2c-0 -> ../../../devices/ocp.3/44e0b000.i2c/i2c-0
lrwxrwxrwx 1 root root 0 May 15 03:41 /sys/bus/i2c/devices/i2c-1 -> ../../../devices/ocp.3/4819c000.i2c/i2c-1
lrwxrwxrwx 1 root root 0 Nov 11 22:09 /sys/bus/i2c/devices/i2c-2 -> ../../../devices/ocp.3/4802a000.i2c/i2c-2
What am I doing wrong?
Thanks in advance,
Mostafa
The text was updated successfully, but these errors were encountered:
Greetings,
I have a Cape connected to a BBB board that has an RTC chip connected to I2C2 and an I/O expander that connects to I2C1. If I run the code for each separately in different javascript files things work well. When I combine the two codes together, the software crashes.
Here is a snippet of what I have:
var b = require("bonescript")
// RTC
var port = '/dev/i2c-2';
var address = 0x68;
var writeArray = [];
var readArray = [];
// GPIO
var port2 = 'dev/i2c-1';
var gpioAddress = 0x27;
var timerOperation;
var gpioWriteArray = [];
b.i2cOpen(port, address, {}, setupRTC);
readRTCTime();
console.log("UTC Time: " + getTime());
console.log("UTC date: " + getDayAndMonth());
console.log("Alarm is set for 20 seconds from now");
b.i2cOpen(port2, gpioAddress, {}, setupMCP23008);
^^^^^^^^^ crashes here with the following dump ^^^
UTC Time: 22:32:48
UTC date: 11/11/2014
Alarm is set for 20 seconds from now
/usr/local/lib/node_modules/bonescript/iic.js:15
if(m.ports[args.port].path) path = m.ports[args.port].path;
^
TypeError: Cannot read property 'path' of undefined
at Object.m.doOpen (/usr/local/lib/node_modules/bonescript/iic.js:15:26)
at Object.newFunction as i2cOpen
at Object. (/var/lib/cloud9/javascripts/testJig/RTC_GPIO.js:27:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
ls -l /sys/bus/i2c/devices/i2c-* yields the following output:
lrwxrwxrwx 1 root root 0 May 15 03:41 /sys/bus/i2c/devices/i2c-0 -> ../../../devices/ocp.3/44e0b000.i2c/i2c-0
lrwxrwxrwx 1 root root 0 May 15 03:41 /sys/bus/i2c/devices/i2c-1 -> ../../../devices/ocp.3/4819c000.i2c/i2c-1
lrwxrwxrwx 1 root root 0 Nov 11 22:09 /sys/bus/i2c/devices/i2c-2 -> ../../../devices/ocp.3/4802a000.i2c/i2c-2
What am I doing wrong?
Thanks in advance,
Mostafa
The text was updated successfully, but these errors were encountered: