pimoroni / enviro-phat

Python libraries and examples for the Pimoroni Enviro pHAT
https://shop.pimoroni.com/products/enviro-phat
MIT License
109 stars 51 forks source link

OSError: [Errno 121] Remote I/O error 3 #37

Closed mrusme closed 5 years ago

mrusme commented 5 years ago

When trying to run this example on a Raspberry Pi Zero with EnviroPhat, it successfully starts, runs a couple of seconds but then dies with the following output:

Traceback (most recent call last):
  File "./test.py", line 21, in <module>
    analog_values = analog.read_all()
  File "/usr/local/lib/python3.5/dist-packages/envirophat/ads1015.py", line 89, in read_all
    return tuple([self.read(channel=x) for x in range(4)])
  File "/usr/local/lib/python3.5/dist-packages/envirophat/ads1015.py", line 89, in <listcomp>
    return tuple([self.read(channel=x) for x in range(4)])
  File "/usr/local/lib/python3.5/dist-packages/envirophat/ads1015.py", line 71, in read
    self.i2c_bus.write_i2c_block_data(self.addr, REG_CFG, [(config >> 8) & 0xFF, config & 0xFF])
OSError: [Errno 121] Remote I/O error 3: 0.582
mrusme commented 5 years ago

Additional info:

I noticed that Light and RGB appears to be 0 for the first couple of readings. Could that be related to this issue?

➜  ~ python3 ./test.py
--- Enviro pHAT Monitoring ---
Temp: 31.82c
Pressure: 1000.94hPa
Altitude: 103.00m
Light: 0
RGB: 0, 0, 0
Heading: 36.02
Magnetometer: -1485 -3441 5266
Accelerometer: -0.07g -0.07g 1.02g
Analog: 0: 0.567, 1: 0.576, 2: 0.552, 3: 0.561
Gadgetoid commented 5 years ago

This looks like a signal quality/connection issue- how is Enviro pHAT connected to your Pi Zero?

mrusme commented 5 years ago

@Gadgetoid soldered it on the GPIO. Even though my soldering probably won't be the best, the pins look okayish. Any specific pins I should check or try to solder again?

mrusme commented 5 years ago

I did check and re-solder a few pins and it turned out this was causing the IO error. Thank you for the hint!