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

On Monday, April 24, 2023 at 7:33:50 PM UTC-7 Michael wrote:

> That worked with getting the driver to load.  Here is the error I get once 
> I have it running:  
>
>
> 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
>
> On Monday, April 24, 2023 at 5:48:52 PM UTC-7 vince wrote:
>
>> Tom - buried in his messages were this - note it is a non-privileged 
>> installation, so it might very well be what you noted as a potential 
>> installation user error.
>>
>> weewx@raspberrypi:~ $ pip3 list --verbose  | grep pcap
>> pypcap            1.3.0     
>> /home/weewx/.local/lib/python3.9/site-packages pip
>>
>> And earlier he did install as a non-privileged user, not as root
>>
>> weewx@raspberrypi:~ $ pip3 install pypcap
>> Looking in indexes: https://pypi.org/simple, 
>> https://www.piwheels.org/simple
>> Collecting pypcap
>>   Using cached pypcap-1.3.0.tar.gz (140 kB)
>> Building wheels for collected packages: pypcap
>>   Building wheel for pypcap (setup.py) ... done
>>   Created wheel for pypcap: 
>> filename=pypcap-1.3.0-cp39-cp39-linux_aarch64.whl size=429390 
>> sha256=9518b4a7995ae893c438017a17dbf0d5722b7e338063ba1c94c9187b4c80551a
>>   Stored in directory: 
>> /home/weewx/.cache/pip/wheels/dd/3f/d4/51ab4f449c379dc65a12d7451f302cc9b388ff44bbc4a61530
>> Successfully built pypcap
>> Installing collected packages: pypcap
>> Successfully installed pypcap-1.3.0
>>
>> So Michael - you might try "sudo pip3 install pypcap" so it works for 
>> root too......
>>
>> On Monday, April 24, 2023 at 5:28:45 PM UTC-7 vince wrote:
>>
>>> Tom - what's happening is he's not finding the pcap python module when 
>>> running as root, but 'is' finding it when running as a non-privileged user, 
>>> so my guess (guess) is there are multiple python interpreters installed, 
>>> although he has so many old variants of a pip installed (or attempted 
>>> install) pcap that it's really confusing.
>>>
>>> A vanilla 32-bit raspios running his exact commands works fine, so 
>>> there's definitely something in his setup that is hosed up.
>>>
>>> On Monday, April 24, 2023 at 5:19:49 PM UTC-7 Tom Keffer wrote:
>>>
>>>> I'm not following this exchange closely, so it's entirely possible I 
>>>> don't know what's going on.
>>>>
>>>> What I will note is that both the shell path and PYTHONPATH are 
>>>> completely different if the python interpreter is run with "sudo". If you 
>>>> installed pypcap using pip, this could make you vulnerable. 
>>>>
>>>> But, my comment may be completely irrelevant.
>>>>
>>>> On Mon, Apr 24, 2023 at 4:06 PM Michael <[email protected]> wrote:
>>>>
>>>>>
>>>>> 2023-02-21-raspios-bullseye-arm64.img
>>>>>
>>>>>
>>>>> weewx@raspberrypi:~ $ uname -a
>>>>> Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 
>>>>> 2023 aarch64 GNU/Linux
>>>>> weewx@raspberrypi:~ $ which python
>>>>> /usr/bin/python
>>>>> weewx@raspberrypi:~ $ sudo which python
>>>>> [sudo] password for weewx:
>>>>> /usr/bin/python
>>>>> weewx@raspberrypi:~ $ echo $PATH
>>>>>
>>>>> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
>>>>> weewx@raspberrypi:~ $ sudo bash -c 'echo $PATH'
>>>>> /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
>>>>> weewx@raspberrypi:~ $
>>>>> On Monday, April 24, 2023 at 4:00:50 PM UTC-7 vince wrote:
>>>>>
>>>>>> Lets see the following:
>>>>>>
>>>>>>    - uname -a
>>>>>>
>>>>>>
>>>>>>    - which python
>>>>>>    - sudo which python
>>>>>>
>>>>>>
>>>>>>    - echo $PATH
>>>>>>    - sudo bash -c 'echo $PATH'
>>>>>>
>>>>>>
>>>>>> It looks like you're running a 64-bit os perhaps ?  Which one 
>>>>>> specifically ?
>>>>>>
>>>>>> Other than some odd 32-bit vs. 64-bit thing happening, I can only 
>>>>>> conclude that you have multiple python3 instances installed and root's 
>>>>>> $PATH is picking up the wrong one unless the commands above return 
>>>>>> something really odd...
>>>>>>
>>>>>> On Monday, April 24, 2023 at 3:21:01 PM UTC-7 Michael wrote:
>>>>>>
>>>>>>> weewx@raspberrypi:~ $ dpkg -l | grep pcap
>>>>>>> ii  libpcap0.8:arm64                     1.10.0-2                   
>>>>>>>       arm64        system interface for user-level packet capture
>>>>>>> ii  libpcap0.8-dev:arm64                 1.10.0-2                   
>>>>>>>       arm64        development library and header files for libpcap0.8
>>>>>>> weewx@raspberrypi:~ $ pip3 list --verbose  | grep pcap
>>>>>>> pypcap            1.3.0     
>>>>>>> /home/weewx/.local/lib/python3.9/site-packages pip
>>>>>>> weewx@raspberrypi:~ $ python3 -c 'import pcap'
>>>>>>> weewx@raspberrypi:~ $ sudo python3 -c 'import pcap'
>>>>>>> [sudo] password for weewx:
>>>>>>>
>>>>>>> Traceback (most recent call last):
>>>>>>>   File "<string>", line 1, in <module>
>>>>>>> ModuleNotFoundError: No module named 'pcap'
>>>>>>>
>>>>>>> On Monday, April 24, 2023 at 3:14:33 PM UTC-7 vince wrote:
>>>>>>>
>>>>>>>> From a clean RaspiOS that works....
>>>>>>>>
>>>>>>>> pi@pi4jr:~ $ dpkg -l | grep pcap
>>>>>>>> ii  libpcap0.8:armhf                     1.10.0-2                   
>>>>>>>>       armhf        system interface for user-level packet capture
>>>>>>>>
>>>>>>>> pi@pi4jr:~ $ pip3 list --verbose  | grep pcap
>>>>>>>> pypcap        1.3.0     /usr/local/lib/python3.9/dist-packages pip
>>>>>>>>
>>>>>>>> pi@pi4jr:~ $ python3 -c 'import pcap'
>>>>>>>> pi@pi4jr:~ $ echo $?
>>>>>>>> 0
>>>>>>>>
>>>>>>>> pi@pi4jr:~ $ sudo python3 -c 'import pcap'
>>>>>>>> pi@pi4jr:~ $ echo $?
>>>>>>>> 0
>>>>>>>>
>>>>>>>> On Monday, April 24, 2023 at 12:51:47 PM UTC-7 Michael wrote:
>>>>>>>>
>>>>>>>>> weewx@raspberrypi:/usr/share/weewx/user $ python --version
>>>>>>>>> Python 3.9.2
>>>>>>>>> weewx@raspberrypi:/usr/share/weewx/user $ python3 --version
>>>>>>>>> Python 3.9.2
>>>>>>>>> weewx@raspberrypi:/usr/share/weewx/user $ ^C
>>>>>>>>> weewx@raspberrypi:/usr/share/weewx/user $ 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"
>>>>>>>>> Traceback (most recent call last):
>>>>>>>>>   File "/usr/share/weewx/user/interceptor.py", line 2671, in 
>>>>>>>>> <module>
>>>>>>>>>     device = 
>>>>>>>>> InterceptorDriver.DEVICE_TYPES.get(options.device_type)(
>>>>>>>>>   File "/usr/share/weewx/user/interceptor.py", line 728, in 
>>>>>>>>> __init__
>>>>>>>>>     super(WUClient, self).__init__(
>>>>>>>>>   File "/usr/share/weewx/user/interceptor.py", line 427, in 
>>>>>>>>> __init__
>>>>>>>>>     self._server = Consumer.SniffServer(
>>>>>>>>>   File "/usr/share/weewx/user/interceptor.py", line 466, in 
>>>>>>>>> __init__
>>>>>>>>>     import pcap
>>>>>>>>> ModuleNotFoundError: No module named 'pcap'
>>>>>>>>> weewx@raspberrypi:/usr/share/weewx/user $
>>>>>>>>>
>>>>>>>>> On Monday, April 24, 2023 at 12:48:18 PM UTC-7 vince wrote:
>>>>>>>>>
>>>>>>>>>> Again, your python is messed up or you have python (2) and 
>>>>>>>>>> python3 installed.
>>>>>>>>>>
>>>>>>>>>> This worked on a clean raspios.  Same as your command just with 
>>>>>>>>>> an absolute path to interceptor.py
>>>>>>>>>>
>>>>>>>>>> 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"
>>>>>>>>>>
>>>>>>>>>> Try 'python --version' to verify it reports the same thing as 
>>>>>>>>>> 'python3 --version'.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Monday, April 24, 2023 at 10:45:31 AM UTC-7 Michael wrote:
>>>>>>>>>>
>>>>>>>>>>> sudo PYTHONPATH=/usr/share/weewx python interceptor.py 
>>>>>>>>>>> --device=wu-client --mode=sniff --iface=eth0 --filter="src 
>>>>>>>>>>> 192.168.50.9 and 
>>>>>>>>>>> dst port 80"
>>>>>>>>>>> Traceback (most recent call last):
>>>>>>>>>>>   File "/usr/share/weewx/user/interceptor.py", line 2671, in 
>>>>>>>>>>> <module>
>>>>>>>>>>>     device = 
>>>>>>>>>>> InterceptorDriver.DEVICE_TYPES.get(options.device_type)(
>>>>>>>>>>>   File "/usr/share/weewx/user/interceptor.py", line 728, in 
>>>>>>>>>>> __init__
>>>>>>>>>>>     super(WUClient, self).__init__(
>>>>>>>>>>>   File "/usr/share/weewx/user/interceptor.py", line 427, in 
>>>>>>>>>>> __init__
>>>>>>>>>>>     self._server = Consumer.SniffServer(
>>>>>>>>>>>   File "/usr/share/weewx/user/interceptor.py", line 466, in 
>>>>>>>>>>> __init__
>>>>>>>>>>>     import pcap
>>>>>>>>>>> ModuleNotFoundError: No module named 'pcap'
>>>>>>>>>>>
>>>>>>>>>>> On Monday, April 24, 2023 at 10:36:39 AM UTC-7 vince wrote:
>>>>>>>>>>>
>>>>>>>>>>>> On Monday, April 24, 2023 at 9:34:36 AM UTC-7 Michael wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> I am trying to install WeeWx on my Raspi with Interceptor with 
>>>>>>>>>>>> a WU-Client coming from 192.168.50.9.  So far I am ending up with 
>>>>>>>>>>>> the 
>>>>>>>>>>>> following error message when trying to run the driver directly and 
>>>>>>>>>>>> no 
>>>>>>>>>>>> results in WeeWx.  
>>>>>>>>>>>>
>>>>>>>>>>>> Activateing packet capture failed. Error returned by packet 
>>>>>>>>>>>> capture library was b'socket: Operation not permitted'
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> [...omitting waaaaay too many lines.....]
>>>>>>>>>>>>
>>>>>>>>>>>> Your last command was:
>>>>>>>>>>>>
>>>>>>>>>>>> weewx@raspberrypi:/usr/share/weewx/user $ 
>>>>>>>>>>>> PYTHONPATH=/usr/share/weewx python interceptor.py 
>>>>>>>>>>>> --device=wu-client 
>>>>>>>>>>>> --mode=sniff --iface=eth0 --filter="src 192.168.50.9 and dst port 
>>>>>>>>>>>> 80"
>>>>>>>>>>>>
>>>>>>>>>>>> You need to do that as root. Preface that last command with 
>>>>>>>>>>>> sudo so it runs as root.
>>>>>>>>>>>>
>>>>>>>>>>>> -- 
>>>>> 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/e244366f-a6e4-4fc9-ab5b-abe8ad959951n%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/weewx-user/e244366f-a6e4-4fc9-ab5b-abe8ad959951n%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/8faf8aeb-8068-42b6-8768-29db2f54ff6cn%40googlegroups.com.

Reply via email to