Thank you for your donation!


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


Power on/off button
#6
Hi guys,

On my other Pi (not moOde) I've done it as below. No python installed or scripts added to autostart needed:

1. connect one switch terminal to GPIO 3 (pin 5) and GPIO 17 (pin 11)
2. connect the other switch terminal to GND (pin 6, 9, etc)
3. add a below line to /boot/config.txt :
dtoverlay=gpio-shutdown,gpio_pin=17,active_low=1,gpio_pull=up,debounce=1000
4. done

A quick explanations: GPIO 3 is a power up pin as defualt, the line added to config.txt activates GPIO 17 as a shutdown, "debounce" option adds 1000ms delay (so you have to press and hold for 1 sec) before shutdown (I added that, so it won't shutdown when coincidently pressed. I think a default debounce value (if you don't add it at all) is 200ms.

I hope it helps.
Reply


Messages In This Thread
Power on/off button - by bgonc - 03-16-2022, 03:14 PM
RE: Power on/off button - by greg_m - 03-16-2022, 07:55 PM
RE: Power on/off button - by philippe05 - 03-17-2022, 01:09 PM
RE: Power on/off button - by maartin - 03-29-2022, 01:19 PM
RE: Power on/off button - by philippe05 - 04-09-2022, 08:38 AM
RE: Power on/off button - by maartin - 04-09-2022, 02:22 PM
RE: Power on/off button - by TheOldPresbyope - 04-09-2022, 02:36 PM
RE: Power on/off button - by maartin - 04-09-2022, 02:56 PM
RE: Power on/off button - by greg_m - 04-09-2022, 12:08 PM
RE: Power on/off button - by philippe05 - 04-09-2022, 01:36 PM
RE: Power on/off button - by TheOldPresbyope - 04-09-2022, 02:00 PM
RE: Power on/off button - by philippe05 - 04-09-2022, 02:12 PM
RE: Power on/off button - by TheOldPresbyope - 04-09-2022, 02:26 PM

Forum Jump: