Weewx Interceptor comand line

38 views
Skip to first unread message

sc.lep...@gmail.com

unread,
Feb 9, 2023, 7:43:38 AM2/9/23
to weewx-user
Hello  
I want to use in command line  interceptor 
I use this  :  
# PYTHONPATH=bin python3 ./interceptor.py --device_type=wu_client --mode=listen --iface=eth0 --filter="src 192.168.0.30 and dest 80"

root@meteo-Ubuntu:/usr/share/weewx/user# PYTHONPATH=bin python3 ./interceptor.py --device_type=wu_client --mode=listen --iface=eth0 --filter="src 192.168.0.30 and dest 80"
Traceback (most recent call last):
  File "/usr/share/weewx/user/./interceptor.py", line 301, in <module>
    import weewx.drivers
ModuleNotFoundError: No module named 'weewx'
root@meteo-Ubuntu:/usr/share/weewx/user# 

But I  have this  message 

Can someone help me and tell me how to do thgis correctly  ?
Thanks

matthew wall

unread,
Feb 9, 2023, 8:59:25 AM2/9/23
to weewx-user
On Thursday, February 9, 2023 at 7:43:38 AM UTC-5 sc.lep...@gmail.com wrote:
> Can someone help me and tell me how to do thgis correctly  ?

the PYTHONPATH must be set to the weewx 'bin' directory.  in your case, that would be '/usr/share/weewx'.

given that your current directory is /usr/share/weewx, you can use either a relative path:

PYTHONPATH=..

or you can use the absolute path: 

PYTHONPATH=/usr/share/weewx

alternatively, you can use absolute path for everything, and thus be independent of where you do the invocation:

PYTHONPATH=/usr/share/weewx /usr/share/weewx/user/interceptor.py ...

Reply all
Reply to author
Forward
0 new messages