diff --git a/scripts/send_temps_to_lcd.sh b/scripts/send_temps_to_lcd.sh index f0751d2..a6f8b79 100755 --- a/scripts/send_temps_to_lcd.sh +++ b/scripts/send_temps_to_lcd.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Temperature printing function print_temp(){ @@ -20,6 +20,11 @@ sleep 1 # Update the temps once per second while true do - echo "CPU: $(sensors | grep 'Tccd1' | awk '{print substr($2, 2)}')?GPU: $(sensors | grep "edge" | awk '{print substr($2, 2)}')" | awk '{ gsub("\xc2\xb0", "\xdf", $0); print }' > $LCD_SERIAL_DEVICE - sleep 1 + # Every 30 minutes, reset the arduino and start again + # This hopefully fixes the issue of the LCD not updating after a while (usually over an hour) + for i in {1..1800}; do + echo "CPU: $(sensors | grep 'Tccd1' | awk '{print substr($2, 2)}')?GPU: $(sensors | grep "edge" | awk '{print substr($2, 2)}')" | awk '{ gsub("\xc2\xb0", "\xdf", $0); print }' > $LCD_SERIAL_DEVICE + sleep 1 + done + cd $LCD_PROGRAM_LOCATION && make reset && cd ~ done