I'm trying to detect i2c devices on /dev/i2c-2.
I have a MCP23017 connected to i2c2 (pins 19 & 20) with address set to
0x00. i2cdetect -r 1 finds it as expected. I can fire outputs/read inputs
via another script, so it is working properly.
I've modified the 'test-i2c' from github as follows:
var b = require('bonescript');
var port = '/dev/i2c-2';
b.i2cOpen(port);
b.i2cScan(port, onScan);
function onScan(err, data) {
console.log('scan = ' + JSON.stringify(arguments));
}
If I run it using '/dev/i2c-0', I get the same output as 'test-i2c'
(data=[52,80])
scan = {"0":{"err":null,"data":[52,80],"event":"callback"}}
scan = {"0":{"event":"return","return":[
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,52,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
80,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1]}}
If I run on /dev/i2c-1 or /dev/i2c-2, I get an empty array in data.
scan = {"0":{"err":null,"data":[],"event":"callback"}}
scan = {"0":{"event":"return","return":[
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1]}}
So far, I haven't gotten node-i2c to install/function correctly to try
wire.scan from that (which bonescript says it uses) I get weird errors
that I haven't chased down yet.
Any ideas? The only thing google brings up when searching is an IRC log
that mentions 'empty array returned' from 2012...
--
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].
For more options, visit https://groups.google.com/groups/opt_out.