Page 1 of 1

Lost data after power failures

Posted: Sat 26 Nov 2016 3:14 pm
by HermanZA
Firstly, if this has been addressed somewhere in the forum, please point me to the thread.

Running latest MX on a RasPi, getting its data via USB from a WMR200 weather station. All works fine.
Until one day, with a thunderstorm, my town lost power. No issue, as the whole setup is on UPS.
But then the UPS got drained and the RasPi lost power.

It was 14.8mm of rain that day, and although the WMR200 shows the rainfall, Cumulus isn't aware of the rain. Monthly total is missing that precipitation (but not sure about the yearly total).

I can only presume (and please correct me Steve and programming guru's) - the dayfile was still open, the rain data was added to the live/open file, and when the power went, that was not saved to the drive, this got lost.

Any current work around for the problem? Supposedly the catch-up feature should have gotten the data, but I noticed that's still in development. My daft plan was to schedule the CumulusNOW script to restart MX every 5 minutes past the hour, hoping to commit the data to file and loose less data.

And how do I enter the 14.8mm rainfall data of several days ago into the logs?

Appreciate the software, your help and pointers!

Re: Lost data after power failures

Posted: Mon 28 Nov 2016 1:43 pm
by steve
I'm not sure what aspects of catch-up are still in development, I can't think of anything at the moment that shouldn't be working. MX should have added the rainfall at some point when it started up, as it simply uses an incrementing counter from the station (I can't actually remember at the moment what that counter is on WMR200 stations) so if the station incremented the counter, it would have been accounted for somewhere, i.e, it can't actually get lost due to a file not being written.The only reason I can think of that would cause it not to be accounted for would be if the station had stopped sending rain data packets.

But in any case, to correct the rainfall total for a particular day, stop Cumulus and edit dayfile.txt - the format of the entries is in the wiki, and there is more information about correcting rainfall in the FAQ and wiki. I can't be a lot more help at the moment as I am currently on the move and very busy with personal and family matters.

Restarting Cumulus every five minutes is not advisable ;)

Re: Lost data after power failures

Posted: Tue 29 Nov 2016 7:44 am
by ConligWX
Do you not have NUT installed on your RasPi?

Your UPS should send a signal to your Pi or device and give it a notification that the power is due to go out and NIUT takes care of the rest and shuts down your OS and device correctly without any data corruption.

Re: Lost data after power failures

Posted: Tue 29 Nov 2016 7:52 am
by HermanZA
Steve: Thanks for the info! :clap:
Station is both utility and battery powered, so the thingy does not go down for any reason (besides a battery pull!)
I'll look at the Wiki posts to add the rainfall.
PS: automated restart is scheduled 5 minutes PAST every hour (not every 5 min) :groan:

Toxic17: Nope, its not on dedicated UPS, but on a shared one.
Awesome weather page you have!!! *envy*

Re: Lost data after power failures

Posted: Tue 29 Nov 2016 5:43 pm
by ConligWX
HermanZA wrote:Toxic17: Nope, its not on dedicated UPS, but on a shared one.
Awesome weather page you have!!! *envy*
Thanks, though it is just Saratoga Template with a few more addons ;) the hard work is done but the developers and Web Gurus.

Is your UPS plugged into something else and shuts that down? you can setup devices to become a NUT Server and power down all devices if needed.

My NAS is powered by a UPS and monitors the power, If the power goes off the UPS notifies the NAS and the NAS then send out to designated IP addresses to shut down other devices too.