pms5003-python
pms5003-python copied to clipboard
switch to gpiod broke setup on rpi (zero 2 w)
I have version .5 of this library working on an rpi 4 but I'm doing some testing on an rpi 2 zero w and after downloading v1.0 I'm getting this error with the new call gpiod instead of RpiGPIO (using gpio numbers not header numbers to connect pins):
Traceback (most recent call last):
File "/home/weather/pmsTests/pms5003-test.py", line 25, in
As a temporary fix, I just copied the contents of version .5's init.py over to the new version 1.0 and it runs fine (using RpiGPIO lib).
I think this has since been fixed to raise a more suitable error, but the TLDR is that supplying pins as numbers is no longer supported.
They must be named by their label, which can be found with:
sudo apt install gpiod
gpioinfo
IE: 22 becomes "GPIO22" and 27 becomes "GPIO27".
eg:
pms5003 = PMS5003(pin_enable="GPIO22", pin_reset="GPIO27")