Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: GPIO button only works after setting it to pull down manually
#2
I found a solution. The "problem" is that GPIO pins are always configured as pull-up in the software. This is also clearly stated in point 3 on the GPIO control configuration page  Rolleyes

So I changed line 59 in /var/www/daemon/gpio_buttons.py from
Code:
GPIO.setup(sw_1_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
to
Code:
GPIO.setup(sw_1_pin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)

Now that I have the solution, I think I remember having the same problem a couple of years ago, but I just forgot how to fix it. Anyway, it would be nicer to be able to do this on the config page, because I have the change the source code after every update, which I just forget to do, apparently...
Reply


Messages In This Thread
RE: GPIO button only works after setting it to pull down manually - by m4th31st - 04-22-2024, 07:38 PM

Forum Jump: