Enviro+ running on a Raspberry Zero W

I am using a Raspberry Pi Zero W Rev 1.1 Legacy 32 Bit OS bullseye (including desktop) with the Enviro+ and the PMS5003.
The temp, pressure light sensor and the Oled are working. When I try to run particulates.py the following message appear:

Traceback (most recent call last):
File “/home/pi/enviroplus-python/examples/particulates.py”, line 18, in pms5003 = PMS5003()
File “/usr/local/lib/python3.9/dist-packages/pms5003/init.py”, line 109, in init
self._pin_enable, self._pin_reset = gpiodevice.get_pins_for_platform(PLATFORMS)
ValueError: not enough values to unpack (expected 2, got 0)

How to solve this?

When I place the Enviro+ on a Raspberry Pi 4 the PMS5003 readings show up.

Any suggestions on the best Raspberry OS version for the Zero W ?

I suspect that the pms5003-package is not backward compatible. On your Pi4, you are probably running something newer.

Regarding your last question: the only reason not to run the current version of PiOS are incompatible packages. But in your case it seems to be the other way around. Otherwise I can only recommend to not run the desktop version of PiOS on a Zero. Memory is so tight that sooner or later it will start swapping and that makes the system very slow. And as a basis for sensor data you don’t need the graphical environment anyhow.

If you select, No Filtering, under Raspberry Pi Device, when using the Raspberry Pi Imager, you can install any version you want.
You just have to be sure to select a compatible version. For a Zero make sure to select a 32 bit version of Pi OS.

I quit often install the full desktop version. And then once done fiddling around with setup etc, I set it to boot to command line to save on resources. I know I should be instaling the Lite version, but its just something “I do” instead.

The latest version of the pms5003 library only supports a limited range of Pi (for … Reasons) - the simplest solution on the Zero is to pin the library back to 0.0.5 -

pip install pms5003==0.0.5

(the cooler solution is to send a PR in with a fix to make it work with all Pi, but…!)

1 Like

Thanks for the tips!
All the examples work after I pin back the library to 0.0.5.

The zero uses a lot resources when running the desktop, however it is much easier for me to setup the Zero. I know how to use the command line through my apple’s terminal. But I have to figure out how to set the zero to boot from command line not using the desktop interface…

When I use a standard UBS micro adapter the Zero boot and is working well.
As I have several Raspberry’s I use a standard Meanwell power supply to provide power to all Raspberry’s to get ride of all the separate power supplies.

However, it works fine for all my Raspberry 3 and 4’s.
When I connect my Zero with the Enviro+ it doesn’t work / boot.
When I only use the Zero (without Enviro+) the Zero boot. Using a different Meanwell power supply the Zero (without Enviro+) does not boot.
(both Meanwell power supplies are capable to deliver at least 5A)
I hope I do not have to use separate supplies for each of my projects…

You should always be aware of the fact that current (A) is not the only relevant factor. Voltage is also very important. Voltage drops under load, and if it drops below 4.75V the Pi has a problem. Now Meanwell is well respected, but the real problem is that you won’t find data about voltage stability under load. And turning on a Pi will always create a (very) short load spike which is much higher than the normal load is.

1 Like