A python script on my RPi reads the temperature from a DS18B20 probe located at /sys/bus/w1/devices/<probe id>/w1_slave
.
Right now the program is hanging at the line to read the file:
with open(file_name) as f:
return f.readlines()
If I try to cat
the file on the command line, it also hangs until I hit ctrl+c
.
I can "solve" the problem by rebooting the pi. However, what I want to do is have Python break out of the hang and then send me an email to do a manual reboot. Is this possible?
cat
fails something is wrong. Since this is obviously a kernel mode driver, have you checked/var/log/syslog
ordmesg
? – goldilocks♦ Jun 7 '15 at 20:55