Help with Acurite5n1 & rtl-sdr

595 views
Skip to first unread message

Ryan Weber

unread,
Dec 7, 2021, 1:05:05 AM12/7/21
to weewx-user
Hi all, 

I've had Weewx set uad and running on my raspberry pi 4 for a few months now. I have an older Acurite 5n1 station we bought at Costco a few years ago. I followed the instructions at matthewwall on github.


Using a rtl-sdr and rtl_433 I am able to decode information from the 5in1.

Here's my problem, and what I asking for help with:

I can not understand how to get rainfall data to show up in weewx. The 5in1 sends:

"rain_in" : 19.730 

but I don't understand how weewx wants to use that information. In my weewx.conf file, I have these settings:

    cmd = rtl_433 -M utc -F json
    #    cmd = rtl_433 -M utc -F json -R 78 -f 914980000 -s 250000
    [[sensor_map]]
        # barometer
        # pressure
        # altimeter
        # inTemp temperature_in
        outTemp = temperature.0050.Acurite5n1PacketV2
        # inHumidity humidity_in
        outHumidity = humidity.0050.Acurite5n1PacketV2
        windSpeed = wind_speed.0050.Acurite5n1PacketV2
        windDir = wind_dir.0050.Acurite5n1PacketV2
rain_total = rain_in.0050.Acurite5n1PacketV2
# rain_total = rain_total.0050.Acurite5n1PacketV2
#       rain = rain_in.0050.Acurite5n1PacketV2
#       rainRate = rssi.0050.Acurite5n1PacketV2
        # dewpoint
        # windchill
        # heatindex
        # rxCheckPercent rssi
        outTempBatteryStatus = battery.0050.Acurite5n1PacketV2

I've messed around with trying different combinations of settings, but my web page always shows 0 rain information. 

What am I missing?

Thanks for any and all help. I apologize if the solution is documented elsewhere, I have not found it.

Ryan NN7M

syslog
weewx.conf
West Seattle, WA.pdf

matthew wall

unread,
Dec 7, 2021, 8:40:34 AM12/7/21
to weewx-user
which version of weewx-sdr are you using?

matthew wall

unread,
Dec 7, 2021, 3:49:32 PM12/7/21
to weewx-user
you can find the version like this if you used wee_extension to install weewx-sdr:

wee_extension --list

or like this:

grep VERSION /home/weewx/bin/user/sdr.py

the latest release of weewx-sdr does a mapping from rain_in to rain_total.  so in the sensor map section you want this:

rain_total = rain_total.0050.Acurite5n1PacketV2

where does rain_in come from, you ask?  that is a label applied by rtl_433.  the label from rtl_433 has changed over the years, so there are conditionals in the sdr.py code to deal with different rtl_433 output.  it looks like your rtl_433 is emitting rain_in, but your sdr.py does not seem to be converting that to rain_total.

note that you do not have to specify the deltas section - the default deltas section includes rain and lightning, so you only have to specify deltas if there are observations other than rain and lightning.

m

Ryan Weber

unread,
Dec 7, 2021, 6:57:36 PM12/7/21
to weewx-user
m,

the version is 0.78

this is so helpful, thank you. I'm not great navigating around linux, so I really appreciate the help. And the instruction. 

How do I go about updating to the newest version of weewx-sdr? 

matthew wall

unread,
Dec 7, 2021, 9:20:09 PM12/7/21
to weewx-user
On Tuesday, December 7, 2021 at 6:57:36 PM UTC-5 weber...@gmail.com wrote:
the version is 0.78
...
How do I go about updating to the newest version of weewx-sdr? 

as of nov 2021, the latest version of weewx-sdr is 0.83.  download the latest weewx-sdr, then upgrade by using the same process that you used to install it.

Ryan Weber

unread,
Dec 9, 2021, 1:52:46 AM12/9/21
to weewx-user
I'm having problems following your directions for installing the latest version of weewx-sdr.

4) run the driver directly to identify the packets you want to capture cd /home/weewx sudo PYTHONPATH=bin python bin/user/sdr.py --cmd="rtl_433 -M utc -F json"

my path is different, as far as I understand. When I change the command to where I've found my sdr.py, I get this response:

sudo PYTHONPATH=bin python ./weewx-sdr/bin/user/sdr.py --cmd="rtl_433 -M utc -F json"
Traceback (most recent call last):
  File "./weewx-sdr/bin/user/sdr.py", line 91, in <module>
    import weewx.drivers
ImportError: No module named weewx.drivers


I can't seem to get past this point. 

matthew wall

