Skip to content
Snippets Groups Projects
Commit 54697a55 authored by Joren Van Onder's avatar Joren Van Onder Committed by Christophe Simonis
Browse files

[IMP] point_of_sale: migrate the script that sets the rpi leds

When the server is answering HTTP requests, the status led (green one)
of the Raspberry Pi will turn on. Contrary to the previous script this
will not exit and keep running every 5 seconds. This way we can easily
troubleshoot connection issues (if led is on and we can't connect it's a
network issue, otherwise it's an issue with Odoo).
parent 86762ef3
Branches
Tags
No related merge requests found
......@@ -20,4 +20,6 @@ fi
mkdir -p /var/run/odoo
chown pi:pi /var/run/odoo
/home/pi/led_status.sh &
exit 0
#!/usr/bin/env bash
set_brightness() {
echo "${1}" > /sys/class/leds/led0/brightness
}
check_status_loop() {
while true ; do
if wget --quiet localhost:8069/hw_proxy/hello -O /dev/null ; then
set_brightness 255
else
set_brightness 0
fi
sleep 5
done
}
echo none > /sys/class/leds/led0/trigger
check_status_loop
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment