Closed rewse closed 2 months ago
Thank you for your information about the deprecation of RPi.GPIO. I will try a little hard work :-)
Hi rewse, I've updated this to use the gpiozero and uploaded it to the testpypi instead of pypi.
Would you please confirm this and tell me the result? Thank you for your contribution.
site of testpypi How to update mh-z19 from testpypi
pip install --index-url https://test.pypi.org/simple/ mh-z19
After it is confirmed, I'll upload this to pypi.
Thank you for the super fast fix!
The following error occurred.
However, I got a correct value after installing lgpio with reference to https://github.com/gpiozero/gpiozero/issues/1120 .
(mhz19) tats@fox:~$ sudo pip3 install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ lgpio
(mhz19) tats@fox:~$ sudo pip3 list
Package Version
------------------ --------
certifi 2024.2.2
charset-normalizer 3.3.2
colorzero 2.0
getrpimodel 0.1.24
gpiozero 2.0.1
idna 3.7
lgpio 0.2.2.0
mh_z19 3.1.5
pip 24.0
pyserial 3.5
requests 2.31.0
RPi.GPIO 0.7.1
setuptools 69.5.1
urllib3 2.2.1
(mhz19) tats@fox:~$ sudo python3 -m mh_z19 --pwm
{'co2': 470.0}
Thank you for your continued cooperation in providing useful information. The gpiozero seems to depend on the lgpio, however, gpiozero's setup.py does not have this dependency description. So, I'll add lgpio to mh-z19's setup.py in addition to gpiozero, and upload to the pypi.
I've uploaded my latest package to the PyPI as version 3.1.5.
Confirmed. Thank you!
(mhz19-prod) tats@fox:~$ pip3 install mh_z19
(mhz19-prod) tats@fox:~$ pip list
Package Version
------------------ --------
certifi 2024.2.2
charset-normalizer 3.3.2
colorzero 2.0
getrpimodel 0.1.24
gpiozero 2.0.1
idna 3.7
lgpio 0.2.2.0
mh_z19 3.1.5
pip 24.0
pyserial 3.5
requests 2.31.0
RPi.GPIO 0.7.1
setuptools 69.5.1
urllib3 2.2.1
(mhz19-prod) tats@fox:~$ sudo python3 -m mh_z19 --pwm
{'co2': 485.0}
mh_z19 3.1.3 doesn’t work with Raspberry Pi 5 because the dependent RPi.GPIO 0.7.1 doesn’t work with it.
It seems RPi.GPIO is no longer maintained because of no response to the ticket to support RP5. The official RP doc is using gpiozero to access GPIO.