Good day. Today I updated the player from version 8.3.9 to 9.1.4 and I have problems with gpio buttons.
With the GPIO button configured, but not activated the script runs cleanly and printls out the configuration:
When the button is enabled:
On versions below 9, such a problem did not occur
With the GPIO button configured, but not activated the script runs cleanly and printls out the configuration:
Code:
pi@MoOde:/home/pi# sudo /var/www/daemon/gpio_buttons.py
bounce=150ms
btn1, enabled n, gpio 02, pull-up, cmd=sudo,poweroff
btn2, enabled n, gpio 03, pull-up, cmd=mpc,next
btn3, enabled n, gpio 04, pull-up, cmd=mpc,prev
btn4, enabled n, gpio 05, pull-up, cmd=mpc,toggle
btn5, enabled n, gpio 06, pull-up, cmd=mpc,stop
btn6, enabled n, gpio 07, pull-up, cmd=
btn7, enabled n, gpio 08, pull-up, cmd=
btn8, enabled n, gpio 09, pull-dn, cmd=
Code:
pi@MoOde:~ $ sudo /var/www/daemon/gpio_buttons.py
bounce=150ms
btn1, enabled y, gpio 02, pull-up, cmd=sudo,poweroff
Traceback (most recent call last):
File "/var/www/daemon/gpio_buttons.py", line 60, in <module>
GPIO.add_event_detect(int(row['pin']), GPIO.RISING, callback=btn_1_event, bouncetime=bounce_time)
File "/usr/lib/python3/dist-packages/RPi/GPIO/__init__.py", line 858, in add_event_detect
_check_input(mode)
File "/usr/lib/python3/dist-packages/RPi/GPIO/__init__.py", line 249, in _check_input
raise RuntimeError(msg)
RuntimeError: You must setup() the GPIO channel as an input first