Oregon Scientific and SDR issue

338 views
Skip to first unread message

Linda Eriksson

unread,
Aug 4, 2018, 11:41:27 AM8/4/18
to weewx-user
Hi, I've got an Oregon Scientific lw301 that I've fed to Weewx using the Interceptor driver for some months now with no issues.
However, a few weeks ago their server decided to take a vacation and thus Weewx has not been getting any data.
So, I decided that I might as well bypass them alltogether and ordered a DVD-T receiver to pick up the data straight from the sensors.
It's gone sorta half-good, half stonewall. I have 2 temp sensors (THGR810) that work fine, however I can't get the wind (WGR800) and the rain (PCR800) sensors to be recognized. 
From rtl_sdr I have the following from the sensors:

2018-08-03 15:48:38 : OS : WGR800
House Code: 93
Channel: 0
Battery: OK
Gust: 0.7 m/s
Average: 0.9 m/s
Direction: 247.5 degrees
OSWGR800Packet(Packet)
2018-08-03 15:48:38 : OS : PCR800
House Code: 236
Channel: 0
Battery: OK
Rain Rate: 0.0 in/hr
Total Rain: 109.6 in
OSPCR800Packet(Packet)
2018-08-03 15:48:08 : OS : THGR810
House Code: 172
Channel: 1
Battery: OK
Celsius: 29.70 C
Humidity: 41 %
OSTHGR810Packet(Packet)
2018-08-03 15:47:46 : OS : THGR810
House Code: 245
Channel: 2
Battery: OK
Celsius: 35.90 C
Humidity: 44 %

The part relating to sdr in weewx.conf:

[SDR]
    # This section is for the software-defined radio driver.
    
    # The driver to use
    driver = user.sdr
    cmd = rtl_433 -q -U -F json -R 12
    [[sensor_map]]
windDir = wind_dir.0:93.OSWGR800Packet
windGust = wind_gust.0:93.OSWGR800Packet
windSpeed = wind_speed.0:93.OSWGR800Packet
windBatteryStatus = battery.0:93.OSWGR800Packet
inTemp = temperature.2:245.OSTHGR810Packet
inHumidity = humidity.2:245.OSTHGR810Packet
inTempBatteryStatus = battery.2:245.OSTHGR810Packet
outTemp = temperature.1:172.OSTHGR810Packet
outHumidity = humidity.1:172.OSTHGR810Packet
outTempBatteryStatus = battery.1:172.OSTHGR810Packet
rainRate = rain_rate.0:236.OSPCR800Packet
rain = rain_total.0:236.OSPCR800Packet
rainBatteryStatus = battery.0:236.OSPCR800Packet
#    log_unknown_sensors = True
#    log_unmapped_sensors = True


Running weewx it spits out for wind:

Aug  4 17:29:22 raspberrypi weewx[9868]: sdr: MainThread: lines=['{"time" : "2018-08-04 15:29:19", "brand" : "OS", "model" : "WGR800", "id" : 93, "channel" : 0, "battery" : "OK", "gust" : 0.700, "average" : 1.000, "direction" : 315.000}\n']
Aug  4 17:29:22 raspberrypi weewx[9868]: sdr: MainThread: punt unrecognized line '{"time" : "2018-08-04 15:29:19", "brand" : "OS", "model" : "WGR800", "id" : 93, "channel" : 0, "battery" : "OK", "gust" : 0.700, "average" : 1.000, "direction" : 315.000}#012'

for rain:

Aug  4 17:29:30 raspberrypi weewx[9868]: sdr: MainThread: lines=['{"time" : "2018-08-04 15:29:27", "brand" : "OS", "model" : "PCR800", "id" : 236, "channel" : 0, "battery" : "OK", "rain_rate" : 0.000, "rain_total" : 109.594}\n']
Aug  4 17:29:30 raspberrypi weewx[9868]: sdr: MainThread: punt unrecognized line '{"time" : "2018-08-04 15:29:27", "brand" : "OS", "model" : "PCR800", "id" : 236, "channel" : 0, "battery" : "OK", "rain_rate" : 0.000, "rain_total" : 109.594}#012'

and for temp (the sensor type that works):

