Weewx 3.9.2 "KeyError: 'driver'" in start weewx

62 views
Skip to first unread message

Juan EC7D

unread,
Mar 8, 2020, 6:08:02 PM3/8/20
to weewx-user



Hello, I am new to this, I have installed sdr and rtl software following the help guide, I have solved some inconveniences due to the difference in folder locations, but when I start the weewx I have this driver load error. could you please help me, thanks


pi@meteo:~ $ sudo /etc/init.d/weewx start;sudo tail -f /var/log/syslog
[ ok ] Starting weewx (via systemctl): weewx.service.
Mar  8 22:53:15 meteo weewx[16097]:     ****    File "/home/weewx/bin/weewx/engine.py", line 888, in main
Mar  8 22:53:15 meteo weewx[16097]:     ****      engine = engine_class(config_dict)
Mar  8 22:53:15 meteo weewx[16097]:     ****    File "/home/weewx/bin/weewx/engine.py", line 72, in __init__
Mar  8 22:53:15 meteo weewx[16097]:     ****      self.setupStation(config_dict)
Mar  8 22:53:15 meteo weewx[16097]:     ****    File "/home/weewx/bin/weewx/engine.py", line 90, in setupStation
Mar  8 22:53:15 meteo weewx[16097]:     ****      driver = config_dict[stationType]['driver']
Mar  8 22:53:15 meteo weewx[16097]:     ****    File "/usr/lib/python2.7/dist-packages/configobj.py", line 554, in __getitem__
Mar  8 22:53:15 meteo weewx[16097]:     ****      val = dict.__getitem__(self, key)
Mar  8 22:53:15 meteo weewx[16097]:     ****  KeyError: 'driver'
Mar  8 22:53:15 meteo weewx[16097]:     ****  Exiting.

vince

unread,
Mar 8, 2020, 8:12:27 PM3/8/20
to weewx-user
On Sunday, March 8, 2020 at 3:08:02 PM UTC-7, Juan EC7D wrote:
Mar  8 22:53:15 meteo weewx[16097]:     ****    File "/usr/lib/python2.7/dist-packages/configobj.py", line 554, in __getitem__
Mar  8 22:53:15 meteo weewx[16097]:     ****      val = dict.__getitem__(self, key)
Mar  8 22:53:15 meteo weewx[16097]:     ****  KeyError: 'driver'
Mar  8 22:53:15 meteo weewx[16097]:     ****  Exiting.


Weewx is not finding the driver you have specified in weewx.conf
The "differences in file locations" you mention is likely the cause.

What is your driver setting in weewx.conf ?

Where do you have the driver(s) installed ?
 

Juan EC7D

unread,
Mar 8, 2020, 8:37:55 PM3/8/20
to weewx-user
thanks for answering my question
The driver configuration in weewx.conf is:
SDR]
    # This section is for the software-defined radio driver.
    # The driver to use
    driver = user.sdr
    #path = /home/pi/rtl_433
     cmd = rtl_433 -f 868M -s 1024k -M utc -F jons
     #path = /opt/rtl-433/bin
     #ld_library_path = /opt/libusb-1.0.20/lib:/opt/rtl-sdr/lib
[[sensor_map]]

       outTemp = temperature.*.FOWHx080Packet
       windSpeed = wind_avg_km_h.*.FOWHx080Packet
       windDir = wind_dir_deg.*.FOWHx080Packet
       outHumidity = humidity.*.FOWHx080Packet
       rain = rain_mm.*.FOWHx080Packet

