The dreaded watchdog. An all-purpose solution to stuff that misbehaves for poorly understood reasons.
I run a FO 1080 with 4 cameras and a cellular modem from a weewx-powered Pi and sometimes things go awry. I made a watchdog timer using a 555 and some bits. Set the timeout at about 4 minutes so that it doesn't trigger during boot. I can let anyone who wants have the circuit. I even got a PCB made ... Anyway the watchdog gets patted every couple of minutes. As people probably know, a 555 astable uses an RC network to charge a capacitor. When the capacitor is charged it flips the output, then (because it's an astable) flips it back again. I have the timing set to about 4 minutes on and 30 seconds off. Patting the dog is a GPIO lead to an NPN transistor that shorts the charging capacitor to ground. A few lines of python that runs on startup. I have my setup wired up with 12V input from a wall wart. That goes into a couple of buckies - one set to 5V for the Pi, modem and cameras and one giving 3V for the sensors. So when the power gets flicked, everything is recycled. That seems to do the job .... The watchdog of course runs off the input 12V and controls a relay that manages the 12V going into the buckies. Wonderful things buckies - cost absolutely zip and make voltage shifting a breeze. I can plug in anything between 9v and 30v ... If I execute <shutdown-h now>, the Pi shuts down. A minute or three later (depending on where the watchdog was in its charging cycle, the power is recycled - for the Pi, modem, cameras, sensors - the lot. As the Pi is not doing anything at the time the on/off is pretty harmless. I took out the auto-ftp and replaced it with a "manual" one that I run every 15 minutes after I have done wee_reports to get the latest upload. I wrote a bit more python that reads the latest index.html to make sure everything is as it should be. If not, it just skips the upload and shuts the Pi down to wait for a reset. -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
