-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i2cdetect and node-i2c scans returning different results #27
Comments
I get a null array when I have a device at 0x20 (I get a null array on /dev/i2c-1 & 2, 2 the same null output the i2cdetect has), I get [52,80] on dev/i2c-0, but i2cdetect reports devices at 24,34,50,70 root@beaglebone:/var/lib/cloud9/demo# cat i2c.js root@beaglebone:/var/lib/cloud9/demo# i2cdetect -y -r 1 |
Internally node-i2c uses the SMBus quick command (i2c_smbus_write_quick) to scan for devices, so it's similar to:
On the BeagleBone the following is typically used for device detection:
Note that -r is being used rather -q, so i2cdetect uses SMBus receive byte rather than the SMBus quick command for device detection. The BeagleBone doesn't support the SMBus quick command so node-i2c scan doesn't find anything
|
Is this issue still relevant on latest @abandonware's fork ? https://libraries.io/npm/@abandonware%2Fi2c/usage Relate-to: #97 |
It is unclear to me why i2cdetect and node-i2c would return different results, but this is what I'm seeing...
root@beaglebone:/var/lib/cloud9# i2cdetect -y -r 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- 1d -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- 6b -- -- -- --
70: -- -- -- -- -- -- -- --
So, it seems these don't line up. To see if the delta is due to the
wrapper I have in BoneScript or the node-i2c library I pull in, I
tried out this:
debian@beaglebone:/var/lib/cloud9$ cat i2c-scan-native.js
var i2c = require('i2c');
var wire = new i2c(null, {device: '/dev/i2c-1'});
wire.scan(function(err, data) {
if(err) console.log('ERROR: ' + JSON.stringify(err));
console.log(JSON.stringify(data));
});
debian@beaglebone:/var/lib/cloud9$ node i2c-scan-native.js
[87]
The text was updated successfully, but these errors were encountered: