From ca1d88b85b0026dfadbff99fb27c803ff983779c Mon Sep 17 00:00:00 2001 From: j4nk Date: Thu, 21 Dec 2023 18:40:05 -0500 Subject: [PATCH] Changed temps script to reset arduino every 30 minutes --- scripts/send_temps_to_lcd.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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