unread,
Dec 9, 2021, 6:59:17 AM12/9/21
to weewx-user
On Thursday, December 9, 2021 at 1:52:46 AM UTC-5 weber...@gmail.com wrote:
I'm having problems following your directions for installing the latest version of weewx-sdr.

4) run the driver directly to identify the packets you want to capture cd /home/weewx sudo PYTHONPATH=bin python bin/user/sdr.py --cmd="rtl_433 -M utc -F json"

my path is different, as far as I understand. When I change the command to where I've found my sdr.py, I get this response:

sudo PYTHONPATH=bin python ./weewx-sdr/bin/user/sdr.py --cmd="rtl_433 -M utc -F json"
Traceback (most recent call last):
  File "./weewx-sdr/bin/user/sdr.py", line 91, in <module>
    import weewx.drivers
ImportError: No module named weewx.drivers

the PYTHONPATH should terminate at the weewx BIN_ROOT directory (where the weewx executables are located).  if you installed using rpm or deb package, that would be:

PYTHONPATH=/usr/share/weewx

if you installed using setup.py to the /home/weewx directory, that would be:

PYTHONPATH=/home/weewx/bin

you can use either absolute or relative path

Ryan Weber

unread,
Dec 17, 2021, 7:55:36 PM12/17/21
to weewx-user
Matthew,

I was able to update to the newest version of weewx-sdr. Thank you for the help:

pi@nn7m-pi:~ $ wee_extension --list
Extension Name    Version   Description
sdr               0.83      Capture data from rtl_433


I have mapped the rain_total as you advised in the /etc/weewx/weewx.conf file:

[SDR]
    # This section is for the software-defined radio driver.

    # The driver to use
    driver = user.sdr

    # The time (in seconds) between LOOP packets.
    loop_interval = 2.5


    path = /usr/share/weewx/user/

    cmd = sudo rtl_433 -M utc -F json


    [[sensor_map]]
        #       barometer      
        #       pressure        
        #       altimeter
        #       inTemp          temperature_in  
        outTemp = temperature.0050.Acurite5n1PacketV2
        #       inHumidity      humidity_in            
        outHumidity = humidity.0050.Acurite5n1PacketV2
        windSpeed = wind_speed.0050.Acurite5n1PacketV2
        windDir = wind_dir.0050.Acurite5n1PacketV2

#       rain_total = rain_in.0050.Acurite5n1PacketV2
       rain_total = rain_total.0050.Acurite5n1PacketV2


        #       dewpoint
        #       windchill
        #       heatindex
        #       rxCheckPercent  rssi            
#        outTempBatteryStatus = battery_ok.0050.Acurite5n1PacketV2


    [[deltas]]
#               rain = rain_total

But still, no rain info is being reported to the web page. I'm not sure what to do here? When I stop weewx and watch the rtl_433 output, it reports Rainfall Accumilation :

time      : 2021-12-17 16:50:18
model     : Acurite-5n1  message_type: 49          id        : 80
channel   : C            sequence_num: 0           battery   : 1             wind_speed: 1.8 km/h      wind_dir_deg: 90.0        Rainfall Accumulation: 22.08 in                     Integrity : CHECKSUM


When I run sudo rtl_433 -M utc -F json I get rain_in:

{"time" : "2021-12-18 00:53:54", "model" : "Acurite-5n1", "message_type" : 49, "id" : 80, "channel" : "C", "sequence_num" : 1, "battery_ok" : 1, "wind_avg_km_h" : 6.795, "wind_dir_deg" : 90.000, "rain_in" : 22.080, "mic" : "CHECKSUM", "mod" : "ASK", "freq" : 433.959, "rssi" : -2.191, "snr" : 5.146, "noise" : -7.337}

matthew wall

unread,
Dec 19, 2021, 6:40:40 PM12/19/21
to weewx-user
On Friday, December 17, 2021 at 7:55:36 PM UTC-5 weber...@gmail.com wrote:
    [[deltas]]
#               rain = rain_total

you should remove the deltas section entirely.  as it is, you have specified an empty section for deltas, which causes the sdr driver to erase all of its default delta definitions.
 

Ryan Weber

unread,
Dec 19, 2021, 10:19:16 PM12/19/21
to weewx-user
Removing [[deltas]] appears to have corrected the problem. It's not currently raining, but it is putting a line on the graph on 0" now. That has not happened before. Fingers crossed!

Thanks again for all your help. I'll report back when there's some rainfall to report (could happen any minute here in western Washington).

Ryan Weber

unread,
Dec 21, 2021, 9:05:11 AM12/21/21
to weewx-user
Sure enough, rain info is being reported now. Thanks again Matthew and others, I appreciate all the help!
Reply all
Reply to author
Forward
0 new messages