Well, I have decided to give this RTL-SDR driver a test and all is well when running it directly from the command line:
$ $GOPATH/bin/rtldavis -tr 3 -tf US
15:06:48.637542 rtldavis.go VERSION=0.15
15:06:48.637618 tr=3 fc=0 ppm=0 gain=0 maxmissed=51 ex=0 receiveWindow=300 actChan=[0 1] maxChan=2
15:06:48.637623 undefined=false verbose=false disableAfc=false deviceString=0
15:06:48.637680 BitRate: 19200
15:06:48.637684 SymbolLength: 14
15:06:48.637687 SampleRate: 268800
15:06:48.637689 Preamble: 1100101110001001
15:06:48.637691 PreambleSymbols: 16
15:06:48.637694 PreambleLength: 224
15:06:48.637696 PacketSymbols: 80
15:06:48.637698 PacketLength: 1120
15:06:48.637699 BlockSize: 512
15:06:48.637709 BufferLength: 2048
Detached kernel driver
Found Rafael Micro R820T tuner
15:06:49.120403 Hop: {ChannelIdx:0 ChannelFreq:902419338 FreqError:0 Transmitter:0}
Exact sample rate is: 268800.001367 Hz
15:06:49.300839 GetTunerGain: 0 Db
15:06:49.300865 SetFreqCorrection 0 ppm Successful
15:06:49.304341 Init channels: wait max 139 seconds for a message of each transmitter
Allocating 1 zero-copy buffers
15:07:35.517485 TRANSMITTER 1 SEEN
15:08:35.092807 TRANSMITTER 0 SEEN
15:08:35.092840 ALL TRANSMITTERS SEEN
15:08:35.092900 Hop: {ChannelIdx:14 ChannelFreq:909443845 FreqError:0 Transmitter:1}
15:08:35.894721 E100008005000A37 1 2 0 0 0 msg.ID=1
15:08:35.894751 Hop: {ChannelIdx:19 ChannelFreq:911952597 FreqError:0 Transmitter:0}
15:08:37.654697 8003E3178B002455 2 2 0 0 0 msg.ID=0
15:08:37.654736 Hop: {ChannelIdx:48 ChannelFreq:926503361 FreqError:0 Transmitter:1}
15:08:38.519685 510000FF75000DFB 2 3 0 0 0 msg.ID=1
15:08:38.519761 Hop: {ChannelIdx:41 ChannelFreq:922991108 FreqError:0 Transmitter:0}
15:08:40.218590 E003E334030036EA 3 3 0 0 0 msg.ID=0
15:08:40.218674 Hop: {ChannelIdx:7 ChannelFreq:905931591 FreqError:0 Transmitter:1}
15:08:41.144152 91000000050074F1 3 4 0 0 0 msg.ID=1
15:08:41.144207 Hop: {ChannelIdx:25 ChannelFreq:914963100 FreqError:0 Transmitter:0}
15:08:42.780487 5002E4FF71008E07 4 4 0 0 0 msg.ID=0
15:08:42.780536 Hop: {ChannelIdx:24 ChannelFreq:914461350 FreqError:0 Transmitter:1}
15:08:43.768957 81000096C500B2B8 4 5 0 0 0 msg.ID=1
15:08:43.769018 Hop: {ChannelIdx:8 ChannelFreq:906433342 FreqError:0 Transmitter:0}
15:08:45.342238 6003EF3083006AA0 5 5 0 0 0 msg.ID=0
My /etc/weewx/weewx.conf driver section looks like:
[Rtldavis]
# This section is for the rtldavis sdr-rtl USB receiver.
cmd = /home/nate/go/bin/rtldavis
# Options:
# -ppm = frequency correction of rtl dongle in ppm; default = 0
# -gain = tuner gain in tenths of Db; default = 0 means "auto gain"
# -ex = extra loopTime in ms; default = 0
# -fc = frequency correction for all channels; default = 0
# -u = log undefined signals
#
# The options below will autoamically be set
# -tf = transmitter frequencies, US, NZ or EU
# -tr = transmitters: tr1=1, tr2=2, tr3=4, tr4=8,
# tr5=16, tr6=32, tr7=64, tr8=128
# Radio frequency to use between USB transceiver and console: US, NZ or EU
# US uses 915 MHz, NZ uses 921 MHz and EU uses 868.3 MHz. Default is EU.
transceiver_frequency = US
# Used channels: 0=not present, 1-8)
# The channel of the Vantage Vue ISS or Vantage Pro or Pro2 ISS
iss_channel = 1
# The values below only apply for Vantage Pro or Pro2
anemometer_channel = 0
leaf_soil_channel = 0
temp_hum_1_channel = 2
temp_hum_2_channel = 0
# rain bucket type (0: 0.01 inch, 1: 0.2 mm)
rain_bucket_type = 1
# Print debug messages
# 0=no logging; 1=minimum logging; 2=normal logging; 3=detailed logging
debug_parse = 0
debug_rain = 0
debug_rtld = 2 # rtldavis logging: 1=inf; 2=(1)+data+chan; 3=(2)+pkt
# The pct_good per transmitter can be saved to the database
# This has only effect with 2 transmitters or more
save_pct_good_per_transmitter = True
# The driver to use:
driver = user.rtldavis
Attempting to start the WeeWX driver directly resulted in an error so I edited the extension file to point to the correct path to the Go driver. Now I get the following Python error:
$ PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/rtldavis.py
/usr/share/weewx/user/rtldavis.py:406: DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead
self.setDaemon(True)
/usr/share/weewx/user/rtldavis.py:407: DeprecationWarning: setName() is deprecated, set the name attribute instead
self.setName(label)
/usr/share/weewx/user/rtldavis.py:410: DeprecationWarning: getName() is deprecated, get the name attribute instead
logdbg("start async reader for %s" % self.getName())
15:23:26.544929 rtldavis.go VERSION=0.15
15:23:26.544996 tr=3 fc=0 ppm=0 gain=0 maxmissed=51 ex=0 receiveWindow=300 actChan=[0 1] maxChan=2
15:23:26.544999 undefined=false verbose=false disableAfc=false deviceString=0
15:23:26.545041 BitRate: 19200
15:23:26.545043 SymbolLength: 14
15:23:26.545044 SampleRate: 268800
15:23:26.545046 Preamble: 1100101110001001
15:23:26.545047 PreambleSymbols: 16
15:23:26.545048 PreambleLength: 224
15:23:26.545049 PacketSymbols: 80
15:23:26.545050 PacketLength: 1120
15:23:26.545051 BlockSize: 512
15:23:26.545052 BufferLength: 2048
Found Rafael Micro R820T tuner
15:23:26.963900 Hop: {ChannelIdx:0 ChannelFreq:902419338 FreqError:0 Transmitter:0}
Exact sample rate is: 268800.001367 Hz
15:23:27.144203 GetTunerGain: 0 Db
15:23:27.144219 SetFreqCorrection 0 ppm Successful
Allocating 1 zero-copy buffers
15:23:27.148780 Init channels: wait max 139 seconds for a message of each transmitter
Traceback (most recent call last):
File "/usr/share/weewx/user/rtldavis.py", line 1407, in <module>
payload = lines[0].strip()
~~~~~^^^
IndexError: list index out of range
The traceback message appears about ten seconds after the Allocating 1 zero-copy buffers line is printed.
I am testing this with WeeWX 4.10.2 and Python 3.11.2 on my desktop running Debian 12.4.
I've not yet tried running WeeWx as a daemon to see if there error occurs then. This is a test setup so I can delete the database and start over at any time.