Posts: 52
Threads: 15
Joined: Aug 2018
Reputation:
1
Hello Tim,
While trying to compile some Python scripts with pyinstaller, I discovered that, due to hardware changes, the new Rapsberry Pi5 that I chose for Moode, was no more compatible with the RPI.GPIO library ( https://forums.raspberrypi.com/viewtopic.php?t=372507 or https://waldorf.waveform.org.uk/2022/the...stuff.html). I was wondering whether or not you were aware about that change ?
Best regards
Posts: 6,021
Threads: 176
Joined: Apr 2018
Reputation:
235
10-20-2024, 11:44 AM
(This post was last modified: 10-20-2024, 11:51 AM by TheOldPresbyope.
Edit Reason: ETA postscript
)
(10-20-2024, 10:17 AM)pkdick Wrote: Hello Tim,
While trying to compile some Python scripts with pyinstaller, I discovered that, due to hardware changes, the new Rapsberry Pi5 that I chose for Moode, was no more compatible with the RPI.GPIO library (https://forums.raspberrypi.com/viewtopic.php?t=372507 or https://waldorf.waveform.org.uk/2022/the...stuff.html). I was wondering whether or not you were aware about that change ?
Best regards
A quick search of the packages installed on a stock moOde 9.1.3 player will show you that RPi.GPIO is not preset but the suggested alternatives are
For example
Code: rho@sunroom:~ $ sudo apt list --installed|grep -i gpio
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
gpiod/stable,now 1.6.3-1+b3 arm64 [installed]
libgpiod2/stable,now 1.6.3-1+b3 arm64 [installed,automatic]
liblgpio1/stable,now 0.2.2-1~rpt1 arm64 [installed,automatic]
libpigpio-dev/stable,now 1.79-1+rpt1 arm64 [installed,automatic]
libpigpio1/stable,now 1.79-1+rpt1 arm64 [installed,automatic]
libpigpiod-if-dev/stable,now 1.79-1+rpt1 arm64 [installed,automatic]
libpigpiod-if1/stable,now 1.79-1+rpt1 arm64 [installed,automatic]
libpigpiod-if2-1/stable,now 1.79-1+rpt1 arm64 [installed,automatic]
pigpio-tools/stable,now 1.79-1+rpt1 arm64 [installed,automatic]
pigpio/stable,now 1.79-1+rpt1 arm64 [installed]
pigpiod/stable,now 1.79-1+rpt1 arm64 [installed,automatic]
python3-gpiozero/now 2.0-1 all [installed,upgradable to: 2.0.1-0+rpt1]
python3-lgpio/stable,now 0.2.2-1~rpt1 arm64 [installed,automatic]
python3-libgpiod/stable,now 1.6.3-1+b3 arm64 [installed]
python3-pigpio/stable,stable,now 1.79-1+rpt1 all [installed]
python3-rpi-lgpio/now 0.4-1~rpt1 all [installed,upgradable to: 0.6-0~rpt1]
raspi-gpio/stable,now 0.20231127 arm64 [installed]
So many HowTos on the InterWeb about the Raspberry Pi are out of date and the topic of gpio usage may be the worst offender.
Regards,
Kent
ETA - To be explicit, the name of the Debian package for RPi.GPIO is python3-rpi.gpio which is not present in the list above.
Posts: 13,414
Threads: 304
Joined: Mar 2018
Reputation:
543
The compatibility shim is installed
Code: pi@moode9:~ $ dpkg -l | grep lgpio
ii liblgpio1:arm64 0.2.2-1~rpt1 arm64 Control GPIO pins via gpiochip devices - shared libraries
ii python3-lgpio 0.2.2-1~rpt1 arm64 Control GPIO pins via gpiochip devices - python3 bindings
ii python3-rpi-lgpio 0.6-0~rpt1 all Compatibility shim for lgpio emulating the RPi.GPIO API
Script does "import RPi.GPIO as GPIO" and seems to run ok
Code: pi@moode9:~ $ sudo /var/www/daemon/gpio_buttons.py
bounce=1000ms
btn1, enabled n, gpio 02, pull-up, cmd=
btn2, enabled n, gpio 02, pull-up, cmd=
btn3, enabled n, gpio 02, pull-up, cmd=
btn4, enabled n, gpio 02, pull-up, cmd=
btn5, enabled n, gpio 02, pull-up, cmd=
btn6, enabled n, gpio 02, pull-up, cmd=
btn7, enabled n, gpio 02, pull-up, cmd=
btn8, enabled n, gpio 02, pull-up, cmd=
Posts: 52
Threads: 15
Joined: Aug 2018
Reputation:
1
Hello Tim and Ken,
I apologize about my question that could appear offending to you: that was not my purpose at all.
Thank you for this clear explanation .
Best regards
Posts: 13,414
Threads: 304
Joined: Mar 2018
Reputation:
543
(10-20-2024, 12:46 PM)pkdick Wrote: Hello Tim and Ken,
I apologize about my question that could appear offending to you: that was not my purpose at all.
Thank you for this clear explanation .
Best regards
Your post was perfectly reasonable.
Posts: 6,021
Threads: 176
Joined: Apr 2018
Reputation:
235
(10-20-2024, 12:52 PM)Tim Curtis Wrote: (10-20-2024, 12:46 PM)pkdick Wrote: Hello Tim and Ken,
I apologize about my question that could appear offending to you: that was not my purpose at all.
Thank you for this clear explanation .
Best regards
Your post was perfectly reasonable.
Absolutely.
Sorry for the abruptness of my reply. A bad night and lack of morning coffee does that to me
Regards,
Kent
|