consBatteryVoltage and txBatteryStatus data not added to database

422 views
Skip to first unread message

Al

unread,
Feb 22, 2014, 9:52:14 PM2/22/14
to weewx...@googlegroups.com
I am attempting to add a txBatteryStatus/consBatteryVoltage image, so
far with no success.
This is with a Vantage Pro2, and weewx v2.6.2.

Following the Customization Guide, I added consBatteryVoltage and
txBatteryStatus to stats_types in schemas.py.
After reconfiguring the database with wee_config_database to create a
new mysql database, dropping the old stats database, and starting weewx,
the two new tables now appear in the stats DB.
But no data is pulled in for the consBatteryVoltage and txBatteryStatus
tables in the stats DB.

Looking at the weewx DB, it seems that no new data is added to the
consBatteryVoltage and txBatteryStatus columns, which would explain the
lack of data in the stats DB.

consBatteryVoltage and txBatteryStatus are already shown in the
defaultArchiveSchema in schemas.py, and in the Customization Guide,
Appendix: Archive Types, I see (for consBatteryVoltage and txBatteryStatus):
appears in archive database
Can be used in tag $current
Can be used in plots

But I never get anything other than null in the database.

Not sure what I am doing wrong, but any help would be appreciated.

Al

Oz Greg

unread,
Feb 22, 2014, 11:47:42 PM2/22/14
to weewx...@googlegroups.com
You not.

If you are using the ARCHIVE record you are out of luck as Unfortunately both the consBatteryVoltage and the txBatteryStatus come from the LOOP record

A few of us capture the last LOOP record for this reason, but this might end up being a CORE feature in future releases..

weewx\bin\weewx\drivers\vantage.py lists the available field (as also does the DAVIS serial protocol)..

We use to have a Davis protocol table listing what fields are in what record in the WIKI but I cannot spot the page..

Al

unread,
Feb 24, 2014, 1:49:21 AM2/24/14
to weewx...@googlegroups.com
Oz Greg wrote:
> If you are using the ARCHIVE record you are out of luck as Unfortunately
> both the consBatteryVoltage and the txBatteryStatus come from the LOOP
> record
>
> A few of us capture the last LOOP record for this reason, but this might
> end up being a CORE feature in future releases..

Thanks Oz, at least now I know that it wasn't my usual overlooking of an
obvious setting.

Is there any documentation on how one would capture the last LOOP
record, and get that into the database?

Al

Andrew Milner

unread,
Feb 24, 2014, 2:08:58 AM2/24/14
to weewx...@googlegroups.com
Doesn't the stats database have the info?  I don't have a davis station, but looking at your post it seems as though you have changed the schema and restarted weewx - in which case the stats DB should have been rebuilt with the additional info - and the stats part of weewx does (configurable in weewx.conf) process loop records.... so I would have thought it would 'capture' your info.
Of course I may be completely off on a tangent here - as I said I don't have a vantage or the luxury of battery statuses!!

Al

unread,
Feb 24, 2014, 2:41:53 AM2/24/14
to weewx...@googlegroups.com
Andrew Milner wrote:
> Doesn't the stats database have the info? I don't have a davis station,
> but looking at your post it seems as though you have changed the schema
> and restarted weewx - in which case the stats DB should have been
> rebuilt with the additional info - and the stats part of weewx does
> (configurable in weewx.conf) process loop records.... so I would have
> thought it would 'capture' your info.
> Of course I may be completely off on a tangent here - as I said I don't
> have a vantage or the luxury of battery statuses!!

That's not how it's working here. The data is in the loop record, but
apparently consBatteryVoltage and txBatteryStatus data cannot be
captured. So nothing in either the stats DB or the archive DB.

I'm coming from wview, where consBatteryVoltage and txBatteryStatus data
is in the archive DB, so I thought that it would be the same with weewx.

I have seen at least one Vantage station running weewx that has the
consBatteryVoltage/txBatteryStatus plot icons with current data, so it
must be possible.

Al


Andrew Milner

unread,
Feb 24, 2014, 6:00:20 AM2/24/14
to weewx...@googlegroups.com
mesowx would certainly be able to pick it up from the LOOP records and store in its raw table - and display it graphically also (from the raw table).... just not sure how to get the data from the raw table to the archive table!!!  My mesowx raw table contains data from LOOP records that I am 99% sure nobody else is picking up or doing anything with - but I have no real need to move it from raw to archive as I also extended the duration of raw to be 14 days!!



