Weewx + Acurite Atlas + SDR + Raspberry Pi4

681 views
Skip to first unread message

Chris Morris

unread,
Dec 14, 2019, 12:00:36 PM12/14/19
to weewx-user
Hi everyone,

I am a total newcomer to this.  I bought an Atlas, have a set up a RPi4 running Raspbian, installed RTL-SDR, RTL_433, and WeeWx.

I can see traffic from my tower mounted Atlas (and incidentally my old temp/humidity sensor as well) when running "sudo rtl_433 -G" (see attached pic) but when I run "sudo PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/sdr.py --cmd="rtl_433 -M utc -F json -G", only the data from my old temp/humidity sensor is properly parsed.

I think I have figured out that I need a parser for my sdr.py file (as I don't see any references for the Atlas in there), as well as the what the proper sensor map would be for the Acurite Atlas.

Has anyone already cracked this nut and figured it out?  Any help would be greatly appreciated!!!  Thanks in advance!!!

Thanks,
Chris
Capture.JPG

Chris Morris

unread,
Dec 14, 2019, 12:03:30 PM12/14/19
to weewx-user
Forgot to add this screenshot.
Capture1.JPG

p q

unread,
Dec 14, 2019, 12:40:36 PM12/14/19
to weewx...@googlegroups.com
I'm looking through this post and I don't see a question other than "did anyone else crack this? Is there a question that you'd like answered? 

--
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/efb7c9f8-7cb5-408c-9491-52b11f8d2201%40googlegroups.com.


--
Peter Quinn
(415)794-2264

mwall

unread,
Dec 14, 2019, 12:53:20 PM12/14/19
to weewx-user


On Saturday, December 14, 2019 at 12:00:36 PM UTC-5, Chris Morris wrote:
I think I have figured out that I need a parser for my sdr.py file (as I don't see any references for the Atlas in there), as well as the what the proper sensor map would be for the Acurite Atlas.

Has anyone already cracked this nut and figured it out?  Any help would be greatly appreciated!!!

if you could post the json output from rtl_433 (or from running sdr.py directly) then i can add the atlas parser to sdr.py

mwall

unread,
Dec 14, 2019, 12:55:07 PM12/14/19
to weewx-user
Ah!  that is the output i needed.  working on it...

Chris Morris

unread,
Dec 14, 2019, 1:07:22 PM12/14/19
to weewx-user
Oh man, that is awesome! Thank you so much! 😃

mwall

unread,
Dec 14, 2019, 1:14:09 PM12/14/19
to weewx-user
chris, i need more packets.  the output you posted had types 37 and 39.  i think there must be more.  could you let rtl_433 run for 6 minutes and dump the output to file:

rtl_433 -M utc -F json -G > output.txt

then post the resulting output.txt file

m

Chris Morris

unread,
Dec 14, 2019, 2:14:50 PM12/14/19
to weewx-user
Ok, will do! I will get them tonight, wife and I are out now. Thank you again! Will totally PayPal you a case of beer for this! 😃

Chris Morris

unread,
Dec 15, 2019, 9:36:17 AM12/15/19
to weewx...@googlegroups.com
You were right, types 37, 38, and 39 observed.  Output.txt attached.  Thanks again!!!!

--
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.
output.txt

mwall

unread,
Dec 15, 2019, 10:59:43 AM12/15/19
to weewx-user
please try weewx-sdr 0.73.  you will need to create a sensor map to map the atlas observations into the weewx database fields.  the guide explains how to do this:


Chris Morris

unread,
Dec 15, 2019, 11:45:14 AM12/15/19
to weewx-user
Yes, that was actually the guide that I used to perform my installation.  If I can get the data from the Atlas parsed, then I can define the sensor map.  Right now, I don't see the data being parsed, so that is where I am stuck at the moment.

Chris Morris

unread,
Dec 15, 2019, 12:05:19 PM12/15/19
to weewx-user
Ahh, I see now that you updated the install!  Thank you!!!!!!  :)

Chris Morris

unread,
Apr 25, 2020, 8:04:46 AM4/25/20
to weewx-user
@MWall another user managed to get lightning data working in another thread (not my work).  I was wondering if you had managed to find a way to calculate distance data appropriately for the Atlas with WeeWX using SDR.  The distance data that is transmitted by both Atlas and the 6045 Lightning tower sensor remains the same until the next strike, so they report a distance even when there is nothing to report a distance about.



On Sunday, December 15, 2019 at 10:59:43 AM UTC-5, mwall wrote:
acurite.c
sdr.py

Greg Troxel

unread,
Apr 25, 2020, 10:00:11 AM4/25/20
to Chris Morris, weewx-user
Chris Morris <chri...@gmail.com> writes:

> @MWall another user managed to get lightning data working in another thread
> (not my work). I was wondering if you had managed to find a way to
> calculate distance data appropriately for the Atlas with WeeWX using SDR.
> The distance data that is transmitted by both Atlas and the 6045 Lightning
> tower sensor remains the same until the next strike, so they report a
> distance even when there is nothing to report a distance about.

I think this can't be done with a map - it needs to be stateful, as the
basic data model of the 6045M and weewx are different.

Of course, if you want weewx data fields that are "strike count" and
"strike distance", tht really are just what was transmitted, it works
fine. But you seem to want something different.

I would suggest that you first articulate the precise semantics you are
after, and why those make sense, and then someone, perhaps you, can
write a bit of code.

Chris Morris

unread,
Apr 25, 2020, 10:32:32 AM4/25/20
to weewx-user
So, lemme take a stab at explaining in a somewhat Boolean way...

If strike_count_total_current = strike_count_total_last, then set strike_distance = 0, else strike_distance = INTEGER (actual value reported by Atlas or 6045).

Greg Troxel

unread,
Apr 25, 2020, 12:31:29 PM4/25/20
to Chris Morris, weewx-user
Really if the current/last counts are equal, strike_distance should be
omitted, or it should be set to some sort of nil or undefined value.
It is not actually 0 either.

Then, the bits output by the acurite for distance, are not actually km
or miles. They are some complicated re-encoding of the encoding from
the detector chip that is partly but not quite understood. See the
rtl433 list archives for more information. If you are saying that
weewx records the value sent by the acurite, that's fine.

gjr80

unread,
Apr 25, 2020, 4:21:22 PM4/25/20
to weewx-user
Remember the WeeWX approach to data from a driver for a given sensor is:
  • a value of 0 should be emitted for a field when the source sensor provides a reading of 0
  • a python None should be emitted for a field where the source sensor is present but not emitting data or the data is considered 'bad' by the driver
  • a field should be omitted if the source sensor is not present
Gary

Chris Morris

unread,
Apr 25, 2020, 4:23:41 PM4/25/20
to weewx-user
Well, a guy named Jerome on another thread in RTL_433 figured out the lightning bits - https://groups.google.com/forum/#!topic/rtl_433/gvTUFWJlFxE so I am not so sure it isn't NOT understood anymore.  This was all within the last month or so.

The problem is that the Acurite equipment keeps transmitting the same last value for lightning, both strikes and distance....same as it does, essentially for rain (Atlas & 5n1).  The rain and strikes are easy enough to calculate using options within the WEEWX.CONFIG file under the deltas section of the SDR configuration.  The lightning distance isn't so easy... that is why I am saying we need something equivalent, but obviously not a delta calculation.  I see your point about using null instead of zero....zero could mean that the storm is literally right on top of me.  :-)  In any case, it would be nice if we could get that into either the logic for the "ACURITE.C" for RTL_433 file or into "SDY.PY" file for weewx-sdr.  :-)

Chris Morris

unread,
Apr 25, 2020, 4:29:09 PM4/25/20
to weewx-user
Thats just it, Gary...LOL  I don't remember...I am still very much a newbie.  :-D  I have followed instructions as best I can, and have even figured out a few things on my own, but I have only been using WeeWX since January (I started building my station in December though).  I know enough about programming to fill a thimble halfway.  LOL

That said, I *tremendously* appreciate the help of everyone on these forums....this has proven to be a really cool and rewarding hobby to pick up!  Thanks to everyone!

Chris Morris

unread,
Apr 27, 2020, 10:29:18 AM4/27/20
to weewx-user
I solved my own issue!  :-D  Putting the following line in your Weewx.conf file seems to do the trick!

[[Corrections]]
        strike_distance
= strike_distance if Lightning_Strikes > 0 else None


Gil Hutcheson

unread,
Apr 27, 2020, 11:20:29 AM4/27/20
to weewx-user
Thanks Chris!

Added to corrections. We'll see how it goes.

Chris Morris

unread,
Apr 27, 2020, 4:13:46 PM4/27/20
to weewx-user

So far, so good for me!


Capture4.JPG

Troy Roberts

unread,
Jul 14, 2020, 2:06:58 PM7/14/20
to weewx-user
Looks like you have lightning data working properly. What does you sensor map section look like, particularly for lightning?

Thanks,
Troy

Chris Morris

unread,
Jul 15, 2020, 7:13:14 AM7/15/20
to weewx-user
[SDR]
    # This section is for the software-defined radio driver.
   
    # The driver to use
    driver = user.sdr
   
    [[sensor_map]]
        outTemp = temperature.0000.AcuriteAtlasPacket
        outHumidity = humidity.0000.AcuriteAtlasPacket
        windSpeed = wind_speed.0000.AcuriteAtlasPacket
        windDir = wind_dir.0000.AcuriteAtlasPacket
        UV = uv.0000.AcuriteAtlasPacket
        rain_total = rain_total.0000.AcuriteAtlasPacket
        radiation = lux.0000.AcuriteAtlasPacket
        strikes_total = strike_count.0000.AcuriteAtlasPacket
        strike_distance = strike_distance.0000.AcuriteAtlasPacket
        lux = lux.0000.AcuriteAtlasPacket
   
    [[deltas]]
        rain = rain_total
        Lightning_Strikes = strikes_total

Troy Roberts

unread,
Jul 15, 2020, 8:07:23 AM7/15/20
to weewx-user
Thank you for the response. Looks like my lightning data from the 6045m is now logging correctly.

Side note, it looks like there are different instances of the sdr.py file (see attached). I had to modify the sdr.py to work correctly with my 5n1 and the 6045m lightning detector. I had to change the AcuriteLightningTower identifier to be "IDENTIFIER = "Acurite-6045M".
I also had defined the strike total and distance to to match the data table in the SQLite database. In my config file distance is "lightning_distance" and strike totals are defined as "lightning_strike_count". Once I changed those in my config the data began to populate the weewx.sdb. Thanks for the help Chris.
sdr.py
Reply all
Reply to author
Forward
0 new messages