I am trying to get the Pi to receive data from an ESC via I2C. It works like this:
- Pi sends series of 4 bytes to speed controller to initiate connection
- ESC responds with a series of bytes
- Pi sends a prompt for more data (2 bytes) and the ESC responds
- Repeat step 3 until the bytes sent from the ESC match a certain "end pattern"
End of communication.
The documentation for the ESC states
Running I2Cdetect with (only) the speed controller connected shows a device at 0x50 and 0x51. I can use i2c_write_block_data() to send the "request" sentence to either 0x50 or 0x51 without error, but if I then use any i2c read function I get an IO error.
I'm assuming the Pi is the I2C master here, but as I2C is a master/slave bus I don't really understand what it means by "taking turns" on the bus. Can I set/verify the Raspi's I2C address as 127?
Am I misunderstanding something fundamental here?
(This is quite a specific application, so I don't want to overload with information but if I can clarify something I will)