Changed temps script to reset arduino every 30 minutes

This commit is contained in:
j4nk 2023-12-21 18:40:05 -05:00
parent cc879e8d44
commit ca1d88b85b
1 changed files with 8 additions and 3 deletions

View File

@ -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