Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Question regarding Davis DavisTotalPacketsReceived webtag

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
BigOkie
Posts: 272
Joined: Tue 28 May 2013 1:06 am
Weather Station: Davis VP2 Plus
Operating System: Raspian Buster (RPi 3b)
Location: Tulsa, OK

Question regarding Davis DavisTotalPacketsReceived webtag

Post by BigOkie »

So, for the last week or so I've set up a custom SQL insert to add some Davis reception stats to a table.

It's been working fine, but what I'm seeing is that once that value gets above 32767 (my guess is it's that value), the values inserted change to a negative number. It's just one value at the end of the day. Here's what I saw in the log file once I set it to debug:

Code: Select all

2021-10-14 23:45:00.381 CustomSqlMins: MySQL executing - INSERT INTO `cumulus`.`Stats` (PacketsRcvd,PacketsMissed,CRCErrors,Resyncs,MaxCons) VALUES (32711,245,31,8,1652);
2021-10-15 00:00:06.898 CustomSqlMins: MySQL executing - INSERT INTO `cumulus`.`Stats` (PacketsRcvd,PacketsMissed,CRCErrors,Resyncs,MaxCons) VALUES (-32444,247,32,8,1652);
I included the previous insert for context.

Any idea how to alleviate this?

Thanks.
User avatar
rogerthn
Posts: 514
Joined: Thu 11 Apr 2013 6:31 pm
Weather Station: Ecowitt GW1000/GW1003
Operating System: Raspberry Pi OS bullseye aarch64
Location: Trollhättan Sweden
Contact:

Re: Question regarding Davis DavisTotalPacketsReceived webtag

Post by rogerthn »

Looks like you are using Signed smallint i.e. range -32768 to 32767
The range for Unsigned is 0 to 65535, should do the trick.
Image
BigOkie
Posts: 272
Joined: Tue 28 May 2013 1:06 am
Weather Station: Davis VP2 Plus
Operating System: Raspian Buster (RPi 3b)
Location: Tulsa, OK

Re: Question regarding Davis DavisTotalPacketsReceived webtag

Post by BigOkie »

rogerthn wrote: Fri 15 Oct 2021 3:28 pm Looks like you are using Signed smallint i.e. range -32768 to 32767
The range for Unsigned is 0 to 65535, should do the trick.
OK I changed that to UNSIGNED and it was set to BIGINT (I thought I set to UNSIGNED as part of my troubleshooting) but the snippet I provided was directly from the MXdiag file on debug; wouldn't that be value it was attempting to pass? It usually doesn't show up until the last record of the day (at 23:45) so I'll set it back to debug and look at it in the morning to see if it's passing the wrong value at that time.
User avatar
rogerthn
Posts: 514
Joined: Thu 11 Apr 2013 6:31 pm
Weather Station: Ecowitt GW1000/GW1003
Operating System: Raspberry Pi OS bullseye aarch64
Location: Trollhättan Sweden
Contact:

Re: Question regarding Davis DavisTotalPacketsReceived webtag

Post by rogerthn »

BigOkie wrote: Fri 15 Oct 2021 3:52 pm OK I changed that to UNSIGNED and it was set to BIGINT (I thought I set to UNSIGNED as part of my troubleshooting) but the snippet I provided was directly from the MXdiag file on debug; wouldn't that be value it was attempting to pass? It usually doesn't show up until the last record of the day (at 23:45) so I'll set it back to debug and look at it in the morning to see if it's passing the wrong value at that time.
BIGINT, Signed or Unsigned should be OK BUT
Maybe "Davis reception stats" is Signed 16 bit?
Image
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Question regarding Davis DavisTotalPacketsReceived webtag

Post by mcrossley »

It is held in a "int" which is an alias for Int32, that has a maximum value of 2147483647.

I just fudged it to set the counter = int.MaxValue, then retrieved from the web tag and got...

{"DavisTotalPacketsReceived":"2147483647"}
Mapantz
Posts: 1808
Joined: Sat 17 Dec 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 11 x64
Location: Dorset - UK
Contact:

Re: Question regarding Davis DavisTotalPacketsReceived webtag

Post by Mapantz »

I get the negative values every day, but I thought nothing of it really, as I don't log any of it.

Code: Select all

2021-10-15 23:42:07.402 GetReceptionStats: Received - 2D-33-32-35-37-39-20-33-33-35-20-30-20-31-35-38-30-20-35-31-0A-0D
2021-10-15 23:42:07.402 GetReceptionStats: -32579 335 0 1580 51
Last edited by Mapantz on Sat 16 Oct 2021 10:43 am, edited 1 time in total.
Image
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Question regarding Davis DavisTotalPacketsReceived webtag

Post by mcrossley »

Sorry I was at cross purposes here. This is the value coming from the console. Let me look at how it is being decoded....
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Question regarding Davis DavisTotalPacketsReceived webtag

Post by mcrossley »

Actually, looking at that log entry the console is using a signed 16 bit int to hold the value because it is sending "2D-33-32-35-37-39" = -32579

I'll add a correction in the next release of CMX to allow for this...
BigOkie
Posts: 272
Joined: Tue 28 May 2013 1:06 am
Weather Station: Davis VP2 Plus
Operating System: Raspian Buster (RPi 3b)
Location: Tulsa, OK

Re: Question regarding Davis DavisTotalPacketsReceived webtag

Post by BigOkie »

mcrossley wrote: Sat 16 Oct 2021 1:09 pm Actually, looking at that log entry the console is using a signed 16 bit int to hold the value because it is sending "2D-33-32-35-37-39" = -32579

I'll add a correction in the next release of CMX to allow for this...
Is there a way to normalize that specific data or is it just not going to be accurate. Wonder why Davis would have done that. If it's any help I'm using 1.90 firmware on my Davis and would really rather not upgrade any further as I'm of the belief 'if it's not broke don't fix it'.

Thanks.
User avatar
rogerthn
Posts: 514
Joined: Thu 11 Apr 2013 6:31 pm
Weather Station: Ecowitt GW1000/GW1003
Operating System: Raspberry Pi OS bullseye aarch64
Location: Trollhättan Sweden
Contact:

Re: Question regarding Davis DavisTotalPacketsReceived webtag

Post by rogerthn »

It should (might?) be possible to add a column and convert e.g. -32579 to a "proper" value?
Image
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Question regarding Davis DavisTotalPacketsReceived webtag

Post by mcrossley »

Davis just messed up! Like you have found you do not notice until near the end of the day when the packet count can exceed the variable limit.

To convert the correct value you can just add 65536 to the returned value if it is negative.
BigOkie
Posts: 272
Joined: Tue 28 May 2013 1:06 am
Weather Station: Davis VP2 Plus
Operating System: Raspian Buster (RPi 3b)
Location: Tulsa, OK

Re: Question regarding Davis DavisTotalPacketsReceived webtag

Post by BigOkie »

mcrossley wrote: Mon 18 Oct 2021 3:39 pm Davis just messed up! Like you have found you do not notice until near the end of the day when the packet count can exceed the variable limit.

To convert the correct value you can just add 65536 to the returned value if it is negative.
Yeah, I would have never noticed it before I was using the newer versions of CMX because then the time of day request (which also seems to reset the packet count as well as day rollover) came at 4am. Now it's configurable and I started doing it at midnight.

Thanks.
Post Reply