Problem installing Enviro software on Pi zero


I plan to image a new sd card with Raspian Full desktop and start from scratch.

I plan to go through the post, from top to bottom and gather all the notes, what to install etc and build a process document then work to get this going and hopefully contribute back here with what worked etc.

Question. Did all the example scripts work? I’m trying to figure out what to expect as working and not working.

Some of the examples will only work if you also have the PMS5003 Particulate Matter Sensor. Just keep that in mind. It shouldn’t be too hard to look at the code to see if its listed or not. I don’t own an Enviro or Enviro +, just so you know.
I will be playing around with a BME280 and that same 0.96 LCD display and trying to run some of the Enviro+ examples on with them. I’m just waiting for them to arrive.


I don’t have the PMS5003…yet. Ill be ordering one soon though.

I would think if you can get the file to run your good to go.

1 Like

Ok…a quick follow up. So my second fresh start has worked much better.

TLDR: The Curl command method worked much better for me this time.

I did a fresh SD card image with full raspbian buster desktop install to a Pi Zero W.
I did an apt update and dist-upgrade.

I tried for the first time; the All-in-One Curl bash install command . Previously I used the git method.

The All-in-One curl command seems to have worked with very little editing of the examples scripts.

And I got the “” script to work this time around. However “python3” works where “python” fails with a syntax error.



So last night I installed my Enviro PHAT on my Pi 4 and couldn’t get the LCD to work. After a fresh install of Raspbian and Enviro via the curl method everything works perfectly. I wonder if the script setup is borked by other software installs which modify packages.


I’ve had very similar issues with the enviro (the white zero sized non + version

I found that it the worked when the installation was done from a terminal within the raspian desktop environment, rather than headless using ssh. There was still an error message during the install, but the examples I needed all worked

I’ve been running some of the Enviro ( and Enviro+ ( code on the equivalent breakout garden setup. I had to modify it a bit but its usable. I ran the installers for the breakouts, not the Enviro installer.
Anyway, I ran many different installers and swapped breakouts in and out and didn’t break anything. Not that I know of anyway. Just a FYI post.
That being said, one of the things I do when things just won’t work no matter what I do, is start over with a fresh image. Especially if I have had other Hats or pHats setup on that Pi.
What it might boil down to is what hat it was that you used previously. The Hyperpixel for example really messes with the GPIO and changes just about every pins function.
You may also end up with a stray config.txt entry that overrides your new installs setup.

This is just a tweaked and maybe more useful version of your I2C testing program:

#!/usr/bin/env python

# tests for  presence of active I2C bus and reports devices found

import smbus


    bus = smbus.SMBus(1) # 1 indicates /dev/i2c-1
    print("I2C bus is Enabled")
    print bus
except: # I2Cbus not detected
    print("I2C bus not enabled")
    print("Use   sudo raspi-config   Option 3 (Interface Options) to enable it")


for device in range(128):

  except: # exception if read_byte fails