Skip to content
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

Problem with i2c device #5

Open
mwittig opened this issue Dec 5, 2015 · 2 comments
Open

Problem with i2c device #5

mwittig opened this issue Dec 5, 2015 · 2 comments

Comments

@mwittig
Copy link

mwittig commented Dec 5, 2015

Hi, I am using a setup similar to what is described in the README with raspi-io on the remote device. When I try to ead an i2c device I get multiple READ not implemented yet messages and finally it runs into an exception in the underlying rasp-io library. What is the status of the i2c support and where should I look at to possibly fix it. Thanks!

MIDI 144
MIDI_REQUEST[DIGITAL_MESSAGE] [ 144, 16, 0 ] 0 [ 0, 0, 0, 0, 1, 0, 0, 0 ]
MIDI_REQUEST[DIGITAL_MESSAGE] writing 4 1
handling sysex <Buffer f0 76 3c 00 00 00 2e 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 174 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 55 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 213 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 00 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 128 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 28 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 168 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 3f 00 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 63 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 53 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 211 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 00 00 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 0 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 00 00 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 0 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 0d 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 141 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 14 00 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 20 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 20 00 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 32 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 00 00 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 0 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 21 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 161 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 48 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 200 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 5a 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 218 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 12 00 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 18 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 01 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 129 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 0f 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 143 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 59 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 217 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 71 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 241 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 5b 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 219 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 40 00 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 64 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 24 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 164 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 26 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 166 ]
handled
handling sysex <Buffer f0 76 3c 00 00 00 2f 01 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 0 byteLength 2 data [ 0, 175 ]
handled
handling sysex <Buffer f0 76 3c 08 01 00 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 1 byteLength 1 data [ 1 ]
SYSEX_REQUEST[I2C_REQUEST] READ not implemented yet [ 240, 118, 60, 8, 1, 0, 247 ]
handled
handling sysex <Buffer f0 76 3c 08 01 00 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 1 byteLength 1 data [ 1 ]
SYSEX_REQUEST[I2C_REQUEST] READ not implemented yet [ 240, 118, 60, 8, 1, 0, 247 ]
handled
handling sysex <Buffer f0 76 3c 08 01 00 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 1 byteLength 1 data [ 1 ]
SYSEX_REQUEST[I2C_REQUEST] READ not implemented yet [ 240, 118, 60, 8, 1, 0, 247 ]
handled
handling sysex <Buffer f0 76 3c 08 01 00 f7> <Buffer 76 79>
SYSEX_REQUEST[I2C_REQUEST] address 60 mode 1 byteLength 1 data [ 1 ]
SYSEX_REQUEST[I2C_REQUEST] READ not implemented yet [ 240, 118, 60, 8, 1, 0, 247 ]
handled

/home/pi/remote/node_modules/raspi-io/node_modules/raspi-i2c/lib/index.js:79
    throw new Error('Invalid I2C length ' + length + '. Valid lengths are 0 th
          ^
Error: Invalid I2C length undefined. Valid lengths are 0 through 32.
    at checkLength (/home/pi/remote/node_modules/raspi-io/node_modules/raspi-i2c/lib/index.js:79:11)
    at I2C.read (/home/pi/remote/node_modules/raspi-io/node_modules/raspi-i2c/lib/index.js:167:7)
    at read [as _onTimeout] (/home/pi/remote/node_modules/raspi-io/lib/index.js:514:23)
    at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
@monteslu
Copy link
Owner

monteslu commented Dec 6, 2015

@mwittig Thanks for the detailed issue.

Looks like I accidentally left a console log in: https://github.com/monteslu/remote-io/blob/master/index.js#L464

I2c read is actually implemented in remote-io.

Possible bug in raspi-io, but not sure. I'm traveling now and a couple days away from trying to replicate this on my pi. In the meantime, possibly more logging could be done inside of that function I linked to in order see exactly what the board.io.i2cReadOnce is being called with.

@mwittig
Copy link
Author

mwittig commented Dec 7, 2015

Thanks for the swift reply! Good to know the "not-implemented" output is just a left-over from early days. I agree it may be a bug in raspi-io and will do more testing. Using raspi-io locally worked fine for me though. I'll get back with more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants