Support for the Pi-Desktop Power Button?

  • Hello community,

    the Raspberry Pi (model 3B+) is an always-on board by design - it has no power button. This will make LE sending a permanent video signal to my TV. When I turn the TV on, it will instantly switch to the active video signal input (LE), and doesn't stay in TV mode. This is bad, and I want to find a solution.


    The first idea was to temporary switch off the HDMI signal by the command "tvservice -o". Unfortunately the command to switch HDMI on again "tvservice -p" doesn't work on LE.


    The next idea is to put the Raspberry Pi in a case with a power button. I have found the Pi-Desktop case by Element14 on the market. To make the power button work, it needs an additional Debian package "pidesktop-base.deb". The source code for this package is available on Github.


    Is there any add-on or another solution to make the Pi-Desktop power button work on LE?


    PS: I have been found this thread, which is still unsolved and has a "maybe too old" warning. If someone made it work from there, please give me a notice.

    Edited 3 times, last by Da Flex ().

  • You could try This to power on/off your device

    I have been tried this, and it partially works. (edit config.txt, shortcut GPIO 3 and GND as power button)

    The power on works fine.

    The power off will let the shutdown menu appear (power off, power off timer, reboot).

    Do you know a trick how to avoid that menu and instantly power off?

  • This might also help

    I followed those instructions and did that:

    - set config.txt back to original (no "dtoverlay=gpio-shutdown")

    - installed "Raspberry Pi Tools" from repository

    - created the "autostart.sh" and "off-button.py"

    - set both files as executable (chmod +x)


    GPIO3 now still works as power on (it always does), but the next trigger to power off does nothing.


    The python script ("off-button.py") looks OK:

    - the necessary lib from "Raspberry Pi Tools" exists (/storage/.kodi/addons/virtual.rpi-tools/lib/GPIO.so)

    - the pin mode "GPIO.BCM" is correct for my model 3b+ with GPIO3 power button


    Any hints?


    PS: The command line response when starting from ssh ("sh /storage/.config/autostart.sh") is this:

    Code
    1. Traceback (most recent call last):
    2. File "/storage/scripts/off-button.py", line 6, in <module>
    3. import syss
    4. ImportError: No module named syss

    Edited once, last by Da Flex ().

  • 8ugger :@ formatting issues again.


    SB:

    Code
    1. import sys.path.append('/storage/.kodi/addons/virtual.rpi-tools/lib')

    Not

    Code
    1. import syss
    2. ys.path.append('/storage/.kodi/addons/virtual.rpi-tools/lib')
  • Still an error at line 6:

    Code
    1. File "/storage/scripts/off-button.py", line 6
    2. import sys.path.append('/storage/.kodi/addons/virtual.rpi-tools/lib')
    3. ^
    4. SyntaxError: invalid syntax
  • Success! GPIO3 power on/off triggers the expected results now! :)

    Thank you very much, Iridium!:thumbup:

    I can use a cheap case now, and install my own power button - problem solved.