Interceptor - Parse failed for ... Dictionary update sequence element #0...

66 views
Skip to first unread message

Cory Verellen

unread,
Jan 21, 2024, 1:18:51 PM1/21/24
to weewx-user
This is a new one I've not seen. 
Just updated (accidentally) to 5.0.0 via automatic update script. Oops, forgot I shouldn't do that with weewx. OK, let's see if I can fix this.... Running Belchertown, and got the DB issue sorted. Now this

Jan 21 10:00:26 weather weewxd[2883]: ERROR user.interceptor: parse failed for &PASSKEY=xxxxxxxxxxxxxxxxxxxxxxx&stationtype=AMBWeatherPro_V5.1.4&dateutc=2024-01-21+18:00:26&tempf=43.9&humidity=99&windspeedmph=0.00&windgustmph=0.00&maxdailygust=5.82&winddir=61&uv=0&solarradiation=20.31&hourlyrainin=0.000&eventrainin=0.409&dailyrainin=0.150&weeklyrainin=0.150&monthlyrainin=4.201&yearlyrainin=4.201&totalrainin=26.929&battout=1&tempinf=65.8&humidityin=41&baromrelin=29.297&baromabsin=29.220&temp1f=52.9&humidity1=66&batt1=1: dictionary update sequence element #0 has length 1; 2 is required

There are some mentions of this out there but I've not found a solution yet. 

This is a Ambient WS-2902 that was working fine on 4.10.2 Any Ideas?

Cory Verellen

unread,
Jan 21, 2024, 2:46:20 PM1/21/24
to weewx-user
Fixed though I'm not sure why/how/what changed to break interceptor. Here's the fix:

in interceptor.py you need to strip out the leading '&' in the url being parsed. Add s=s.lstrip('&') 

def _cgi_to_dict(s):
    s=s.lstrip('&')
    if '=' in s:
        return dict([y.strip() for y in x.split('=')] for x in s.split('&'))
    return dict()

Reply all
Reply to author
Forward
0 new messages