Openhab on Raspberry Pi.
For a scenario where a Pi (running Openhab) crashes and no-one is on hand to restart it : has anyone explored a second “failover” Pi, also with Openhab installed, with associated scripts to ensure continued smooth operation?
This is not a backup question - as I am assuming that key config files would be backed up to a remote server in any event.
Presumably a solution would involve something like a software watchdog, which runs on startup.
I anticipate that features would include the following:
Openhab is running
First Pi sends regular pings to Second Pi to indicate normal operation, presumably across GPIO pins or LAN.
Pings should come from Openhab itself, rather than some other software
On Crash, Pings will stop
Openhab is not running
Watchdog listener takes no action as long as pings received from First Pi
When Pings Stop:
Triggers power reset for First Pi, waits to see if Pings restart
If no restart after a longer period of time, starts its own Openhab instance.
There’ll be no Failover support for this instance of Openhab, since the First Pi is still not working.
On Power reset - unclear at this point if Openhab is running or is still inoperable
Cron script or similar to stop then start Openhab
Thoughts welcome - would be grateful. If anyone has done this before I would appreciate it if you could share steps / code for a beginner…