weeWX driver crash

Not sure if this is the best place to discuss, but here goes:

I installed the latest weatherflow UDP driver and a fresh weewx install on a Ubuntu 16.04.4 LTS platform a few weeks ago. I noticed that my weewx data stopped updating a couple days ago. It looks like weewx crashed with the following error:

Jun 28 04:10:16 1w-rackcomputer weewx[4631]: weatherflowudp: MainThread: Listening for UDP broadcasts to IP address on port 50222, with timeout 90…
Jun 28 04:10:17 1w-rackcomputer weewx[4631]: cheetahgenerator: Generated 14 files for report StandardReport in 1.71 seconds
Jun 28 04:10:18 1w-rackcomputer weewx[4631]: imagegenerator: Generated 12 images for StandardReport in 0.61 seconds
Jun 28 04:10:18 1w-rackcomputer weewx[4631]: copygenerator: copied 0 files to /var/www/html/weewx
Jun 28 04:10:20 1w-rackcomputer weewx[4631]: ftpgenerator: ftp’d 26 files in 2.10 seconds
Jun 28 04:11:17 1w-rackcomputer weewx[4631]: engine: Shutting down StdReport thread
Jun 28 04:11:17 1w-rackcomputer weewx[4631]: engine: Caught unrecoverable exception in engine:
Jun 28 04:11:17 1w-rackcomputer weewx[4631]: **** EOL while scanning string literal (, line 1)
Jun 28 04:11:17 1w-rackcomputer weewx[4631]: **** Traceback (most recent call last):
Jun 28 04:11:17 1w-rackcomputer weewx[4631]: **** File “/usr/share/weewx/weewx/engine.py”, line 871, in main
Jun 28 04:11:17 1w-rackcomputer weewx[4631]: **** engine.run()
Jun 28 04:11:17 1w-rackcomputer weewx[4631]: **** File “/usr/share/weewx/weewx/engine.py”, line 187, in run
Jun 28 04:11:17 1w-rackcomputer weewx[4631]: **** for packet in self.console.genLoopPackets():
Jun 28 04:11:17 1w-rackcomputer weewx[4631]: **** File “/usr/share/weewx/user/weatherflowudp.py”, line 283, in genLoopPackets
Jun 28 04:11:17 1w-rackcomputer weewx[4631]: **** m1=eval(m0)
Jun 28 04:11:17 1w-rackcomputer weewx[4631]: **** File “”, line 1
Jun 28 04:11:17 1w-rackcomputer weewx[4631]: **** {“serial_number”:"HB-00
Jun 28 04:11:18 1w-rackcomputer weewx[4631]: **** ^
Jun 28 04:11:18 1w-rackcomputer weewx[4631]: **** SyntaxError: EOL while scanning string literal
Jun 28 04:11:18 1w-rackcomputer weewx[4631]: **** Exiting.

Restarting has it up and running again. Ideas?

1 Like

I do not have the code open to verify, but it appears to have been an incomplete UDP packet received by the driver. Python could not parse the received packet into a string.

I have a minor update in final testing to add a setting/option to share the UDP socket with other local apps. Let me see if I can add a graceful error handler to ignore incomplete packets and bundle the two into that next update…

2 Likes

Awesome! Thanks for checking it out.

This should hopefully be fixed now in v1.03, which I just committed to GitHub.

https://community.weatherflow.com/t/weewx-udp-driver/283/15?u=vreihen

Please let me know if you encounter any problems installing this update…

3 Likes

Update installed. I’ll report back if I notice this problem again. Thanks again for addressing.

1 Like

So far no issues. Will keep an eye out but initial indications are that this bug is no more.

1 Like

(@vreihen - where do you want these reported - here, or in the weewx google group?)

I just had a crash on (I’m guessing) an incomplete packet or the like…

Aug 28 15:00:18 zero weewx[20715]: manager: Added record 2018-08-28 15:00:00 PDT (1535493600) to database 'weewx.sdb'
Aug 28 15:00:18 zero weewx[20715]: manager: Added record 2018-08-28 15:00:00 PDT (1535493600) to daily summary in 'weewx.sdb'
Aug 28 15:00:18 zero weewx[20715]: restx: StationRegistry: wait interval (274800 < 604800) has not passed for record 2018-08-28 15:00:00 PDT (1535493600)
Aug 28 15:00:18 zero weewx[20715]: weatherflowudp: MainThread: Listening for UDP broadcasts to IP address <broadcast> on port 50222, with timeout 90 and share_socket True...
Aug 28 15:00:18 zero weewx[20715]: reportengine: Running reports for latest time in the database.
Aug 28 15:00:18 zero weewx[20715]: reportengine: Running report StandardReport
Aug 28 15:00:18 zero weewx[20715]: reportengine: Found configuration file /home/weewx/skins/Standard/skin.conf for report StandardReport
Aug 28 15:00:18 zero weewx[20715]: cheetahgenerator: using search list ['weewx.cheetahgenerator.Almanac', 'weewx.cheetahgenerator.Station', 'weewx.cheetahgenerator.Current', 'weewx.cheetahgenerator.Stats', 'weewx.cheetahgenerator.UnitInfo', 'weewx.cheetahgenerator.Extras']
Aug 28 15:00:19 zero weewx[20715]: manager: Daily summary version is 2.0
Aug 28 15:00:24 zero weewx[20715]: cheetahgenerator: Generated 14 files for report StandardReport in 6.00 seconds
Aug 28 15:00:24 zero weewx[20715]: manager: Daily summary version is 2.0
Aug 28 15:00:42 zero weewx[20715]: imagegenerator: Generated 36 images for StandardReport in 17.70 seconds
Aug 28 15:00:42 zero weewx[20715]: copygenerator: copied 0 files to /home/weewx/public_html
Aug 28 15:00:42 zero weewx[20715]: reportengine: Running report FTP
Aug 28 15:00:42 zero weewx[20715]: reportengine: Found configuration file /home/weewx/skins/Ftp/skin.conf for report FTP
Aug 28 15:00:42 zero weewx[20715]: ftpgenerator: FTP upload not requested. Skipped.
Aug 28 15:00:42 zero weewx[20715]: reportengine: Running report RSYNC
Aug 28 15:00:42 zero weewx[20715]: reportengine: Found configuration file /home/weewx/skins/Rsync/skin.conf for report RSYNC
Aug 28 15:00:42 zero weewx[20715]: rsyncgenerator: rsync upload not requested. Skipped.
Aug 28 15:02:30 zero weewx[20715]: engine: Main loop exiting. Shutting engine down.
Aug 28 15:02:30 zero weewx[20715]: engine: Shutting down StdReport thread
Aug 28 15:02:30 zero weewx[20715]: engine: StdReport thread has been terminated
Aug 28 15:02:30 zero weewx[20715]: restx: Shut down StationRegistry thread.
Aug 28 15:02:30 zero weewx[20715]: engine: Caught unrecoverable exception in engine:
Aug 28 15:02:30 zero weewx[20715]:     ****  argument of type 'float' is not iterable
Aug 28 15:02:30 zero weewx[20715]:     ****  Traceback (most recent call last):
Aug 28 15:02:30 zero weewx[20715]:     ****    File "/home/weewx/bin/weewx/engine.py", line 877, in main
Aug 28 15:02:30 zero weewx[20715]:     ****      engine.run()
Aug 28 15:02:30 zero weewx[20715]:     ****    File "/home/weewx/bin/weewx/engine.py", line 188, in run
Aug 28 15:02:30 zero weewx[20715]:     ****      for packet in self.console.genLoopPackets():
Aug 28 15:02:30 zero weewx[20715]:     ****    File "/home/weewx/bin/user/weatherflowudp.py", line 303, in genLoopPackets
Aug 28 15:02:30 zero weewx[20715]:     ****      m2=parseUDPPacket(m1)
Aug 28 15:02:30 zero weewx[20715]:     ****    File "/home/weewx/bin/user/weatherflowudp.py", line 203, in parseUDPPacket
Aug 28 15:02:30 zero weewx[20715]:     ****      if 'serial_number' in pkt:
Aug 28 15:02:30 zero weewx[20715]:     ****  TypeError: argument of type 'float' is not iterable
Aug 28 15:02:30 zero weewx[20715]:     ****  Exiting.
Aug 28 15:02:30 zero systemd[1]: weewx.service: Main process exited, code=exited, status=1/FAILURE
Aug 28 15:02:30 zero systemd[1]: weewx.service: Unit entered failed state.
Aug 28 15:02:30 zero systemd[1]: weewx.service: Failed with result 'exit-code'.
Aug 28 15:03:01```
1 Like

I’ll take a look at it this weekend. I work in academia, and this week is insanely busy for me with the start of the new year…

3 Likes