More Power Solutions

So…the WeMo was fun but per my previous posts not useful if the Pi freezes during an open SkySlab session.  What to do then?  Next solution which is holding up nicely (touch wood) is to create a bash script that is run from Cron every 5 minutes.

I created a file called with the following code in bash shell script (IP address redacted).

Then I edited the cron file using sudo crontab -e and added the following line to the end of the cron file:

*/5 * * * * /usr/bin/sudo -H /pathto/ >> /dev/null 2>&1

Then ctrl+x and y (saving and activating the cron daemon as root).

Now what happens is every 5 minutes, the script pings my Pi Server (which contains amongst other things the webserver) and if there’s no response then the network has failed, so re-boot the Pi in SkySlab.

This seems to work, with a solid connection.

Related Posts