Aug  4 17:29:41 raspberrypi weewx[9868]: sdr: MainThread: lines=['{"time" : "2018-08-04 15:29:38", "brand" : "OS", "model" : "THGR810", "id" : 245, "channel" : 2, "battery" : "OK", "temperature_C" : 30.300, "humidity" : 57}\n']
Aug  4 17:29:41 raspberrypi weewx[9868]: sdr: MainThread: packet={'dateTime': 1533396578, 'inHumidity': 57.0, 'inTemp': 30.3, 'usUnits': 16, 'inTempBatteryStatus': 0}



Since I have 2 out of 4 sensors working, it feels like I messed up the sensor_map, but not sure how.
I'm pretty useless on programming, so would appreciate any help.

Linda Eriksson

unread,
Aug 9, 2018, 7:05:17 AM8/9/18
to weewx-user
Adding weewx.conf and syslog.
syslog
weewx.conf

Andy

unread,
Aug 9, 2018, 1:55:54 PM8/9/18
to weewx-user
Taking a guess here it appears the json parser for is not in sdr.py driver for WGR800 and PCR800. THGR810 has the json parser on line 1381 of sdr.py 

Perhaps adding this json parse on line 1484 of sdr.py version 44 will work to fix WGR800 issues.  Replace your existing sdr.py driver with the attached one and give it a try.  

 @staticmethod
    def parse_json(obj):
        pkt = dict()
        pkt['dateTime'] = Packet.parse_time(obj.get('time'))
        pkt['usUnits'] = weewx.METRIC
        pkt['house_code'] = obj.get('id')
        pkt['channel'] = obj.get('channel')
        pkt['battery'] = 0 if obj.get('battery') == 'OK' else 1
        pkt['wind_gust'] = Packet.get_float(obj, 'gust')
        pkt['wind_speed'] = Packet.get_float(obj, 'average')
        pkt['wind_dir'] = Packet.get_float(obj, 'direction')
        return OS.insert_ids(pkt, OSWGR800Packet.__name__)







sdr.py

Linda Eriksson

unread,
Aug 10, 2018, 2:51:54 AM8/10/18
to weewx-user
That seems to have done half the trick.
I don't get the wind measurements into weewx, but it stopped 'punting' at it.
I suppose the pcr800 needs to have the same thing, but with rain-related values?
loops.txt
syslog

Andy

unread,
Aug 10, 2018, 12:56:50 PM8/10/18
to weewx-user
[SDR]
    # This section is for the software-defined radio driver.
    
    # The driver to use
    driver = user.sdr
    
    log_unknown_sensors = True
    log_unmapped_sensors = True   

Uncomment log_unknown_sensors and log_unmapped_sensors in weewx.conf
Try the attached version 0.45 of the SDR driver.
Restart weewx
Post some more syslog after weewx has run long enough to see data from those sensors.

Andy

sdr.py

Linda Eriksson

