A workaround for the broken power button on garden devices.
- You must have gcc installed e.g.
sudo apt install gcc
- compile (without debug) :
gcc power_button_helper.c -o power_button_helper -O3 -static
(if you want with debug run this instead :gcc -DDEBUG power_button_helper.c -o power_button_helper -O3 -static
) - Install executable :
sudo cp power_button_helper /usr/local/bin/power_button_helper
- Install service :
cp power_button_helper.service /etc/systemd/system/power_button_helper.service
- execute :
sudo systemctl enable power_button_helper
and reboot
- Do steps 3-5 but download the power_button_helper from release
- First it checks if 5 is in the /sys/android_brightness/brightness_light
- Then stores the contents of /sys/class/leds/lcd-backlight/brightness
- After that it copys 0 to /sys/class/leds/lcd-backlight/brightness
- Now it restores the content of step 2
- This is repeated every half second