weewx 3.8.1 With Interceptor Driver v0.40 Error and Exits

118 views
Skip to first unread message

G Hammer

unread,
Jul 18, 2018, 3:39:49 PM7/18/18
to weewx-user
I have relocated my weewx install to a more reliable server.
In doing so, I installed 3.8.1 and the Interceptor driver.
When I start weewx it exited.
I set debug=1 and started it again.
Here are the resulting logs:

Jul 18 15:25:41 PlexSrv weewx[3955]: interceptor: ServerThread: SNIFF: stationtype=AMBWeatherV4.0.2&PASSKEY=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF&dateutc=2018-07-18+19:25:35&winddir=199&windspeedmph=2.5&windgustmph=4.5&maxdailygust=13.6&tempf=78.6&hourlyrainin=0.00&eventrainin=0.00&dailyrainin=0.00&weeklyrainin=2.10&monthlyrainin=2.18&totalrainin=6.07&baromrelin=30.01&baromabsin=29.46&humidity=41&tempinf=75.0&humidityin=62&uv=8&solarradiation=702.33 HTTP/1.1#015#012Host: api.ambientweather.net#015#012Connection: close#015#012User-Agent: ESP8266
Jul 18 15:25:41 PlexSrv weewx[3955]: interceptor: ServerThread: sniff: start GET
Jul 18 15:25:41 PlexSrv weewx[3955]: interceptor: MainThread: raw data: stationtype=AMBWeatherV4.0.2&PASSKEY=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF&dateutc=2018-07-18+19:25:35&winddir=199&windspeedmph=2.5&windgustmph=4.5&maxdailygust=13.6&tempf=78.6&hourlyrainin=0.00&eventrainin=0.00&dailyrainin=0.00&weeklyrainin=2.10&monthlyrainin=2.18&totalrainin=6.07&baromrelin=30.01&baromabsin=29.46&humidity=41&tempinf=75.0&humidityin=62&uv=8&solarradiation=702.33 HTTP/1.1#015#012Host: api.ambientweather.net#015#012Connection: close#015#012User-Agent: ESP8266
Jul 18 15:25:41 PlexSrv weewx[3955]: interceptor: MainThread: using rain_total 0.0 from dailyrainin
Jul 18 15:25:41 PlexSrv weewx[3955]: interceptor: MainThread: parse failed for stationtype=AMBWeatherV4.0.2&PASSKEY=FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF&dateutc=2018-07-18+19:25:35&winddir=199&windspeedmph=2.5&windgustmph=4.5&maxdailygust=13.6&tempf=78.6&hourlyrainin=0.00&eventrainin=0.00&dailyrainin=0.00&weeklyrainin=2.10&monthlyrainin=2.18&totalrainin=6.07&baromrelin=30.01&baromabsin=29.46&humidity=41&tempinf=75.0&humidityin=62&uv=8&solarradiation=702.33 HTTP/1.1#015#012Host: api.ambientweather.net#015#012Connection: close#015#012User-Agent: ESP8266#015#012#015#012: invalid literal for float(): 702.33 HTTP/1.1#015#012Host: api.ambientweather.net#015#012Connection: close#015#012User-Agent: ESP8266
Jul 18 15:25:41 PlexSrv weewx[3955]: interceptor: MainThread: raw packet: {'rain_total': 0.0, 'usUnits': 1, 'dateTime': 1531941935}
Jul 18 15:25:41 PlexSrv weewx[3955]: interceptor: MainThread: mapped packet: {'usUnits': 1, 'dateTime': 1531941935}
Jul 18 15:25:41 PlexSrv weewx[3955]: engine: Main loop exiting. Shutting engine down.
Jul 18 15:25:41 PlexSrv weewx[3955]: restx: Shut down CWOP thread.
Jul 18 15:25:41 PlexSrv weewx[3955]: restx: Shut down PWSWeather thread.
Jul 18 15:25:41 PlexSrv weewx[3955]: restx: Shut down StationRegistry thread.
Jul 18 15:25:41 PlexSrv weewx[3955]: interceptor: MainThread: shutting down server thread
Jul 18 15:25:41 PlexSrv weewx[3955]: interceptor: MainThread: stop sniff server
Jul 18 15:25:41 PlexSrv weewx[3955]: engine: Caught unrecoverable exception in engine:
Jul 18 15:25:41 PlexSrv weewx[3955]:     ****  'outTemp'
Jul 18 15:25:41 PlexSrv weewx[3955]:     ****  Traceback (most recent call last):
Jul 18 15:25:41 PlexSrv weewx[3955]:     ****    File "/home/weewx/bin/weewx/engine.py", line 877, in main
Jul 18 15:25:41 PlexSrv weewx[3955]:     ****      engine.run()
Jul 18 15:25:41 PlexSrv weewx[3955]:     ****    File "/home/weewx/bin/weewx/engine.py", line 191, in run
Jul 18 15:25:41 PlexSrv weewx[3955]:     ****      self.dispatchEvent(weewx.Event(weewx.NEW_LOOP_PACKET, packet=packet))
Jul 18 15:25:41 PlexSrv weewx[3955]:     ****    File "/home/weewx/bin/weewx/engine.py", line 224, in dispatchEvent
Jul 18 15:25:41 PlexSrv weewx[3955]:     ****      callback(event)
Jul 18 15:25:41 PlexSrv weewx[3955]:     ****    File "/home/weewx/bin/user/weewxwd3.py", line 146, in new_loop_packet
Jul 18 15:25:41 PlexSrv weewx[3955]:     ****      wd_data['humidex'] = weewx.wxformulas.humidexC(data_metricwx['outTemp'],
Jul 18 15:25:41 PlexSrv weewx[3955]:     ****  KeyError: 'outTemp'
Jul 18 15:25:41 PlexSrv weewx[3955]:     ****  Exiting.


I'm going to see if I have an older version of the driver for now.

mwall

unread,
Jul 18, 2018, 9:20:20 PM7/18/18
to weewx-user
this is a problem in the weewxwd3 extension

you are getting an empty packet from the interceptor - a packet with only usUnits and dateTime.

but the weewxwd3 extension expects that there is always an outTemp

the weewxwd3 extension should be modified so that it does not require outTemp (if no outTemp, then do not try to calculate humidex), and so that it does not kill weewxd if any other observation it expects is not found

and the interceptor driver should be fixed so that it properly parses the ambient weather data.  in fact, a fix that handles the ambient datetime format was applied in v0.40, but there is not yet a fix for the 'invalid literal for float' failure.

m

G Hammer

unread,
Jul 18, 2018, 9:44:32 PM7/18/18
to weewx-user
Thanks for the info.
The weewxwd3 extension accepts the data that v0.39 provides as v0.39 does not attempt to pass the AW data.
I am up and running as I do have a copy of that Interceptor version.

Though I am quite weak in python, I'll have a look at weewxwd3.


gjr80

unread,
Jul 18, 2018, 9:58:48 PM7/18/18
to weewx-user
weewxwd3.py is part of WeeWX-WD. The code was originally written a few years back but even so it should have been robust enough to handle partial packets. I am hopeful it is a simple 'couple of lines' fix, I have a look at it in the next day or so.

Gary

G Hammer

unread,
Jul 18, 2018, 10:06:19 PM7/18/18
to weewx-user
Thank you.
I hope it is an easy fix, but those are elusive.

gjr80

unread,
Jul 19, 2018, 9:04:18 PM7/19/18
to weewx-user
Ok, an easy fix. WeeWX-WD previously expected outTemp, outHumidity and windSpeed fields to be present (as distinct from being present but equal to None) in every loop packet/archive record - not necessarily the case for partial packet stations. WeeWX-WD will now omit humidex from packets/records if outTemp and outHumidity are missing. Same for appTemp but in this case if windSpeed is missing as well. This has caused some flow on effects to some other derived obs such as day and night temperature. I have been running a modified weewxwd3.py on a VM with a modified simulator to simulate partial packets and it appears well behaved. As far as I can tell the WeeWX-WD products are generated correctly but I would not say they have been comprehensively tested.

You did not mention what WeeWX-WD version you are using, if it is 1.0.3 then you can try out the new weewxwd3.py fairly simply using the following procedure:

1. move weewxwd3.py aside:

$ mv /home/weewx/bin/user/weewxwd3.py /home/weewx/bin/user/weewxwd3_orig.py

2. download the updated weewxwd3.py:


3. restart WeeWX:

$ sudo /etc/init.d/weewx restart

or

$ sudo systemctl restart weewx

Monitor your log to ensure there are no errors. Also monitor any pages using the WeeWX-WD products, in particular Humidex, Apparent Temperature and day/night temperature aggregates (ie hottest night, coldest day etc). If you notice any errors or anything that just doesn't look right let us know. Likewise if you  are not using WeeWX-WD v1.0.3 let us know.

Finally, if you need to revert to your existing setup just delete weewxwd3.py and revert to the copy we moved aside:

$ rm /home/weewx/bin/user/weewxwd3.py
$ mv
/home/weewx/bin/user/weewxwd3_orig.py /home/weewx/bin/user/weewxwd3.py


Gary

G Hammer

unread,
Jul 20, 2018, 6:02:39 AM7/20/18
to weewx-user
I have installed the modified version and it works perfectly with weewx 3.8.1, Interceptor driver 0.39 & 0.40, and WeeWX-WD v1.0.3
No errors in execution and no errors in the data passed to the website.

I will monitor this over the next few days, but there is no reason to think it will fail.

Glad it was an easy fix.
Thanks for making the modifications so quickly.

Gary


Reply all
Reply to author
Forward
0 new messages