0

I am trying to poll data from an I2C device on a Raspberry Pi. Currently it is hooked up to a 7" touch screen, and I am getting an error that seems to be due to a clock-stretching bug. (https://github.com/fivdi/i2c-bus/issues/36) (http://www.advamation.com/knowhow/raspberrypi/rpi-i2c-bug.html)

Will removing the screen and running the Pi headless improve baud rate performance / clock consistency?

I am getting the following error:

/home/pi//node_modules/i2c-bus/i2c-bus.js:355
  return i2c.readI2cBlockSync(peripheralSync(this, addr), cmd, length, buffer);
         ^

Error: , Remote I/O error
at Bus.readI2cBlockSync (/home/pi/node_modules/i2c-bus/i2c-bus.js:355:14)
at Ina219.readRegister (/home/pi/node_modules/ina219/ina219.js:184:12)
at Ina219.getShuntVoltage_raw (/home/pi/node_modules/ina219/ina219.js:448:7)
at Ina219.getShuntVoltage_mV (/home/pi/node_modules/ina219/ina219.js:500:7)
at Timeout.setInterval [as _onTimeout] (/home/pi/test.js:44:12)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)```
ang
  • 155
  • 1
  • 8

1 Answers1

1

I don't see how. The remote I2C device requests the clock stretch because it can't keep up with the Pi. Making the Pi more responsive will just make the situation worse as far as the remote I2C device is concerned.

If you think clock stretch is the problem drop the I2C bus speed to something like 50kbps.

joan
  • 71,852
  • 5
  • 76
  • 108