unread,
Aug 11, 2018, 6:49:11 AM8/11/18
to weewx-user
Yikes, it seems I have got rain! 
...well, at least to the best knowledge of the sensor, it was oblivious to the downpour we just had, but I suspect that's probably spider web or some other non welcome occupant.
Either way, the lost sensor of PCR appears to have been found, and that is the important thing.
Wind is still missing.
Attaching syslog part and the loops (do the LOOP stuff go into some other log? they don't show up in syslog, only in the tab that I run weewx from).

Many thanks
Linda

loops.txt
syslog

Andy

unread,
Aug 12, 2018, 1:16:58 PM8/12/18
to weewx-user
I cannot tell what is happening without more run time. Let it run through a couple archive intervals (about fifteen minutes if set to default of 5 minutes) and post that syslog. 

Andy

Linda Eriksson

unread,
Aug 13, 2018, 6:06:26 AM8/13/18
to weewx-user
Have about half an hour of running here.

syslog.txt

Linda Eriksson

unread,
Aug 15, 2018, 6:33:38 AM8/15/18
to weewx-user
Seems I was a bit to quick to regard the rain gauge as working.
After cleaning away the remains of a spider restaurant I changed batteries and reset the device, and from what I can understand it claims in it's broadcasts that it has rained 1.909 inches since (about 2 days time). Quick mental conversion would have that to be around 50mm. It might not be 100% correct but it is in the right ballpark. Looking at weewx however, it says it has rained 1679,9mm since midnight. Yesterday it reached around 10000mm. I sorta suspect it is the conversion between us and the metrics that gets confused, but not sure where.

Linda

Andy

unread,
Aug 15, 2018, 9:18:26 AM8/15/18
to weewx-user
looking at your latest syslog file, the messages are failing to map, but looking at the sensor map the wind seems to match.

Aug 13 11:43:31 raspberrypi weewx[6192]: sdr: MainThread: lines=['{"time" : "2018-08-13 09:43:28", "brand" : "OS", "model" : "WGR800", "id" : 93, "channel" : 0, "battery" : "OK", "gust" : 0.000, "average" : 0.700, "direction" : 112.500}\n']
Aug 13 11:43:31 raspberrypi weewx[6192]: sdr: MainThread: unmapped: [] ({})

'windDir': 'wind_dir.0:93.OSWRG800Packet', 
'windGust': 'wind_gust.0:93.OSWRG800Packet', 
'windSpeed': 'wind_speed.0:93.OSWRG800Packet', 
'windBatteryStatus': 'battery.0:93.OSWRG800Packet',


From you last post, the rain is working? But from the syslog looks like the id changed from 236 to 251?

Aug 13 11:53:16 raspberrypi weewx[6192]: sdr: MainThread: lines=['{"time" : "2018-08-13 09:53:13", "brand" : "OS", "model" : "PCR800", "id" : 251, "channel" : 0, "battery" : "OK", "rain_rate" : 0.000, "rain_total" : 0.000}\n']
Aug 13 11:53:16 raspberrypi weewx[6192]: sdr: MainThread: unmapped: [] ({})

'rainRate': 'rain_rate.0:236.OSPCR800Packet', 'rain': 
'rain_total.0:236.OSPCR800Packet', 
'rainBatteryStatus': 'battery.0:236.OSPCR800Packet'

Linda Eriksson

unread,
Aug 15, 2018, 11:29:10 AM8/15/18
to weewx-user
The rain works, as in weewx picks up the data it broadcasts, however it seems to read it wrong as the numbers that come out are extremely inflated. I considered putting something in [StdQC], but I suspect that would mean no rain at all, since all readings are inflated. 

The ID changed after I used the reset button on it after cleaning it up, I adjusted the mapping to match it.

However, I need to ask someone to smack me hard in the head. I was just thinking that I should see if and how the anemometer would be reset, so I highlighted the relevant part of it from your post and clicked to google it to find a manual... and got some stuff related to it, but not quite how I expected it. I thought I had copy pasted every time to get it right but I must have messed up at some point. OSWRG800Packet and OSWGR800Packet looks close enough for my eyes to miss it, but not close enough to fool a computer.
Corrected the spelling and I now have wind.
Don't know if I should feel elated or ashamed. A bit of both I guess.

Also just noted that the PCR800 is still broadcasting 

Aug 15 17:21:57 raspberrypi weewx[16306]: sdr: MainThread: packet={'rainBatteryStatus': 0, 'rainRate': 0.0, 'usUnits': 17, 'rain': 1.909, 'dateTime': 1534346506}

which is same as it did early today, however looking at rain since midnight it is up to 2346,2mm now, from earlier 1679,9mm. It has not rained during this time, and most definitely not over half a meter :p Looking at the rain today graph it has recorded it at a pretty constant level.

Andy

unread,
Aug 15, 2018, 12:41:14 PM8/15/18
to weewx-user
Try this one, fixed the units.


sdr.py

Linda Eriksson

unread,
Aug 15, 2018, 3:26:41 PM8/15/18
to weewx-user
Something is really weird with this I think.
I turned off weewx, replaced the sdr driver, wiped out all raindata from today from the database, dropped and rebuilt daily and restarted weewx.
Checking in on it after a cycle or two, I already have 263,9mm since midnight. The sky is blue and we have no rain. 
loops.txt
syslog.txt

Linda Eriksson

unread,
Aug 17, 2018, 5:22:48 AM8/17/18
to weewx-user
Think it's all working now.
Had missed out on adding a delta on the rain, so it just kept raining. Not sure when there will rain next time for real, so i cleaned up the database and poured some water into the gauge until I heard a 'donk'. Almost an hour later it has not added on more after that, and it claims it has rained 1.1mm. 

Thanks a lot for the help, hoping this will be the last I'll need to post here for a while due to this . 
:)

Linda
Reply all
Reply to author
Forward
0 new messages