I had this issue too and posted a possible solution some time ago, but my
post was removed with the entire conversation being deleted. Anyway you
could try to edit the interceptor.py (make a backup first!!!)
(usually/user/share/weewx/user/interceptor.py),  it should be at about line
337, try to replace ord(x) with x
This should let it run (it runs fine on my side), but I'm not sure if it
works and actually captures packets (I couldn't test it myself since I
don't have that type of station)

Il mar 25 apr 2023, 21:29 Michael <[email protected]> ha scritto:

> (Starting as a new thread and this is a new issue)
>
> I am getting the following error from interceptor when running it in
> driver mode.  My station reports to both WU and WeatherCloud.  Below is the
> error and the TCPDUMP
>
> weewx@raspberrypi:~ $ sudo PYTHONPATH=/usr/share/weewx python
> /usr/share/weewx/user/interceptor.py --device=wu-client --mode=sniff
> --iface=eth0 --filter="src 192.168.50.9 and dst port 80"
> [sudo] password for weewx:
> Exception in thread ServerThread:
> Traceback (most recent call last):
>   File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
>     self.run()
>   File "/usr/lib/python3.9/threading.py", line 892, in run
>     self._target(*self._args, **self._kwargs)
>   File "/usr/share/weewx/user/interceptor.py", line 435, in run_server
>     self._server.run()
>   File "/usr/share/weewx/user/interceptor.py", line 491, in run
>     self.decode_ip_packet(0, pkt, ts)
>   File "/usr/share/weewx/user/interceptor.py", line 518, in
> decode_ip_packet
>     (_timestamp, _pktlen, _fmt_bytes(data)))
>   File "/usr/share/weewx/user/interceptor.py", line 338, in _fmt_bytes
>     return ' '.join(['%02x' % ord(x) for x in data])
>   File "/usr/share/weewx/user/interceptor.py", line 338, in <listcomp>
>     return ' '.join(['%02x' % ord(x) for x in data])
> TypeError: ord() expected string of length 1, but int found
>
>
>
> Here is the dump of traffic:
> weewx@raspberrypi:~ $ sudo tcpdump host 192.168.50.9
> tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
> listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144
> bytes
> 19:49:15.918021 IP L7-F5C2FC.17834 > RT-AC68U-30F8.domain: 53873+ A?
> rtupdate.wunderground.com. (43)
> 19:49:16.056965 IP L7-F5C2FC.62824 >
> ec2-54-159-105-134.compute-1.amazonaws.com.http: Flags [S], seq 83185671,
> win 5760, options [mss 1440], length 0
> 19:49:16.159234 IP L7-F5C2FC.62824 >
> ec2-54-159-105-134.compute-1.amazonaws.com.http: Flags [.], ack 3936522529,
> win 5760, length 0
> 19:49:16.160895 IP L7-F5C2FC.62824 >
> ec2-54-159-105-134.compute-1.amazonaws.com.http: Flags [P.], seq 0:548, ack
> 1, win 5760, length 548: HTTP: GET
> /weatherstation/updateweatherstation.php?ID=XXXXXXXXXX&PASSWORD=XXXXXXXXXX&indoortempf=72.7&indoorhumidity=40&tempf=75.4&humidity=15&dewptf=24.5&windchillf=75.4&absbaromin=26.64&baromin=29.73&windspeedmph=3.4&windgustmph=4.5&winddir=158&windspdmph_avg2m=3.4&winddir_avg2m=248&windgustmph_10m=2.5&windgustdir_10m=270&rainin=0.0&dailyrainin=0.0&weeklyrainin=0.0&monthlyrainin=1.37&solarradiation=0.0&UV=0&dateutc=2023-4-25%202:49:15&action=updateraw&realtime=1&rtfreq=5&
> HTTP/1.1
> 19:49:16.364694 IP L7-F5C2FC.62824 >
> ec2-54-159-105-134.compute-1.amazonaws.com.http: Flags [.], ack 282, win
> 5479, length 0
> 19:49:16.367566 IP L7-F5C2FC.62824 >
> ec2-54-159-105-134.compute-1.amazonaws.com.http: Flags [F.], seq 548, ack
> 282, win 5479, length 0
> 19:49:30.809293 ARP, Request who-has L7-F5C2FC tell L7-F5C2FC, length 46
> 19:50:15.918028 IP L7-F5C2FC.17936 > RT-AC68U-30F8.domain: 30842+ A?
> rtupdate.wunderground.com. (43)
> 19:50:15.957673 IP L7-F5C2FC.62825 >
> ec2-52-22-134-222.compute-1.amazonaws.com.http: Flags [S], seq 83203998,
> win 5760, options [mss 1440], length 0
> 19:50:16.063154 IP L7-F5C2FC.62825 >
> ec2-52-22-134-222.compute-1.amazonaws.com.http: Flags [.], ack 1640669121,
> win 5760, length 0
> 19:50:16.065450 IP L7-F5C2FC.62825 >
> ec2-52-22-134-222.compute-1.amazonaws.com.http: Flags [P.], seq 0:548, ack
> 1, win 5760, length 548: HTTP: GET
> /weatherstation/updateweatherstation.php?ID=XXXXXXXXXX&PASSWORD=XXXXXXXXXX&indoortempf=72.7&indoorhumidity=40&tempf=75.4&humidity=15&dewptf=24.5&windchillf=75.4&absbaromin=26.64&baromin=29.72&windspeedmph=3.4&windgustmph=4.5&winddir=158&windspdmph_avg2m=3.4&winddir_avg2m=248&windgustmph_10m=2.5&windgustdir_10m=270&rainin=0.0&dailyrainin=0.0&weeklyrainin=0.0&monthlyrainin=1.37&solarradiation=0.0&UV=0&dateutc=2023-4-25%202:50:15&action=updateraw&realtime=1&rtfreq=5&
> HTTP/1.1
> 19:50:16.376265 IP L7-F5C2FC.62825 >
> ec2-52-22-134-222.compute-1.amazonaws.com.http: Flags [.], ack 282, win
> 5479, length 0
> 19:50:16.376605 IP L7-F5C2FC.62825 >
> ec2-52-22-134-222.compute-1.amazonaws.com.http: Flags [F.], seq 548, ack
> 282, win 5479, length 0
> 19:50:30.825744 ARP, Request who-has L7-F5C2FC tell L7-F5C2FC, length 46
> 19:51:15.917905 IP L7-F5C2FC.1681 > RT-AC68U-30F8.domain: 7879+ A?
> rtupdate.wunderground.com. (43)
> 19:51:16.173490 IP L7-F5C2FC.62826 >
> ec2-34-232-250-77.compute-1.amazonaws.com.http: Flags [S], seq 83222327,
> win 5760, options [mss 1440], length 0
> 19:51:16.275864 IP L7-F5C2FC.62826 >
> ec2-34-232-250-77.compute-1.amazonaws.com.http: Flags [.], ack 928660949,
> win 5760, length 0
> 19:51:16.277401 IP L7-F5C2FC.62826 >
> ec2-34-232-250-77.compute-1.amazonaws.com.http: Flags [P.], seq 0:548, ack
> 1, win 5760, length 548: HTTP: GET
> /weatherstation/updateweatherstation.php?ID=XXXXXXXXXX&PASSWORD=XXXXXXXXXX&indoortempf=72.7&indoorhumidity=40&tempf=75.4&humidity=15&dewptf=24.5&windchillf=75.4&absbaromin=26.65&baromin=29.73&windspeedmph=3.4&windgustmph=4.5&winddir=158&windspdmph_avg2m=3.4&winddir_avg2m=248&windgustmph_10m=2.5&windgustdir_10m=270&rainin=0.0&dailyrainin=0.0&weeklyrainin=0.0&monthlyrainin=1.37&solarradiation=0.0&UV=0&dateutc=2023-4-25%202:51:15&action=updateraw&realtime=1&rtfreq=5&
> HTTP/1.1
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/23f637a1-b657-44b4-b753-bf529842da19n%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/23f637a1-b657-44b4-b753-bf529842da19n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAMspSqGUvpJCftZyCV4i-j2JtfkuXSzcZT5hCOHSpJkS6sE6pQ%40mail.gmail.com.

Reply via email to