Re: [weewx-user] getting dots not lines on graph; could it be from nulls? tried everything else.

177 views
Skip to first unread message

Tom Keffer

unread,
Dec 2, 2022, 7:55:39 AM12/2/22
to weewx...@googlegroups.com
You're probably right about the nulls, but you didn't supply a log, nor a sample plot, so it's hard to make more than an educated guess.

Let's check the database. I'm going to assume that the outside temperature (outTemp) is showing dots. Change as necessary.

sqlite3 /var/lib/weewx/weewx_atlas.sdb
sqlite> SELECT dateTime, DATETIME(dateTime,'unixepoch','localtime'),outTemp FROM archive ORDER BY dateTime DESC LIMIT 20;

This will show the last 20 archive records. See how many nulls are in there. To take it to the next step, we'll need more information.

-tk

On Thu, Dec 1, 2022 at 7:26 PM William Garber <william...@att.net> wrote:
any help please :-)
I tried making gap_fraction = 0.3 (not 0.03) and increased archive_interval = 300.
QUESTION: Could it be that I just am getting too  many nulls in the database?

My weather station is an Acurite Atlas using SDR driver modified for indoor temp/humidity/pressure from an arduino.  The weewx server is on a raspberry pi hooked up to a usb hub.
The usb hub is connected to the RTL-SDR radio receiver dongle to receive the Acurite Atlas packets.  The usb hub is also connected to the arduino.  The modified SDR driver has three streams, stdin/stdout from the rtl_433 back-end to RTL-SDR plus ttyACM0 serial over usb connection to the arduino.  The SDR driver reads these ports with a class called AsyncInput which has one instantiation per stream.  Each AsyncInput runs in a thread.

QUESTION It should definitely be drawing lines not points based on the weewx.conf attached and the skin.conf attached as far as I can tell.

The Acurite Atlas send a sequence of about three incomplete packets to make a complete set of data plus the data from the arduino. 
QUESTION:  how do incomplete packets get combined?

--
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/3625616c-3efe-4f42-bcf3-4923d8616656n%40googlegroups.com.

William Garber

unread,
Dec 2, 2022, 12:42:47 PM12/2/22
to weewx-user
so sorry here is info
the stdout and arduino stream/threads both save lines of output (from rtl_433 and from arduino ttyACM0) to the same queue.  It seems that they may be skipping some input.  All arduinos only have an input buffer of 64 bytes but we are talking about arduino output not input.  Also if you make the arduino output very frequently like every five seconds, that sort of overwhelms the Atlas and  it skips Atlas inputs (it gets overwhelmed by arduino) but if you make the adruino ouput every 15 seconds the Atlas overwhelms the Arduino instead.  Here is the driver.
I only did not include the debuginfo since I thought it would be far too large :-)
journalctl.gw.2.log
dots.1.png
dots.2.png
weewx_atlas_adafruit.py
sqlite.log

William Garber

unread,
Dec 2, 2022, 3:47:52 PM12/2/22
to weewx-user
here is a longer log of sql. hope it is not too long.
garberw_sql.log

William Garber

unread,
Dec 2, 2022, 5:29:16 PM12/2/22
to weewx-user
sqlite> SELECT COUNT(outTemp) FROM archive where dateTime > 1669743900 and inTemp is NULL;
54
sqlite> SELECT COUNT(inTemp) FROM archive where dateTime > 1669743900 and outTemp is NULL;
389

total rows was 1000 up to that dateTime  1669743900 but that was for a varying (usually 150) archive_interval.

Tom Keffer

unread,
Dec 2, 2022, 6:00:38 PM12/2/22
to weewx...@googlegroups.com
I'm sorry William, but I don't have any great ideas. It looks like you set line_gap_fraction to 0.3, which is pretty high, so there should not be any gaps.

You have a pretty complicated setup, so I can't replicate it. The function weeplot.utilities.xy_seq_line() is responsible for breaking up lines into smaller pieces if None values are found. All I can suggest is to include some print() statements in it to see what it's doing.

Or, if you have access to a debugger, you could step through it and figure it out.

I know this answer is not very satisfying, but I don't have the time to try to replicate what you have.

-tk

William Garber

unread,
Dec 2, 2022, 6:20:09 PM12/2/22
to weewx-user
actually that's what I was looking for.  that should explain exactly when it breaks the line based on None's.   Thanks :-)  don't close this question yet please.

William Garber

unread,
Dec 3, 2022, 2:00:34 AM12/3/22
to weewx-user
here is a simple script that checks the time between packets for rtl_433.  this belongs on a weewx-sdr blog though.  it showed something was wrong.  I just had to move the radio receiver RTL-SDR dongle far enough away from the various transmitters and it worked instantly.  sorry.
wg-4-run-rtl_433-get-raw-data.sh
wg-analyze-run4.sh

William Garber

unread,
Dec 3, 2022, 12:18:19 PM12/3/22
to weewx-user
related question  on nulls / Nones in data value (not time):  if there is at most one packet with a None data value is that enough to make the whole database entry for that archive interval None ???? please :-)
where in code is this if that is easier I could look it up????

William Garber

unread,
Dec 3, 2022, 12:45:32 PM12/3/22
to weewx-user
in engine.py and accum.py it looks like it will only store a None in the database if every value in that archive_interval is None.  I am going to try and verify this.

Tom Keffer

unread,
Dec 3, 2022, 6:22:40 PM12/3/22
to weewx...@googlegroups.com
If at least one LOOP packet is received during an archive interval, then an archive record will be generated and stored. The values in the record will be whatever can be extracted from all the LOOP packets seen during the interval. If all those values are None, then nothing but nulls will be stored in the database.

William Garber

unread,
Dec 11, 2022, 8:53:08 PM12/11/22
to weewx-user
In addition to all of the other stuff mentioned the worst cause of gaps was one or multiple faulty micro usb connections.  Started acting awful nothing but gaps.  Narrowed down the cable (there were many) replaced it and fixed it right away.  To be fair it did say that in the documentation.  Still getting spikes in the other indoors variables though; that's probably poor soldering.
The lesson is to use usb type A instead of micro usb when possible.
Reply all
Reply to author
Forward
0 new messages