Al


--
You received this message because you are subscribed to a topic in the Google Groups "Weewx user's group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/q-k9stqZqYQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Thomas Keffer

unread,
Feb 24, 2014, 8:45:43 AM2/24/14
to weewx-user
This is a reasonable thing to want and nearly trivial to add. Here's a version of the Vantage driver that saves the last value of txBatteryStatus and consBatteryVoltage seen in a LOOP packet and puts them in the archive record.

Replace bin/weewx/drivers/vantage.py with this version:


-tk


--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

Al

unread,
Feb 24, 2014, 2:52:48 PM2/24/14
to weewx...@googlegroups.com
Thomas Keffer wrote:
> Replace bin/weewx/drivers/vantage.py with this version:
>
> wget
> https://sourceforge.net/p/weewx/code/HEAD/tree/trunk/bin/weewx/drivers/vantage.py?format=raw
> -O vantage.py

Thanks Tom, great service around here!

txBatteryStatus and consBatteryVoltage are now being properly updated in
the weewx and stats DB, and images are generating correctly.

Hopefully this will be added to future releases of weewx.

Al

Hajo Harms

unread,
Feb 24, 2014, 3:38:07 PM2/24/14
to weewx...@googlegroups.com
Hi

I have installed the vantage.py driver from src. I use a Vantage Pro2 wireless.
In my database the txBatteryStatus is 0. Does't transfer the ISS the battery status ?


The Alarm and BatteryLow engines work. Is there a watchdog to inform if weewxd crash ?

Regards Hajo

By the way, nice software. This is my weatherstation. http://www.harms-gartengestaltung.de/neu/Wetter.html

Thomas Keffer

unread,
Feb 24, 2014, 3:44:15 PM2/24/14
to weewx-user
txBatteryStatus == 0 means the battery is OK.

-tk


--

Hajo Harms

unread,
Feb 24, 2014, 3:56:12 PM2/24/14
to weewx...@googlegroups.com
So if the status is 1 the ISS has a battery problem ?

Oz Greg

unread,
Feb 24, 2014, 4:33:38 PM2/24/14
to weewx...@googlegroups.com
Yes the CR123a (I think that is the battery) is flat..  

vds

unread,
Feb 25, 2014, 4:03:21 PM2/25/14
to weewx...@googlegroups.com
On Monday, February 24, 2014 1:33:38 PM UTC-8, Oz Greg wrote:
Yes the CR123a (I think that is the battery) is flat..  

On Tuesday, 25 February 2014 07:56:12 UTC+11, Hajo Harms wrote:
So if the status is 1 the ISS has a battery problem ?


Yup - mine had a status=1 and when I replaced it I found the voltage was under 2.6V when the new one was around 3.25V.  The value went back to zero (ok) after midnight that day with no manual intervention (other than schlepping the ladder and myself out there in pouring rain to switch the battery).

Geoff Cusick

unread,
Nov 15, 2019, 11:07:38 AM11/15/19
to weewx-user
I know this is an old question.....

Has the change that Tom mentioned been incorporated in later versions of vantage.py?  I’m using weewx v 3.9.2, but txBatteryStatus is always NULL in the database.

I’m using a Davis VantageVue.

Thanks
Geoff


On Monday, 24 February 2014 13:45:43 UTC, Thomas Keffer wrote:
This is a reasonable thing to want and nearly trivial to add. Here's a version of the Vantage driver that saves the last value of txBatteryStatus and consBatteryVoltage seen in a LOOP packet and puts them in the archive record.

Replace bin/weewx/drivers/vantage.py with this version:


-tk
On Mon, Feb 24, 2014 at 3:00 AM, Andrew Milner <andrew....@gmail.com> wrote:
mesowx would certainly be able to pick it up from the LOOP records and store in its raw table - and display it graphically also (from the raw table).... just not sure how to get the data from the raw table to the archive table!!!  My mesowx raw table contains data from LOOP records that I am 99% sure nobody else is picking up or doing anything with - but I have no real need to move it from raw to archive as I also extended the duration of raw to be 14 days!!
On 24 February 2014 09:41, Al <vanilla...@gmail.com> wrote:
Andrew Milner wrote:
> Doesn't the stats database have the info?  I don't have a davis station,
> but looking at your post it seems as though you have changed the schema
> and restarted weewx - in which case the stats DB should have been
> rebuilt with the additional info - and the stats part of weewx does
> (configurable in weewx.conf) process loop records.... so I would have
> thought it would 'capture' your info.
> Of course I may be completely off on a tangent here - as I said I don't
> have a vantage or the luxury of battery statuses!!

