Trying to run SDR

411 views
Skip to first unread message

Ruben Navarro Huedo

unread,
Jan 18, 2017, 8:29:26 AM1/18/17
to weewx-user
Hello friends:
Before i buy a noew Weather station i want test weewx with my RTL-SDR Receiver and my old Oregon Temp/Humid sensor.
I think i did a correct installation, but when i try start it i can read on syslog:

Jan 18 14:23:52 raspberrypi weewx[2820]: engine: Loading station type SDR (user.sdr)
Jan 18 14:23:52 raspberrypi weewx[2805]: Starting weewx weather system: weewx.
Jan 18 14:23:52 raspberrypi systemd[1]: Started LSB: weewx weather system.
Jan 18 14:23:52 raspberrypi weewx[2820]: sdr: MainThread: driver version is 0.17
Jan 18 14:23:52 raspberrypi weewx[2820]: sdr: MainThread: sensor map is {'battery.1:211.OSTHGR122NPacket': 'outBatteryStatus', 'humidity.1:211.OSTHGR122NPacket': 'outHumidity', 'temperature.1:211.OSTHGR122NPacket': 'outTemp'}
Jan 18 14:23:52 raspberrypi weewx[2820]: sdr: MainThread: deltas is {'strikes': 'strikes_total', 'rain': 'rain_total'}
Jan 18 14:23:52 raspberrypi weewx[2820]: sdr: MainThread: startup process 'rtl_433 -q -U -G -F json'
Jan 18 14:23:52 raspberrypi weewx[2820]: import of driver failed: failed to start process: [Errno 2] No existe el fichero o el directorio (<class 'weewx.WeeWxIOError'>)
Jan 18 14:23:52 raspberrypi weewx[2820]: engine: Unable to load driver: failed to start process: [Errno 2] No existe el fichero o el directorio
Jan 18 14:23:52 raspberrypi weewx[2820]:     ****  Exiting...

It is looking for some file....i don't know what ?

Please...could you help me?


My weewx.conf:

   # Set to type of station hardware. There must be a corresponding stanza
    # in this file with a 'driver' parameter indicating the driver to be used.
    station_type = SDR

[SDR]
    driver = user.sdr
    [[sensor_map]]
        battery.1:211.OSTHGR122NPacket = outBatteryStatus
        humidity.1:211.OSTHGR122NPacket = outHumidity
        temperature.1:211.OSTHGR122NPacket = outTemp

root@raspberrypi:/usr/share/weewx # sudo PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/sdr.py --cmd="rtl_433 -q -U -G"
out: ['2017-01-18 13:01:39 \t:\tOS :\tTHGR122N\n', '\tHouse Code:\t 211\n', '\tChannel:\t 1\n', '\tBattery:\t LOW\n', '\tTemperature:\t 7.30 C\n', '\tHumidity:\t 28 %\n']
parsed: {'temperature.1:211.OSTHGR122NPacket': 7.3, 'humidity.1:211.OSTHGR122NPacket': 28.0, 'battery.1:211.OSTHGR122NPacket': 1, 'usUnits': 16, 'dateTime': 1484744499}
out: ['2017-01-18 13:01:39 \t:\tOS :\tTHGR122N\n', '\tHouse Code:\t 211\n', '\tChannel:\t 1\n', '\tBattery:\t LOW\n', '\tTemperature:\t 7.30 C\n', '\tHumidity:\t 28 %\n']
parsed: {'temperature.1:211.OSTHGR122NPacket': 7.3, 'humidity.1:211.OSTHGR122NPacket': 28.0, 'battery.1:211.OSTHGR122NPacket': 1, 'usUnits': 16, 'dateTime': 1484744499}



mwall

unread,
Jan 18, 2017, 9:16:02 AM1/18/17
to weewx-user


On Wednesday, January 18, 2017 at 8:29:26 AM UTC-5, Ruben Navarro Huedo wrote:
Jan 18 14:23:52 raspberrypi weewx[2820]: sdr: MainThread: startup process 'rtl_433 -q -U -G -F json'
Jan 18 14:23:52 raspberrypi weewx[2820]: import of driver failed: failed to start process: [Errno 2] No existe el fichero o el directorio (<class 'weewx.WeeWxIOError'>)
Jan 18 14:23:52 raspberrypi weewx[2820]: engine: Unable to load driver: failed to start process: [Errno 2] No existe el fichero o el directorio
Jan 18 14:23:52 raspberrypi weewx[2820]:     ****  Exiting...

It is looking for some file....i don't know what ?

Please...could you help me?

sorry about the obscure error message.  that is the python subprocess package complaining that it cannot find the rtl_433 command.

where is rtl_433 located on your system?
 

mwall

unread,
Jan 18, 2017, 9:34:23 AM1/18/17
to weewx-user
On Wednesday, January 18, 2017 at 8:29:26 AM UTC-5, Ruben Navarro Huedo wrote:
[SDR]
    driver = user.sdr
    [[sensor_map]]
        battery.1:211.OSTHGR122NPacket = outBatteryStatus
        humidity.1:211.OSTHGR122NPacket = outHumidity
        temperature.1:211.OSTHGR122NPacket = outTemp

ruben,

where did you get the instructions for the sensor_map?

your sensor map is backwards.  it should be like this:

    [[sensor_map]]
        outBatteryStatus = battery.1:211.OSTHGR122NPacket
        outHumidity = humidity.1:211.OSTHGR122NPacket
        outTemp = temperature.1:211.OSTHGR122NPacket

