Can't get Enviro to work

Hi,

My son has a Raspberry Pi 4b 2GB and I got him the Pimoroni Enviro (not Enviro+) indoor monitoring hat: Enviro for Raspberry Pi - Monitor your world! - Pimoroni but can’t get it to work.

I have the Python library GitHub - pimoroni/enviroplus-python: Python library for the Enviro+ environmental monitoring board and installed the dependencies using:

sudo apt install git
git clone https://github.com/pimoroni/enviroplus-python
cd enviroplus-python
sudo ./install.sh

But when I try to run one of the examples (e.g. light.py) using python3 light.py , nothing happens and I get a message which ends with the same I2C error:

IOError: [Errno 121] Remote I/O error

I’ve checked the usual stuff (pin connections, orientation, update the Pi etc) and it’s not the Pi or pins as his Inky pHAT works fine. So I’m thinking it’s either a faulty unit, or (much more likely!) I am doing something wrong with either the Python library or set-up. Checking the Pi configuration seems OK (SPI, I2C enabled etc).

Does anyone have any advice?

Remote IO/121 usually means the Pi can’t communicate with the board. Maybe try:

sudo python3 light.py

It may be that the Pi thinks you don’t have the admin rights to use the hardware interfaces. It’d be odd if the Inky pHAT works OK though. Are you connecting the pHAT directly to the Pi, and are you sure it is aligned properly?

Hi thanks for that, yes tried sudo in front and still no joy. pHAT is definitely connected OK, directly onto the Pi (as the attached image). The inky pHAT still works perfectly.

sudo i2cdetect -y 1 returns the following:

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

Starting to think I have a bad unit.

I tried a fresh install of the RPi OS starting from scratch and then followed the instructions in this:

Still no joy.

I then did yet another fresh complete RPi OS install again and used the curl install method shown here:

And still nothing. There is no response at all from the Enviro (except for a very brief flash of light on the display when I booted first time). Other HATs work fine on the Pi, so it’s not a pin or Pi issue.

Every time I try to run any of the examples it just won’t work:

sudo python3 light.py 
Traceback (most recent call last):
  File "/home/david/Pimoroni/enviroplus/examples/light.py", line 8, in <module>
    ltr559 = LTR559()
  File "/usr/local/lib/python3.9/dist-packages/ltr559/__init__.py", line 218, in __init__
    self.part_id = self._ltr559.get('PART_ID')
  File "/usr/local/lib/python3.9/dist-packages/i2cdevice/__init__.py", line 230, in get
    self.read_register(register)
  File "/usr/local/lib/python3.9/dist-packages/i2cdevice/__init__.py", line 183, in read_register
    self.values[register.name] = self._i2c_read(register.address, register.bit_width)
  File "/usr/local/lib/python3.9/dist-packages/i2cdevice/__init__.py", line 288, in _i2c_read
    for x in self._i2c.read_i2c_block_data(self._i2c_address, register, bit_width // self._bit_width):
OSError: [Errno 121] Remote I/O error

or

sudo python3 all-in-one-enviro-mini.py 
Traceback (most recent call last):
  File "/home/david/Pimoroni/enviroplus/examples/all-in-one-enviro-mini.py", line 11, in <module>
    ltr559 = LTR559()
  File "/usr/local/lib/python3.9/dist-packages/ltr559/__init__.py", line 218, in __init__
    self.part_id = self._ltr559.get('PART_ID')
  File "/usr/local/lib/python3.9/dist-packages/i2cdevice/__init__.py", line 230, in get
    self.read_register(register)
  File "/usr/local/lib/python3.9/dist-packages/i2cdevice/__init__.py", line 183, in read_register
    self.values[register.name] = self._i2c_read(register.address, register.bit_width)
  File "/usr/local/lib/python3.9/dist-packages/i2cdevice/__init__.py", line 288, in _i2c_read
    for x in self._i2c.read_i2c_block_data(self._i2c_address, register, bit_width // self._bit_width):
OSError: [Errno 121] Remote I/O error

i2cdetect -y 1 now returns:

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

Either I am missing something in the “getting started” guides here, or there is some step missing from it I don’t know about, or I have a faulty unit. Time to send it back.

If i2c is blank “all --”, I would say its a hardware issue, or a connection issue. You obviously know how to connect the Hats so IMHO its a hardware issue. Make sure there is nothing on the Pi that is touching the bottom side of the Hat, like a heatsink etc.
There is a link on the shop page to contact Pimoroni tech support directly via e-mail. I would put a link to this thread in that e-mail.
Contact Us for Raspberry Pi Technical Support - Pimoroni

Thanks, I got in touch with Pimoroni and they replied very quickly, they’ve already sent me a replacement unit. Great service to be fair!

That’s good to here. I have several Pi and Pico based weather data Enviro setups. It can be a lot of fun.

Replacement unit arrived today, works a treat. Great service.

2 Likes