That's not how it's working here. The data is in the loop record, but
apparently consBatteryVoltage and txBatteryStatus data cannot be
captured. So nothing in either the stats DB or the archive DB.

I'm coming from wview, where consBatteryVoltage and txBatteryStatus data
is in the archive DB, so I thought that it would be the same with weewx.

I have seen at least one Vantage station running weewx that has the
consBatteryVoltage/txBatteryStatus plot icons with current data, so it
must be possible.

Al


--
You received this message because you are subscribed to a topic in the Google Groups "Weewx user's group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/q-k9stqZqYQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Weewx user's group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.

Thomas Keffer

unread,
Nov 15, 2019, 11:57:48 AM11/15/19
to weewx-user
Yes, both have been emitted since v2.6.3 (released 10-Apr-2014). 

Is txBatteryStatus null, or zero? It's normally zero. If it is truly null, then something is wrong.

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/e42336df-3f6f-4884-9339-17dc9af8d59a%40googlegroups.com.

Geoff Cusick

unread,
Nov 15, 2019, 12:13:22 PM11/15/19
to weewx...@googlegroups.com
Thanks for the (very) speedy response, Tom.

I’m running weewx 3.9.2 on a Raspberry Pi, raspbian buster.  I’m using a MySQL database, hosted on a Synology NAS (MariaDB 5).  Looking at the archive table directly through phpmyadmin shows txBatteryStatus as constantly NULL.  A query:

select * FROM  ‘archive’ WHERE txBatteryStatus <> NULL;

returns no records.

Everything else seems to work correctly (see weather.cusick.org.uk); having just had to replace the ISS battery, I thought I’d add the battery status to the ‘About’ page.

Your help would be much appreciated.

Geoff

17 Westcroft Road Holsworthy, EX22 6BY

On 15 Nov 2019, at 16:57, Thomas Keffer <tke...@gmail.com> wrote:


You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zEDaNCHwLvXHrj4Rek8prjXv-x9inYeEKy1iNpZyCjdKNQ%40mail.gmail.com.

Thomas Keffer

unread,
Nov 15, 2019, 12:17:23 PM11/15/19
to weewx-user
One thing you could try is running weewx from the command line. It will print out to the console all the data in an archive record. Watch for entries marked "REC" (most will be marked "LOOP"). What is the value of txBatteryStatus in there?

-tk

Geoff Cusick

unread,
Nov 15, 2019, 12:33:06 PM11/15/19
to weewx...@googlegroups.com
Thanks Tom.

I stopped weewx (sudo service weewx stop), then started it from the command line, as per the manual.

The LOOP packets all show txBatteryStatus as 1 - not surprising, as I only replaced the battery a couple of hours ago.  But the REC packets show  txBatteryStatus as None. 

So it looks as if txBatteryStatus is not being copied from the loop packets.

Regards
Geoff

17 Westcroft Road Holsworthy, EX22 6BY

On 15 Nov 2019, at 17:17, Thomas Keffer <tke...@gmail.com> wrote:



Thomas Keffer

unread,
Nov 15, 2019, 2:44:40 PM11/15/19
to weewx-user
Replace your copy of accum.py with the attached. Should be at /home/weewx/bin/weewx/accum.py. The new version has been instrumented to check on how txBatteryStatus is being calculated from the LOOP packets.

Then restart weewx, wait until after the first reporting cycle, then post the log from startup.

Oh, one other question: what is option [StdArchive] / record_generation set to? 'hardware' or 'software' ?

-tk


accum.py

Geoff Cusick

unread,
Nov 15, 2019, 3:19:38 PM11/15/19
to weewx...@googlegroups.com
Thanks Tom.

I’ll do that in the morning, and report back.

Regards
Geoff

17 Westcroft Road Holsworthy, EX22 6BY

On 15 Nov 2019, at 19:44, Thomas Keffer <tke...@gmail.com> wrote:


Reply all
Reply to author
Forward
0 new messages