UDP packets may get lost; try multiple times

This commit is contained in:
Florian Schlegel 2017-02-19 21:14:58 +01:00
parent a1e5039f99
commit 6bfefc1534
1 changed files with 7 additions and 2 deletions

View File

@ -26,6 +26,11 @@ case $LIGHT_STATE in
;;
esac
echo -en "$(echo "$STATE" | cut -d";" -f1)" > /dev/udp/172.23.92.15/49152 &
echo -en "$(echo "$STATE" | cut -d";" -f2)" > /dev/udp/172.23.92.16/31302 &
for i in {1..5}; do
echo -en "$(echo "$STATE" | cut -d";" -f1)" > /dev/udp/172.23.92.15/49152 &
echo -en "$(echo "$STATE" | cut -d";" -f2)" > /dev/udp/172.23.92.16/31302 &
sleep .1
done
echo $LIGHT_STATE > $TMPFILE