Connecting Enviro to R Pi4

Hi,

I am a beginner and received Enviro - Indoor Monitor ( I thnk it is the Enviro-mini-pHAT)
I am trying to connect it but can’t seem to have it recognized by the Pi unit

I have followed the instructions on


up to before the “example” section - rebooted but after multiple try it does not seem to get detected:

I also tried the install from the README.md with
curl -sSL https://get.pimoroni.com/enviroplus | bash

After Reboot:

Running

$Python3 weather.py

=> returns: Unable to find bme280 on 0x76, IOError

And running

$i2cdetect -y 1

=> returns only empty slots

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

This is how it’s connected to the Pi through the 40 pin.

Any help appreciated.
Is there a way to check if the Enviro unit itself is powered? faulty?

Thanks!

This is the side view of how it’s connected to the Pi

Somethings messed up? The LTR-559 should also show up in i2cdetect.
I don’t own an Enviro but I have been running some of the examples on the equivalent breakout garden setup.
I would have a look under the Enviro and make sure its not shorting out on any metal bits on the Pi.
Make sure SPI is enabled in Raspberry Pi configuration and reboot. Then try running the lcd.py file in the examples folder. You should get a Hello World message on the LCD display. If that works you know the Enviro has power.

1 Like

Thanks @Alphanumeric -
Good point on enabling SPI - it is - but I did not think about checking that.
When I power the RPi4 there is a flash on the LCD - so it seems it’s getting powered somehow.
There does not seem to be any shorting with any pieceof metal - although on the pi 4 there is a 4 pin that might be touching the enviro (2nd picture) - I have tried to plug the enviro not all the way down and it’s not helping

As a matter of interest - which version do you own for your breakout garden setup? I wanted to start with the garden one initially but decided to go with this model to start a project and setup the backend for the data.
Do you have a ribbon extension for the 40 pin ?

I have the Mini i2c SPI (bought that first) and the mini i2c (bought that latter on).
They are both mounted to a pHat Stack. The Pi Zero W I have plugged into the pHat Stack has a female GPIO header on it, no need for the ribbon cable that way. It’s a female 90 degree header on the bottom of the Pi. The Pi points up with all the ports pointing up for easy access.
I thought about getting the Breakout Garden Hat but the two SPI ports one behind the other didn’t work for me. You would not be able to see the second one if you had a display in the front one. With my setup I get one more i2c socket. 1 SPI and 5 i2c versus 2 SPI and 4 i2c on the Hat. It cost me more but it’s what I wanted.
The only edits I have to make to get the Enviro or Enviro+ code to work is the SPI display config that defines what GPIO pins are used. It’s different for the Breakout Garden, and depends on what port you use, front or back if you have the hat.
The mini has the same pinout as the front SPI on the Hat.

1 Like

My current setup is running the weather_and_light example that was for the Enviro. It’s what’s running on it in the product page picture.

I tweaked it a little bit. I swapped the date and time to opposite sides and changed the format. I also bypassed the CPU temperature compensation stuff. My Pi isn’t close enough to affect the readings.

Before that I was running the all-in-one-enviro-mini example. Its what the enviro+ is running in its product page. That expanded beyond what I could do on the breakout garden. I have three separate LCD displays instead of just the one. One graphs the temperature, one the humidity, and the third shows pressure.


No having to cycle through them on one display. Tweaked that code a lot.
The temp and humidity show 13 minutes of plots across the screen, and the pressure shows 2 hours. The defaults samples happen so fast you can’t see any trends on the graphs. Barometric pressure changes so slow that a long plot is the only way to see if its rising or falling.

So I recently ended up with two enviro+ boards as a result of some SPI weirdness (Pimoroni replaced but then we discovered the problem so I paid for the replacement). I don’t know what the hell happened, but I ran the install scripts just fine, Pi was showing SPI was enabled but the screen wasn’t working on the Enivro+. I ended up manually turning off SPI and enabling again (using raspi-config) and suddenly it started working! Well worth giving that a try!

Yeah, I did a lot of head scratching first time trying to use my LCD. Piece of cake now.

Thanks @ andywarburton -
It might have been that - Pimoroni sent me a new one ( good customer care - thanks!)
I plugged it and everything worked fine. So might have been the unit I got the first time.

If you still have the broken Enviro, have a look at the ribbon cable for the display. Nothing to lose by unplugging and reseating it. Just take your time figuring out how it unlocks.

Hej folks, I have now set up my Enviro and it is running so far. Unfortunately I do not know with which script I can create the attached image. Can you tell me where I can find it?
Thanks a lot!

It’s the weather-and-light.py example.
enviroplus-python/examples at master · pimoroni/enviroplus-python · GitHub
enviroplus-python/weather-and-light.py at master · pimoroni/enviroplus-python · GitHub

Okay.

I had the right hunch, but I got a mistake there:
File "weather-and-light.py", line 382
temp_string = f"{corr_temperature:.0f}°C"

SyntaxError: invalid syntax.

Does the script also work with the Enviro without plus?
Oh and while I’m at it: How can I keep a Python script running without SSH console?

Thanks for your help.

Yes it does.
Which version of Python are you using? It should be Python3
To keep a script running you can explore Tmux - I am getting my head around it but it’s pretty powerful and fit for purpose.

this is what i use to have script run at bootup.

2 Likes

I have seen that I use Python version 2.7.16. About ls /usr/bin/python* I have also seen that I have installed Python 3.7.
Unfortunately I do not know how to switch to the Python version.

python /home/pi/weather-and-light.py
runs it as python 2
python3 /home/pi/weather-and-light.py
runs it as python3

I use crontab to run my python files on boot up.
From a terminal window I run
crontab -e
then add
@reboot python3 /home/pi/myfile.py &

1 Like