Program aborts after using CAT
by Ockwig from LinuxQuestions.org on (#55CES)
Hardware : Raspberry Pi 4
Software : Raspberry pi OS
Program Python3:
from gpiozero import CPUTemperature
from time import sleep, strftime, time
cpu = CPUTemperature()
with open("/home/pi/cpu_temp.csv", "a") as log:
while True:
temp = cpu.temperature
log.write("{0},{1}\n".format(strftime("%Y-%m-%d %H:%M:%S"),str(temp)))
sleep(900)
Issues:
I can run the above program and everything appears to work, however two issues
1. Time does not match, see example at end
2. When I use Cat command, program seems to abort(Is this normal?)
Example output:
Started program at 10:43
2020-07-04 09:44:08,26.284
2020-07-04 09:59:08,27.258
2020-07-04 10:14:08,28.232
2020-07-04 10:29:08,26.284
2020-07-04 10:44:08,27.258
Cat at 11:50, after that no more updates, like the program froze
Thanks,
Jerry


Software : Raspberry pi OS
Program Python3:
from gpiozero import CPUTemperature
from time import sleep, strftime, time
cpu = CPUTemperature()
with open("/home/pi/cpu_temp.csv", "a") as log:
while True:
temp = cpu.temperature
log.write("{0},{1}\n".format(strftime("%Y-%m-%d %H:%M:%S"),str(temp)))
sleep(900)
Issues:
I can run the above program and everything appears to work, however two issues
1. Time does not match, see example at end
2. When I use Cat command, program seems to abort(Is this normal?)
Example output:
Started program at 10:43
2020-07-04 09:44:08,26.284
2020-07-04 09:59:08,27.258
2020-07-04 10:14:08,28.232
2020-07-04 10:29:08,26.284
2020-07-04 10:44:08,27.258
Cat at 11:50, after that no more updates, like the program froze
Thanks,
Jerry