Openhab won't boot up after power outage

Hi
First of all sorry for my bad English. I’ve running OH 2.2 and 2.4 with rpi 3 b+ for automating my home the problem is when power outage happens OH do not boot up and when I turn off the power and turn it on again every thing works fine. looking log file from browser nothing happens!! no loading or starting dashboard just some information about the past i mean information about before power outage happened. i have restarted openhab from console, reboot the rpi, still not working. you should turn off the power and turn it on again some times for twice to make it work.i appreciate if anyone knows how can i fix it.

Shutting down due to power outage is bad for any Linux server due to file system corruption. The SD Card most use on a rpi can also get corrupted and sometimes unreadable.
It is possible that restarting multiple times permits the Linux operating system to recover from file system corruption.
It is recommended to have the rpi connected to an Uninterruptable Power supply with software to cleanly shut down the rpi before the UPS battery is completely drained. For short power outages, the battery can maintain the rpi until mains power is available again.

1 Like

If your Pi is running on an SD card, it’s also important to have a good backup of your system, or at least your configuration. SD cards are pretty easy to mess up, and losing your config because of that is painful.

Backups are good!

2 Likes

I can recommend you this: Optimal SBC Power Supply with Backup

1 Like

Thank you, so i have to use ups, there is no software solution for this. is there any tutorial to connect ups with openhab rule how i can do that?

Thank you for your advise but this is not the solution. i want to automate my home with rpi and oh so there should be a good solution.

wooow… sascha thank you so much. exactly what i need. have you been used it? how long can it keep rpi on?

You do not need an OpenHAB rule unless you wish to monitor the UPS. There is driver software that communicates with the operating system and shuts it down cleanly if necessary.
Where are you located? What I use here in the US may not be readily available to you.

I’m using it to full satisfaction for over half a year after trying different power banks.

As there is no battery indicator, I’ve tested runtime and measured time. I’ve stopped the test after 2h which is enough to me. It should get much further,depending on the load of the rpi and the liion cell used.

Please keep in mind that the battery gets older and no health check is performed.

I am using an APC brand UPs I already has along with the serial to USB cable & apcupsd Linux driver to monitor & shut down. I may monitor with OH later.

Here’s a tutorial to set up the Network UPS Tools (NUT) binding with a compatible UPS.

As @Bruce_Osborne noted, openHAB doesn’t actually need to do anything…NUT does all of the work to monitor the UPS and shut down the RPi if necessary. However, the binding enables you to keep tabs on it. I have my wifi router and modem also on the UPS, so that openHAB can send notifications to me via the Android app (power is out, power is restored, shutting down Raspberry Pi).