Button On Off

  • Hello,

    I can't find the answer to my question.

    Allow me to put it here.

    I would like to obtain a command line to configure my raspberry Pi3 with a button ON/OFF tone (not a push button).

    I followed the tutorial of Da Flex: RPi4 GPIO using in LibreELEC

    It works but the button works in push mode and not On/OFF. Do you have the solution please?

    Thanks in advance.

    Edited once, last by Numerobiss: My traduction French > English is horrible. (April 23, 2022 at 5:59 PM).

  • So you want to use a switch button instead of a push button. In that case you can't use dtoverlay=gpio-shutdown, and you have to implement your own script to check the GPIO states. Here is a script that does the same like dtoverlay=gpio-shutdown. Start it from autostart.sh. You have to adapt it for your needs: