Friday, May 22, 2015

IOT AC Reboot


After about a week and a half, the python app crashes requiring a reboot. I rather like Randall Munroe's solution:



How did I know the python app was crashed? First, I was able to SSH into the Pi. This means that Wi-Fi and the Pi itself are both fine. Then I checked the running processes:

$ ps aux

This showed that the python app was no longer running. For some reason it quit on its own. Without running diagnostics, there's no real way to know.

So, rather than using a light timer, I changed the python app so that it performs only one reading and quits. Crontab now calls it every minute instead of once at reboot. 


$ sudo crontab -e

# m h  dom mon dow   command
  * *  *   *   *     sudo python /home/pi/Adafruit_Python_DHT/examples/ac_once.py


What could be done for more reliability? A diagnostic memory monitor for one. And also a regular reboot performed by crontab or maybe a light timer.

No comments:

Post a Comment