but your primary problem is getting weewx-sdr to find your rtl_433 binary.

m

Ruben Navarro Huedo

unread,
Jan 18, 2017, 9:58:14 AM1/18/17
to weewx...@googlegroups.com
My rtl_433 is located in /usr/local/bin

I have modified weewx.conf and i think something is better now, but it
is not updating files in /var/www/html/weewx

What is wrong now?

here is my weewx.conf

[SDR]
driver = user.sdr
cmd = /usr/local/bin/rtl_433 -q -U -G -F json
path = /usr/local/bin
ld_library_path = /usr/local/lib

[[sensor_map]]
outBatteryStatus = battery.1:211.OSTHGR122NPacket
outHumidity = humidity.1:211.OSTHGR122NPacket
outTemp = temperature.1:211.OSTHGR122NPacket

My syslog is:

Jan 18 15:56:03 raspberrypi weewx[4287]: sdr: MainThread: lines=[]
Jan 18 15:56:06 raspberrypi weewx[4287]: sdr: MainThread:
lines=['{"time" : "2017-01-18 14:56:03", "brand" : "OS", "model" :
"THGR122N", "id" : 211, "channel" : 1, "battery" : "LOW",
"temperature_C" : 7.900, "humidity" : 27}\n', '{"time" : "2017-01-18
14:56:03", "brand" : "OS", "model" : "THGR122N", "id" : 211, "channel"
: 1, "battery" : "LOW", "temperature_C" : 7.900, "humidity" : 27}\n']
Jan 18 15:56:06 raspberrypi weewx[4287]: sdr: MainThread:
packet={'outHumidity': 27.0, 'outBatteryStatus': 1, 'dateTime':
1484751363, 'usUnits': 16, 'outTemp': 7.9}
Jan 18 15:56:07 raspberrypi weewx[4287]: sdr: MainThread: ignoring
duplicate packet {'outHumidity': 27.0, 'outBatteryStatus': 1,
'dateTime': 1484751363, 'usUnits': 16, 'outTemp': 7.9}
Jan 18 15:56:10 raspberrypi weewx[4287]: sdr: MainThread: lines=[]
Jan 18 15:56:13 raspberrypi weewx[4287]: sdr: MainThread: lines=[]
Jan 18 15:56:16 raspberrypi weewx[4287]: sdr: MainThread: lines=[]
Jan 18 15:56:19 raspberrypi weewx[4287]: sdr: MainThread: lines=[]
Jan 18 15:56:22 raspberrypi weewx[4287]: sdr: MainThread: lines=[]
Jan 18 15:56:25 raspberrypi weewx[4287]: sdr: MainThread: lines=[]

And running ps aux i can read:
root 4287 2.6 2.9 60488 27852 ? Sl 15:53 0:06
python /usr/bin/weewxd --daemon --pidfile=/var/run/weewx.pid
/etc/weewx/weewx.conf
root 4303 6.2 2.8 37088 26680 ? Sl 15:53 0:15
/usr/local/bin/rtl_433 -q -U -G -F json
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "weewx-user" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/weewx-user/KxHLqXbbiq4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> weewx-user+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Rubén Navarro Huedo
http://www.somehams.org

mwall

unread,
Jan 18, 2017, 10:31:03 AM1/18/17
to weewx-user
On Wednesday, January 18, 2017 at 9:58:14 AM UTC-5, Ruben Navarro Huedo wrote:
My rtl_433 is located in /usr/local/bin

I have modified weewx.conf and i think something is better now, but it
is not updating files in /var/www/html/weewx

What is wrong now?

perhaps you just need to wait awhile?  html files are generated by StdReport, which runs every archive interval.

btw, you are missing temperature (see the 'sdr: MainThread: packet=' message).  the packet reports temperature_C not temperature.

(this is another inconsistency in the rtl_433 decoders.  it makes it difficult to do consistent unit conversions and sensor mappings.)

m

Ruben Navarro Huedo

unread,
Jan 19, 2017, 1:21:46 PM1/19/17
to weewx-user
Hello again:

A little question:
How can i show battery status on html?
what variable must i use?

root@raspberrypi:/usr/share/
weewx # sudo PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/sdr.py --cmd="rtl_433 -q -U -G"
out: ['2017-01-18 13:01:39 \t:\tOS :\tTHGR122N\n', '\tHouse Code:\t 211\n', '\tChannel:\t 1\n', '\tBattery:\t LOW\n', '\tTemperature:\t 7.30 C\n', '\tHumidity:\t 28 %\n']
parsed: {'temperature.1:211.OSTHGR122NPacket': 7.3, 'humidity.1:211.OSTHGR122NPacket': 28.0, 'battery.1:211.OSTHGR122NPacket': 1, 'usUnits': 16, 'dateTime': 1484744499}
out: ['2017-01-18 13:01:39 \t:\tOS :\tTHGR122N\n', '\tHouse Code:\t 211\n', '\tChannel:\t 1\n', '\tBattery:\t LOW\n', '\tTemperature:\t 7.30 C\n', '\tHumidity:\t 28 %\n']
parsed: {'temperature.1:211.OSTHGR122NPacket': 7.3, 'humidity.1:211.OSTHGR122NPacket': 28.0, 'battery.1:211.OSTHGR122NPacket': 1, 'usUnits': 16, 'dateTime': 1484744499}

tnx a lot.
Reply all
Reply to author
Forward
0 new messages