Sudden WeeWx crashing

208 views
Skip to first unread message

Elie R

unread,
Sep 6, 2023, 9:59:13 AM9/6/23
to weewx-user
Have been happily churning along with no issues on 4.10.2

Using SDR to capture from an Atlas sensor array, and a BME280 for pressure.

Just out of the blue, WeeWx stopped reporting a few days ago. Tried rebooting and watching the log output. It starts off ok with the parsing of the BME280 pressure data, but then it suddenly throws the following error and exits:

Sep  6 09:19:33 atlas weewx[2139] INFO weewx.engine: Main loop exiting. Shutting engine down.
Sep  6 09:19:33 atlas weewx[2139] INFO user.sdr: shutdown process /usr/local/bin/rtl_433 -M utc -F json
Sep  6 09:19:45 atlas weewx[2139] INFO user.sdr: timed out waiting for stderr-thread
Sep  6 09:19:45 atlas weewx[2139] CRITICAL __main__: Caught unrecoverable exception:
Sep  6 09:19:45 atlas weewx[2139] CRITICAL __main__:     ****  class PrologueTHPacket has no attribute 'name'
Sep  6 09:19:46 atlas weewx[2139] CRITICAL __main__:     ****  Traceback (most recent call last):
Sep  6 09:19:46 atlas weewx[2139] CRITICAL __main__:     ****    File "/usr/share/weewx/weewxd", line 154, in main
Sep  6 09:19:46 atlas weewx[2139] CRITICAL __main__:     ****      engine.run()
Sep  6 09:19:46 atlas weewx[2139] CRITICAL __main__:     ****    File "/usr/share/weewx/weewx/engine.py", line 208, in run
Sep  6 09:19:46 atlas weewx[2139] CRITICAL __main__:     ****      for packet in self.console.genLoopPackets():
Sep  6 09:19:46 atlas weewx[2139] CRITICAL __main__:     ****    File "/usr/share/weewx/user/sdr.py", line 3155, in genLoopPackets
Sep  6 09:19:46 atlas weewx[2139] CRITICAL __main__:     ****      for packet in PacketFactory.create(lines):
Sep  6 09:19:46 atlas weewx[2139] CRITICAL __main__:     ****    File "/usr/share/weewx/user/sdr.py", line 3026, in create
Sep  6 09:19:46 atlas weewx[2139] CRITICAL __main__:     ****      pkt = PacketFactory.parse_json(lines)
Sep  6 09:19:46 atlas weewx[2139] CRITICAL __main__:     ****    File "/usr/share/weewx/user/sdr.py", line 3042, in parse_json
Sep  6 09:19:46 atlas weewx[2139] CRITICAL __main__:     ****      return parser.parse_json(obj)
Sep  6 09:19:46 atlas weewx[2139] CRITICAL __main__:     ****    File "/usr/share/weewx/user/sdr.py", line 2690, in parse_json
Sep  6 09:19:46 atlas weewx[2139] CRITICAL __main__:     ****      pkt = Packet.add_identifiers(pkt, sensor_id, PrologueTHPacket.name)
Sep  6 09:19:46 atlas weewx[2139] CRITICAL __main__:     ****  AttributeError: class PrologueTHPacket has no attribute 'name'
Sep  6 09:19:46 atlas weewx[2139] CRITICAL __main__:     ****  Exiting.

Any thoughts? I'm thinking my SDR dongle might have decided to give up the ghost?

Topslakr Topslakr

unread,
Sep 6, 2023, 3:44:06 PM9/6/23
to weewx-user
Yeah - I might trying running the rtl_433 commands alone, outside of Weewx, to see what it has to say...

gjr80

unread,
Sep 6, 2023, 4:00:38 PM9/6/23
to weewx-user
Your error is in sdr.py, nothing to do with your hardware or rtl_433. Try editing /usr/share/weewx/user/sdr.py, goto line 2690, it should be:


pkt = Packet.add_identifiers(pkt, sensor_id, PrologueTHPacket.name)

change it to read:

pkt = Packet.add_identifiers(pkt, sensor_id, PrologueTHPacket.__name__)

(that is a double underscore before and after name). Save the file and restart WeeWX.

Monitor the log and see how that goes.

Gary

Elie R

unread,
Sep 7, 2023, 10:04:03 AM9/7/23
to weewx-user
Update: it was neither of those issues. 
My sdr.py was running fine for years the way it was.  The issue seems to be that my sdr must have been picking up that PrologueTHPacket, which isn't even coming from any of my devices.I was monitoring rtl_433 yesterday, saw one instance of the PrologueTH scroll by. Today, it's not showing, and WeeWx is running and reporting just fine once again.

I've previously set up my sdr / rtl_433 to only parse my own sensor_id packets. So I'm wondering if mayhaps the PrologueTH just happens to have the same sensor_id as mine, which caused it to throw a glitch?

Thanks

gjr80

unread,
Sep 7, 2023, 2:44:18 PM9/7/23
to weewx-user
If the 'setup up my sdr / rtl_433' was done in via the [SDR] [[sensor_map]] stanza in weewx.conf then all you were doing was limiting what sensor data is passed onto WeeWX in loop packets; the SDR driver would still have processed all sensor packets provided by rtl_433, but only those that match the sensors defined in the [SDR] [[sensor_map]] are included in loop packets. There is a typo in line 2690 of the SDR driver version you are using, and if it receives any more PrologueTH packets from rtl_433 it will fail and cause WeeWX to exit. I am no rtl_433 expert, but you may be able to configure rtl_433 to ignore the PrologueTH packets and not pass them to SDR and avoid the error that way, but I suspect fixing the typo in sdr.py will be easier.

Gary

Elie R

unread,
Sep 7, 2023, 5:08:10 PM9/7/23
to weewx-user
Thanks Gary,

I'll try correcting the typo on 2690 and see what happens. You are correct in your assumption, I was only including my sensor for WeeWx loop data. It's nothing new for me to see many random neighbour sensor packets when running rtl_433 (other stations, tpms sensors, other wireless thermometers including my own, etc), but the first time I've encountered these PrologueTH packets or any WeeWx hiccup. New neighbours? ;p

Mark Fraser

unread,
Sep 7, 2023, 5:14:54 PM9/7/23
to weewx-user
Have you configured the command line in weewx.conf to only use the drivers you require?

Mine is just:
cmd = rtl_433 -M utc -F json

but you can change it to something like:

cmd = rtl_433 -M utc -F json -R 32 -R 78 -R 190 -R 142

Elie R

unread,
Sep 10, 2023, 8:16:46 AM9/10/23
to weewx...@googlegroups.com
Sorry for the late reply, was out of town for a few days, haven't had a chance to look.

@Gary: I see what you mean now, looking at all the other sensor model stanzas in sdr.py they all had the double underscored  __name__ . Good catch! Made the changes.

@Mark: been using same cmd line as you, but agreed, I may have to change the script to exclude the ones I don't want. I usually don't monitor rtl_433, but this experience made me aware of so many more sensors being picked up that were not there when initially setting up SDR a few years ago, so makes sense to exclude those.

Thanks again!
Elie


--
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/w6MkEoXpEbo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/708e08ca-2dbd-4420-b72c-dc10836d51edn%40googlegroups.com.

Jim Erickson (VA7SHG)

unread,
Nov 5, 2023, 12:45:36 AM11/5/23
to weewx-user
Gary's change to sdr.py is the fix here.  I just had one of those devices show up in my neighbour hood and was randomly crashing my weewx.  That fix has solved it, but I had to search for PrologueTHPacket, the line number had changed.

Great catch Gary!

Reply all
Reply to author
Forward
0 new messages