I have a Python program that I wrote to check the temperature of my aquarium and based on the results it will turn the heater on or off. The problem that I am having is that the program will, for no apparent reason, give the following error code and then stop:
Traceback (most recent call last):
File "Thermo.py", line 23, in <module>
tfile = open("/sys/bus/w1/devices/28-0315a4e4e6ff/w1_slave")#yellow
FileNotFoundError: [Errno 2] No such file or directory: '/sys/bus/w1/devices/28-0315a4e4e6ff/w1_slave'
The most significant problem with this is that if it shuts down while the heater is on, then the temperature can increase significantly. To prevent this I should probably put in code to turn off the heater if I get an error, but I don't know how to do that yet.
Can anybody help in explaining why this error would randomly show up? The program has been running for months without any error and now it has done this twice in the last 24 hours.