this is what appears now in weewx load tracking:
pi@meteo:~ $ sudo /etc/init.d/weewx start;sudo tail -f /var/log/syslog
[ ok ] Starting weewx (via systemctl): weewx.service.
Mar  9 01:25:27 meteo systemd[1]: Starting LSB: weewx weather system...
Mar  9 01:25:29 meteo weewx[4272]: engine: Initializing weewx version 3.9.2
Mar  9 01:25:29 meteo weewx[4272]: engine: Using Python 2.7.9 (default, Sep 16 2019, 18:29:54) #012[GCC 4.9.2]
Mar  9 01:25:29 meteo weewx[4272]: engine: Platform Linux-4.4.45+-armv6l-with-debian-8.0
Mar  9 01:25:29 meteo weewx[4272]: engine: Locale is 'es_ES.UTF-8'
Mar  9 01:25:29 meteo weewx[4272]: engine: pid file is /var/run/weewx.pid
Mar  9 01:25:29 meteo weewx[4262]: Starting weewx weather system: weewx.
Mar  9 01:25:29 meteo systemd[1]: Started LSB: weewx weather system.
Mar  9 01:25:29 meteo weewx[4276]: engine: Using configuration file /home/weewx/weewx.conf
Mar  9 01:25:29 meteo weewx[4276]: engine: Loading station type SDR (user.sdr)
Mar  9 01:25:30 meteo weewx[4276]: sdr: MainThread: driver version is 0.77
Mar  9 01:25:30 meteo weewx[4276]: sdr: MainThread: sensor map is {'outTemp': 'temperature.*.FOWHx080Packet', 'windSpeed': 'wind_avg_km_h.*.FOWHx080Packet', 'windDir': 'wind_dir_deg.*.FOWHx080Packet', 'outHumidity': 'humidity.*.FOWHx080Packet', 'rain': 'rain_mm.*.FOWHx080Packet'}
Mar  9 01:25:30 meteo weewx[4276]: sdr: MainThread: deltas is {'strikes': 'strikes_total', 'rain': 'rain_total'}
Mar  9 01:25:30 meteo weewx[4276]: sdr: MainThread: startup process 'rtl_433 -f 868M -s 1024k -M utc -F jons'
Mar  9 01:25:30 meteo weewx[4276]: engine: Import of driver failed: failed to start process 'rtl_433 -f 868M -s 1024k -M utc -F jons': [Errno 2] No existe el fichero o el directorio (<class 'weewx.WeeWxIOError'>)
Mar  9 01:25:30 meteo weewx[4276]: engine: Unable to load driver: failed to start process 'rtl_433 -f 868M -s 1024k -M utc -F jons': [Errno 2] No existe el fichero o el directorio
Mar  9 01:25:30 meteo weewx[4276]:     ****  Exiting...
The drivers are installed in:
/home/pi/
any other suggestions?
Thanks.

vince

unread,
Mar 8, 2020, 8:49:16 PM3/8/20
to weewx-user
> driver = user.sdr

This means weewx expects the driver to be in /home/weewx/bin/user (if you're using setup.py to install weewx)

There have been other threads recently about this saying how to put the driver in other locations.  I think the 'path' variable might help there, if you really want it in an unusual location.

Juan EC7D

unread,
Mar 9, 2020, 7:48:01 AM3/9/20
to weewx-user
Hello Vince, thanks again,

I had already noticed the wrong location, but that is where the driver installation program created it, I copied it and pasted it in the correct directory / home / weewx / bin / user /.
Now load the driver but an error still appears
failed to start process 'rtl_433 -f 868M -M utc -F json'
I enclose a list of start log

Mar  9 12:38:24 meteo weewx[2923]: engine: Loading station type SDR (user.sdr)
Mar  9 12:38:27 meteo weewx[2923]: sdr: MainThread: driver version is 0.77
Mar  9 12:38:27 meteo weewx[2923]: sdr: MainThread: sensor map is {'outTemp': 'temperature.*.FOWHx080Packet', 'windSpeed': 'wind_avg_km_h.*.FOWHx080Packet', 'windDir': 'wind_dir_deg.*.FOWHx080Packet', 'outHumidity': 'humidity.*.FOWHx080Packet', 'rain_total': 'rain_mm.*.FOWHx080Packet'}
Mar  9 12:38:27 meteo weewx[2923]: sdr: MainThread: deltas is {'strikes': 'strikes_total', 'rain': 'rain_total'}
Mar  9 12:38:27 meteo weewx[2923]: sdr: MainThread: startup process 'rtl_433 -f 868M -M utc -F json'
Mar  9 12:38:27 meteo weewx[2923]: engine: Import of driver failed: failed to start process 'rtl_433 -f 868M -M utc -F json': [Errno 2] No existe el fichero o el directorio (<class 'weewx.WeeWxIOError'>)
Mar  9 12:38:27 meteo weewx[2923]: engine: Unable to load driver: failed to start process 'rtl_433 -f 868M -M utc -F json': [Errno 2] No existe el fichero o el directorio
Mar  9 12:38:27 meteo weewx[2923]:     ****  Exiting...
Reply all
Reply to author
Forward
0 new messages