Pi Zero + enviro+ + pms5003 = pin error

The pi zero and enviro+ hat are not working with the pms5003 sensor. Seemingly the GPIO pin detection is not working due to updated libraries - per a discussion on GitHub.

When particulates.py is tried the error output is:

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)

UPDATE - the LCD is not working either. The lcd.py example returns:

Woah there, suitable gpiochip not found!
⚠️ /dev/gpiochip0: 9 is an int and has been skipped, did you mean “PIN9” or “GPIO9”?

Is there any way for a plug and play / cut and paste user like me to fix it? Or is it a matter of waiting until the libraries are updated to fix the problem?

Update - the enviro+ hat works with the pms5003 on a Pi 4, but the lcd screen is not working. Pi zero refuses to work with the pms5003.

Hi, you can get lucky with some fixes posted in this thread, but nothing worked for me so far:

I have posted an update in Issue with Enviro+ with RPi Zero: Display and particles not working - Support - Pimoroni Buccaneers that may resolve this problem.

After abandoning the Enviro+ since 2023 I gave it another go today using Debian Trixie on a pi zero W. Initially the LCD was not working, now fixed by using Claude. That conversation for anyone who has been similarly frustrated by it:

Woah there, suitable gpiochip not found!

✅ GPIO9: (line 9) found - /dev/gpiochip0 (pinctrl-bcm2835)!

⚠️ GPIO9: (line 9, GPIO9) currently claimed by None

EXIT CODE: 1

(pimoroni)

This is a known, currently open, unresolved bug in Pimoroni’s own repo — issue #148, filed against this exact hardware (Pi Zero W Rev 1.1, Bookworm), same symptom. It’s assigned to the maintainer but has no fix or resolution posted yet, so there’s no clean “correct” answer sitting on GitHub waiting for you.

What’s going on, concretely: pinctrl shows GPIO9 starts out correctly assigned as SPI0_MISO (alt function). Somewhere during st7735’s init it gets reassigned to plain GPIO9 = output — but the reporter says even after that reassignment, the screen still doesn’t work (backlight on, no image), and various dc/cs argument tweaks people tried didn’t fix it either. So even beyond your current crash, there may be a further rendering issue waiting once the gpiochip error is solved.

Nice, glad it’s up and running. For anyone else hitting this later: the combo that worked was dtoverlay=spi0-2cs,no_miso in /boot/firmware/config.txt — frees GPIO9 from the SPI0 MISO alt-function (which gpiod/st7735 needs to claim as a DC pin) while keeping both chip-selects available (since the Enviro+ LCD is wired to CS1).