Davis VP2 reliability with Rasp Pi zero

139 views
Skip to first unread message

iams...@gmail.com

unread,
Jan 5, 2023, 2:30:17 PM1/5/23
to weewx-user
I've been using weewx running on a Pi Zero with no other tasks. Unfortunately, I live in a area that suffers power losses, often during a weather events, so I lose that data. What typically happens is that when the power comes back on, I get the dreaded "..page timestamp... less than final timestamp..." error. The only way I have been able to address it is to use the memory dump and clear.

 I don't understand why this happens since the VP2 is running with battery backup, yet the memory on the datalogger gets corrupted. Is this an issue with weewx that could be addressed?

Failing that, can I address this issue by adding a backup supply to my Pi Zero?

Thanks!

Tom Keffer

unread,
Jan 5, 2023, 6:34:40 PM1/5/23
to weewx...@googlegroups.com
It should work.

What happens if you 'pull the plug' on your VP2? Does it keep running? Perhaps the batteries are bad?

Personally, I use a UPS for both the weewx server and the VP2 and haven't had a memory corruption problem in at least a decade. So, you could try that.




--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/c833a23b-2957-4311-882a-cda796d0c928n%40googlegroups.com.

iams...@gmail.com

unread,
Jan 5, 2023, 8:46:38 PM1/5/23
to weewx-user
"What happens if you 'pull the plug' on your VP2? Does it keep running? Perhaps the batteries are bad?

Yes, it keeps running, that is why it seems to be a weewx issue to me. In other words, if the Pi Zero running weewx were not connected to the VP2, the data logger memory would not get corrupted. In fact, weewx is able to recover data that was gathered during the power outage (while the Pi is shut down). It is only when power is restored that the data logger corruption happens. At least I assume that is really the root of the issue, I really don't know. All I know is that almost every time the power goes out, I get the record time error and all data recording and uploading stops.

I've looked into getting a UPS for the Pi, which really appears to be nothing more than a $15 ext phone battery, but it seems to me this is a weewx problem that should be addressed. Alternately, I can contact Davis to see what they say.

Graham Eddy

unread,
Jan 5, 2023, 9:36:24 PM1/5/23
to weewx...@googlegroups.com
It is much more likely your power supply being the problem. Get a ups to smooth the spikes (dunno if rpi hat does that)
⊣ GE ⊢    phone➔brevity

Greg Troxel

unread,
Jan 6, 2023, 7:17:05 AM1/6/23
to iams...@gmail.com, weewx-user
"iams...@gmail.com" <iams...@gmail.com> writes:

> I've looked into getting a UPS for the Pi, which really appears to be
> nothing more than a $15 ext phone battery, but it seems to me this is a
> weewx problem that should be addressed. Alternately, I can contact Davis to
> see what they say.
> "

It seems, from long history, that if the computer that is polling the
data logger goes away suddenly while interacting with the logger, the
logger can get messed up. This is arguably a bug in the logger.

My advice, just like the advice you got from others, is get a UPS, which
will also help avoid filesystem mess on the RPI0.

If you want to trace what's on the serial and experiment and figure out
what's going on, you certainly can. But, pretty much everybody with
the skills to do that believes in "you should get a UPS".

spam-...@robotmonkeys.net

unread,
Jan 6, 2023, 7:42:20 AM1/6/23
to weewx-user
Sometimes the logger inside your Vp2 base station gets into a weird state. You can try weewx_device —dump to try and recover you missing data, but I often just end up running —clear and eat the loss See .https://www.weewx.com/docs/hardware.htm#vantage_notes

Tom Keffer

unread,
Jan 6, 2023, 7:59:16 AM1/6/23
to weewx...@googlegroups.com
If weewx causes the corruption, I sure don't see how. It operates well within the published API provided by Davis.

Graham is probably right: a power spike from when power comes on is likely the problem. It's coming through either the VP2 power supply or, more likely, the Pi's. 

Try at least a surge suppressor. A UPS would be even better.

storm...@gmail.com

unread,
Jan 6, 2023, 8:20:17 AM1/6/23
to weewx-user
Would also look at adding a DS1307 or DS3231 RTC Module to RPI zero. This should maintain the time when the RPI zero loses power.

vince

unread,
Jan 6, 2023, 1:06:17 PM1/6/23
to weewx-user
On Friday, January 6, 2023 at 4:59:16 AM UTC-8 Tom Keffer wrote:
Graham is probably right: a power spike from when power comes on is likely the problem. It's coming through either the VP2 power supply or, more likely, the Pi's. 

Try at least a surge suppressor.

We took a crazy set of multiple dips in a couple seconds in a windstorm a couple weeks ago, with perhaps four dips in two seconds.  The NUC stayed up. All my model-B and pi4 crashed but came back up ok. 

No corruption here on my VP2 connected to a pi4, with both connected to the same surge suppressor, but maybe I just got lucky in timing.  

brisguy foo

unread,
Jan 6, 2023, 3:21:38 PM1/6/23
to Greg Troxel, weewx-user
Thanks all for the feedback! The engineer in me wants to debug this, but assuming a UPS does the trick, probably best left alone. I do appreciate all the effort put into weewx and since the interface is purely through the api, seems like it must be a logger problem. I am going to take a look at the Pi power supply though, just to see what it does on power cycle.
Reply all
Reply to author
Forward
0 new messages