When I try the whole command as root I get (note I will change the flags after I get it to find the file):
PYTHONPATH=bin python bin/user/interceptor.py
--device=acurite-bridge --mode=sniff --iface=eth0 --filter="src
192.168.0.4 and dst port 80"
python: can't open file 'bin/user/interceptor.py': [Errno 2] No
such file or directory
That is why I executed the way I did. Maybe this is what is going on. Not sure why this does not work.
Thanks,
Chris KQ6UP
--
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 weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/89cf1d35-dbdd-4fc2-b845-96a3834dd627n%40googlegroups.com.
There is no "bin" directory in /home/weewx or /usr/share/weewx. I don't have a /home/weewx directory, but I do /usr/share/weewx directory.
I have "tree'd" the weewx folder.
weewx/
├── daemon.py
├── __pycache__
│ ├── daemon.cpython-37.pyc
│ └── six.cpython-37.pyc
├── schemas
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-37.pyc
│ │ └── wview_extended.cpython-37.pyc
│ ├── wview_extended.py
│ └── wview.py
├── six.py
├── user
│ ├── extensions.py
│ ├── __init__.py
│ ├── installer
│ │ └── interceptor
│ │ └── install.py
│ ├── interceptor.py
│ └── __pycache__
│ ├── extensions.cpython-37.pyc
│ ├── __init__.cpython-37.pyc
│ └── interceptor.cpython-37.pyc
├── weecfg
│ ├── config.py
│ ├── database.py
│ ├── extension.py
│ ├── __init__.py
│ └── __pycache__
│ ├── config.cpython-37.pyc
│ ├── extension.cpython-37.pyc
│ └── __init__.cpython-37.pyc
├── wee_config
├── wee_database
├── weedb
│ ├── __init__.py
│ ├── mysql.py
│ ├── __pycache__
│ │ ├── __init__.cpython-37.pyc
│ │ └── sqlite.cpython-37.pyc
│ └── sqlite.py
├── wee_debug
├── wee_device
├── wee_extension
├── wee_import
├── weeimport
│ ├── csvimport.py
│ ├── cumulusimport.py
│ ├── __init__.py
│ ├── wdimport.py
│ ├── weathercatimport.py
│ ├── weeimport.py
│ └── wuimport.py
├── weeplot
│ ├── genplot.py
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── genplot.cpython-37.pyc
│ │ ├── __init__.cpython-37.pyc
│ │ └── utilities.cpython-37.pyc
│ └── utilities.py
├── wee_reports
├── weeutil
│ ├── config.py
│ ├── ftpupload.py
│ ├── __init__.py
│ ├── logger.py
│ ├── log.py
│ ├── Moon.py
│ ├── __pycache__
│ │ ├── config.cpython-37.pyc
│ │ ├── __init__.cpython-37.pyc
│ │ ├── logger.cpython-37.pyc
│ │ ├── Moon.cpython-37.pyc
│ │ ├── Sun.cpython-37.pyc
│ │ └── weeutil.cpython-37.pyc
│ ├── rsyncupload.py
│ ├── Sun.py
│ ├── timediff.py
│ └── weeutil.py
├── weewx
│ ├── accum.py
│ ├── almanac.py
│ ├── cheetahgenerator.py
│ ├── crc16.py
│ ├── defaults.py
│ ├── drivers
│ │ ├── acurite.py
│ │ ├── cc3000.py
│ │ ├── fousb.py
│ │ ├── __init__.py
│ │ ├── __pycache__
│ │ │ ├── __init__.cpython-37.pyc
│ │ │ └── simulator.cpython-37.pyc
│ │ ├── simulator.py
│ │ ├── te923.py
│ │ ├── ultimeter.py
│ │ ├── vantage.py
│ │ ├── wmr100.py
│ │ ├── wmr200.py
│ │ ├── wmr300.py
│ │ ├── wmr9x8.py
│ │ ├── ws1.py
│ │ ├── ws23xx.py
│ │ └── ws28xx.py
│ ├── engine.py
│ ├── filegenerator.py
│ ├── imagegenerator.py
│ ├── __init__.py
│ ├── manager.py
│ ├── __pycache__
│ │ ├── accum.cpython-37.pyc
│ │ ├── almanac.cpython-37.pyc
│ │ ├── cheetahgenerator.cpython-37.pyc
│ │ ├── defaults.cpython-37.pyc
│ │ ├── engine.cpython-37.pyc
│ │ ├── imagegenerator.cpython-37.pyc
│ │ ├── __init__.cpython-37.pyc
│ │ ├── manager.cpython-37.pyc
│ │ ├── qc.cpython-37.pyc
│ │ ├── reportengine.cpython-37.pyc
│ │ ├── restx.cpython-37.pyc
│ │ ├── station.cpython-37.pyc
│ │ ├── tags.cpython-37.pyc
│ │ ├── units.cpython-37.pyc
│ │ ├── uwxutils.cpython-37.pyc
│ │ ├── wxformulas.cpython-37.pyc
│ │ ├── wxservices.cpython-37.pyc
│ │ ├── wxxtypes.cpython-37.pyc
│ │ └── xtypes.cpython-37.pyc
│ ├── qc.py
│ ├── reportengine.py
│ ├── restx.py
│ ├── station.py
│ ├── tags.py
│ ├── units.py
│ ├── uwxutils.py
│ ├── wxengine.py
│ ├── wxformulas.py
│ ├── wxmanager.py
│ ├── wxservices.py
│ ├── wxxtypes.py
│ └── xtypes.py
├── weewxd
└── wunderfixer
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/19012ab2-4b5f-42d2-b85e-b2b952324fe0n%40googlegroups.com.
It got one line further, lol:
root@raspberrypi:/usr/share/weewx# PYTHONPATH=/usr/share/weewx python /usr/share/weewx/user/interceptor.py --device=acurite-bridge --mode=sniff --iface=wlan0 --filter="src 10.3.141.99 and dst port 80"
Traceback (most recent call last):
File "/usr/share/weewx/user/interceptor.py", line 303, in
<module>
import weeutil.weeutil
File "/usr/share/weewx/weeutil/weeutil.py", line 26, in
<module>
from weeutil.config import accumulateLeaves, search_up
File "/usr/share/weewx/weeutil/config.py", line 11, in
<module>
import configobj
ImportError: No module named configobj
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/66751660-e8af-4614-888e-1c616cf05150n%40googlegroups.com.
Ok, got a little further.
Dec 12 17:04:24 raspberrypi weewx[18797] INFO __main__: Using Python 3.7.3 (default, Jul 25 2020, 13:03:44) #012[GCC 8.3.0]
root@raspberrypi:/home/pi# PYTHONPATH=/usr/share/weewx python3.7 /usr/share/weewx/user/interceptor.py --device=acurite-bridge --mode=sniff --iface=wlan0 --filter="src 10.3.141.99 and dst port 80"
Traceback (most recent call last):
File "/usr/share/weewx/user/interceptor.py", line 2664, in
<module>
address=options.addr, port=options.port)
File "/usr/share/weewx/user/interceptor.py", line 1002, in
__init__
AcuriteBridge.Parser(), handler=AcuriteBridge.Handler,
**stn_dict)
File "/usr/share/weewx/user/interceptor.py", line 427, in
__init__
iface, pcap_filter, promiscuous)
File "/usr/share/weewx/user/interceptor.py", line 465, in
__init__
import pcap
ModuleNotFoundError: No module named 'pcap'
@@@@@I have this installed, but I guess it is not finding it:@@@@@@
root@raspberrypi:/home/pi# sudo apt-get install python-libpcap
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-libpcap is already the newest version (0.6.4-1).
The following packages were automatically installed and are no
longer required:
lxplug-volume openbsd-inetd tcpd
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Thanks,
Chris KQ6UP
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/9b398246-6866-46d5-b96b-eb82fe294185n%40googlegroups.com.
Done, same error.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/14f28ca7-b305-4d90-a15c-9e2dd4a3b470n%40googlegroups.com.
pip3 install pypcap
Looking in indexes: https://pypi.org/simple,
https://www.piwheels.org/simple
Collecting pypcap
Downloading
https://files.pythonhosted.org/packages/12/71/a689ca8c6ef4570e105efdc6b46d4ac16cdef7af36a8fbfaff0f6fa2b754/pypcap-1.2.3.tar.gz
(136kB) 100% |████████████████████████████████| 143kB 1.4MB/s
Complete output from command python setup.py egg_info: pcap.h
not
found
---------------------------------------- Command "python
setup.py
egg_info" failed with error code 1 in
/tmp/pip-install-yuo7efq5/pypcap/
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/419a5e8a-65b5-4234-815f-12dcd2438b56n%40googlegroups.com.
Thank you for your help,
Chris KQ6UP
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/b1fb2f5a-92a6-4cad-a916-b05d5b2c8451n%40googlegroups.com.
pip3 was missing some file. I ripped out pypthon3 and
reinstalled everything. Then pip3 installed
pip3 install pypcap
I think was also missing libpcap-dev and should have been installed by dependency . So basically wound up in some DLL hell.
Seemed to resolve something as the diagnostic test runs with this output:
PYTHONPATH=/usr/share/weewx python3.7
/usr/share/weewx/user/interceptor.py --device=wu-client
--mode=sniff --iface=wlan0 --filter="src 10.3.141.99 and dst port
80"
Exception in thread ServerThread:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in
_bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/usr/share/weewx/user/interceptor.py", line 434, in
run_server
self._server.run()
File "/usr/share/weewx/user/interceptor.py", line 490, in run
self.decode_ip_packet(0, pkt, ts)
File "/usr/share/weewx/user/interceptor.py", line 517, in
decode_ip_packet
(_timestamp, _pktlen, _fmt_bytes(data)))
File "/usr/share/weewx/user/interceptor.py", line 337, in
_fmt_bytes
return ' '.join(['%02x' % ord(x) for x in data])
File "/usr/share/weewx/user/interceptor.py", line 337, in
<listcomp>
return ' '.join(['%02x' % ord(x) for x in data])
TypeError: ord() expected string of length 1, but int found
Hopefully this output will be helpful.
Thanks,
Chris KQ6UP
pip3 install pypcap