I’ve successfully enabled a hardware switch on a raspberry pi 3 running standard raspbian stretch, simply by adding a switch connected to GPIO3 and ground, and adding the line “dtoverlay=gpio-shutdown” to /boot/config.txt as described here: https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README
This switch will shutdown the pi (and if already shutdown, power it up again).
Now for my questions to all you masters of OSMC:
Why does this setup not work when running standard OSMC image?
How can I get it working?
Even with the correct overlay “dtoverlay=gpio-shutdown” it still is not working. I even copied gpio-shutdown.dtbo from a working Raspbian image and that didn’t help.
Under Raspbian you’ll see:
[ 10.301261] input: soc:shutdown_button as /devices/platform/soc/soc:shutdown_button/input/input0
in dmesg. But with OSMC there is nothing - so possibly something to do with the kernel?
I’m sorry to revive this old thread, but it’s what comes closest to my problem.
I have this almost working on Raspbian Stretch with Kodi 17.6 Krypton. I haven’t tried on my OSMC image yet.
I have added dtoverlay=gpio-shutdown,gpio_pin=3 to /boot/config.txt (and /boot/overlays/gpio-shutdown.dtbo is of course present).
Nothing happens when I press the button, if Kodi is running, but when I exit Kodi and use the Raspbian desktop, then pressing the button works fine.
What needs to be configured to make it work inside Kodi?