0

I am trying to connect the MS5607 to the Raspberry Pi via I2C. I can confirm that it connected when I run sudo i2cdetect -y 1. I then went ahead and tried to use rsolomon's python code. First error I encountered was easy to fix in the driver file default_bus = 1 if revision() > 1 else 0. I got rid of the if statement there since Raspberry Pi 3 does not let you use bus 0.

However, now I am getting this lovely error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/baro.py", line 36, in __init__
    self._coefficients = self.__read_coefficients()
  File "/home/pi/baro.py", line 51, in __read_coefficients
    coefficients[n] = self.__read_coefficient(n + 1)
  File "/home/pi/baro.py", line 42, in __read_coefficient
    reading(self._address, 2))
  File "/home/pi/quick2wire-python-api/quick2wire/i2c.py", line 79, in transaction
    ioctl(self.fd, I2C_RDWR, ioctl_arg)
OSError: [Errno 121] Remote I/O error

And since Python is awful at giving useful errors (forgive me, not my favorite language). I don't really know where to go from here.

Do you guys have any suggestions?

As requested here is the code as run in the python3 shell

import baro
address = 0x76
sensor = baro.MS5607(address)

sensor is where the code breaks.

Here is the output of i2cdetect -y 1

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- 18 19 -- -- -- -- 1e -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- 68 -- -- 6b -- -- -- -- 
70: -- -- -- -- -- -- 76 --         

Thanks!

  • 1
    post your code, not a link, and the output of i2cdetect – Chad G May 23 '18 at 21:38
  • @ChadG done, there really isn't much other than what the github directory says. – Sailanarmo May 23 '18 at 21:43
  • and your sure the 0x76 is this device, not one of the other ones on the bus? – Chad G May 23 '18 at 21:44
  • @ChadG yes, I just unplugged it and 76 disappears as expected. – Sailanarmo May 23 '18 at 21:46
  • are you running python as sudo – Chad G May 23 '18 at 21:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.