rtldavis extension python version change ripple

62 views
Skip to first unread message

vince

unread,
Nov 19, 2025, 2:49:26 PMNov 19
to weewx-user
If anybody is intending to use my script (link) to install the rtldavis driver over a current version of the raspi using debian trixie as the base, you will see Syntax Warning(s) during installation of the extension.

This seems to be due to the newer version of python in trixie.  See (stackoverflow) for the gory details.

The last answer in that thread shows how to deal with it if you're so inclined, given that a future python will someday break rather than throw a warning. In short, patch the offending lines in rtldavis.py slightly.

The warnings indicate which line items to patch.  Basically change re.compile( to re.compile(r on the offending lines.  Regular expressions and particularly python's implementation of them make my head spin, so I can't speak re: whether this actually changes behavior other than stopping the python interpreter from barking at you.

The offending warnings are below just as a FYI...

/home/pi/weewx-data/bin/user/rtldavis.py:513: SyntaxWarning: invalid escape sequence '\d'
  IDENTIFIER = re.compile("^\d\d:\d\d:\d\d.[\d]{6} [0-9A-F][0-7][0-9A-F]{14}")
/home/pi/weewx-data/bin/user/rtldavis.py:514: SyntaxWarning: invalid escape sequence '\d'
  PATTERN = re.compile('([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2}) ([\d]+) ([\d]+) ([\d]+) ([\d]+)')
/home/pi/weewx-data/bin/user/rtldavis.py:543: SyntaxWarning: invalid escape sequence '\d'
  PATTERNv13 = re.compile('ChannelIdx:([\d]+) ChannelFreq:([\d]+) FreqError:([\d-]+) Transmitter:([\d]+)')
/home/pi/weewx-data/bin/user/rtldavis.py:544: SyntaxWarning: invalid escape sequence '\d'
  PATTERNv12 = re.compile('ChannelIdx:([\d]+) ChannelFreq:([\d]+) FreqError:([\d-]+)')



vince

unread,
Dec 7, 2025, 4:53:57 PM (10 days ago) Dec 7
to weewx-user
One more change needed it seems - if you use weewx-5.2 you will likely need to update your crc16.py to the newest version on the master branch in the weewx repo until weewx v5.next is released.   Check your logs and you should see it blow up with a crc16 error.  Updating crc16.py in your venv fixes that issue for now until the next weewx is released.

Also - I updated my script to be able to install with a current golang version available in modern debian(ish) versions.  Tested on a pi4 vs. golang 1.24 FWIW.

Reply all
Reply to author
Forward
0 new messages