Post power cut emonpi is stuck at "Raspberry Pi Booting..."

Hi,

Thanks for the reply…
No joy with power cycling it, does exactly the same
Its unresponsive on the network (ping)…

So I guess the next question is how to revive (the SD?) but keep data?

In most cases the data is not retrieveable although I am sure I read somewhere (perhaps here) of someone successfully recovering data using a 3rd party tool.

Get a new SD card and flash it with a new EmonSD image and see if it boots. It will at least confirm that is the issue.

How old is the EmonPi?

You can insert the SD Card into another working device (using a card reader) and mount the volume either natively if the device is running Linux, or using a third party tool if the device is running Windows.

If the SD Card is still readable, you should be able to get any data off it that way.

If you do have another Pi (or remove this one from it’s case) you could try connecting a screen and keyboard. although the desktop isn’t installed in the emonSD, you should be able to see how far (if at all) the emonpi is getting before failing. The printout to screen might give you the info to fix it eg running a disk repair utility.

If you have another SD card you could try putting another copy of the emonSD image in the emonPi to see if that boots. If it does, then you could plug in the card reader and old image to inspect/fix/back up.

Are you referring to the age of the SDcard or the vintage of emonSD image?

Unfortunately the latest image is not read-only, therefore the chance of failure during a power outage is significantly higher. That was a big benefit of a read-only OS.

The reason cards corrupt when power is removed is usually due to a incomplete write, ie the power was removed mid-write and the data corrupted. With the pre-oct18 images, the writes were limited, the fs was read-only and only when the feedwriter saved data from memory, momentarily every 60s, and when config files were edited etc, was the system vulnerable to power off corruption, now the OS is not RO, the writing is less controlled, it could be writing at any time, it’s a game of chance. IMO you’d be quite unlucky to corrupt the SDcard this way since the logfiles are still in RAM, but none the less, that risk has increased with losing the RO FS. I use simple battery backup UPS’s on any SD based device that isn’t RO.

Just to clarify as it hasn’t beeen specifically stated in this thread. The display is initially controlled by the emonpi-addon board as it is faster to boot up, it will display the emonpi “firmware” sketch version running on the emonpi-addon boards MCU and then display "Raspberry Pi Booting…” whilst the RPi bit of the emonPi is booting, once the RPi has booted up, it takes control of the LCD display.

So the symptoms seen here are in keeping with the emonpi-addon board doing its bit correctly and then nothing else happening. This could (in some instances) simply be the LCD driver or code not running on the otherwise fully operational RPi. In this instance though, the lack of presence on the local network suggests the RPi is not booting, but it could just be a networking issue (for example). This is also the expected behaviour if the emonPi’s RPi was totally dead, either due to HW failure or SW issues. Hence the suggestion to put the card in another RPi or remove this one from it’s case and attach a monitor.

Whilst the case is open, is there any LED activity on the RPi when you try booting?

Hi,
I have a similar problem than @graemetherunner.
I got my emponpi 3 months ago with pre-built sd card- I use it to monitor power consumption at home. I went off for 3 weeks and when I cambe back I had the message “Raspberry Pi Booting”.
When I power ON/OFF, the LCD shows the emonpi vresion 2.9, goes through CT detecttion and temperature probe detection, then stays in the “Raspberry Pi booting” state.
I connected an HDMI screen and what I see is a last message saying “end kernel panic -not syncing: Attempted to kill init! exitcode=0x00007f00”.

I don’t mind building a new SD card and re-configuring my system, but I would like to know how to avoid this happening again. Should I go to a Read-Only OS?

thanks for the info. just found an old nix laptop and accessed the card… any clues to where data is stored… ?

For an EmonSD image, it’s usually in /home/pi/data, depending on what data you want to retrieve of course. Thats where all the timeseries data is stored anyway.

thank you. I’ve flashed a new card… the device is working, so must be a boot issue caused by the cut as per suggestions above.

In which case can I just copy the boot partition to the old sd and its fixed

both the new and old cards are flashed with the same version

If possible, I’d take an image of your original SD card before doing anything, so you can at least get back to your starting position…

If you have the original SD card available in your other linux system, you could try and run fsck against each of the partitions on the SD card and then put it back into your RPi and see if it boots (without copying anything anywhere).

Which image?

17 July 15

I’m not sure what the image looked like back then so I don’t really feel qualified to offer any further suggestions!

Hi,
I’ve had the same thing happen. We had a power cut and when power came back my emonpi now won’t progress past “booting… Please wait”. I’ve tried turning it all off and back on but no joy.
I can’t access or ping the emonpi on the network either.
I think this is the second time this has happened. Last time I had to flash a new sd card with an emonSd image (24Jul20) and lost all the data.

The only advice I can offer is to repeat what @borpin (whom we haven’t seen for a few weeks now) usually suggested in these circumstances: use a good mains conditioner. It obviously won’t help you now, but his experience was that it may well save you next time.

It’s worth trying to read the card in another computer. If the damage is to the OS and the data is intact, you should be able to copy the relevant files. You might need @glyn.hudson or @TrystanLea’s help to know which they are and their locations.

Hello @Dr_W sorry to hear that. Surge protection seems to have really improved things for me as well.

Hopefully you should be able to restore the data using the method documented here:
Update & Upgrade - Guide | OpenEnergyMonitor

I appreciate that it’s a bit of a pain!

Resurrection post.

This happened to me recently, the Linux utility fsck saved the day! I ran it via the disks tool in Ubuntu.

Now I should stump up for a UPS…

So what surge / ups is recommended… could you get away with just powering a small usb backup battery and then powering the emonpi from that?
(Something like an anker mini)

My “UPS” solution is posted here

IME a simple surge plug https://www.amazon.co.uk/Belkin-BSV102af-SurgeCube-Surge-Protection/dp/B00OLTJSZY/ is sufficient.

Lots of different UPS solutions - me I have a UPC 750 I bought off ebay and new batteries from Farnell. Provides UPS to all my core network gear (and a second one for the Broadband Router).

For the most robust system I have, I put Proxmox VE onto an old laptop and put emoncms onto a Ubuntu Container. That setup has a builtin UPS :slight_smile:

1 Like

Many thanks for posting this. Recently had a similar problem. Data recovered perfectly.