Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5 weewx python3 documentation updates #120

Open
vinceskahan opened this issue Mar 20, 2024 · 1 comment
Open

v5 weewx python3 documentation updates #120

vinceskahan opened this issue Mar 20, 2024 · 1 comment

Comments

@vinceskahan
Copy link

vinceskahan commented Mar 20, 2024

Matthew - here's some documentation tweaks that might help folks on v5 get interceptor running under python3 on a pi....

Install and configure the prerequisites, assuming you have 'pip' available already...

# for a pip installation of weewx
source /home/pi/weewx-venv/bin/activate
pip3 install libpcap
pip3 install pypcap

# or for a dpkg installation of weewx
sudo apt-get install -y libpcap-dev
sudo python3 -m pip install libpcap pypcap --break-system-packages

Install the driver and enable it

weectl extension install https://github.com/matthewwall/weewx-interceptor/archive/master.zip
weectl station reconfigure --no-prompt --driver=user.interceptor

And edit weewx.conf to fill in the config entry to listen....

[Interceptor]
    driver = user.interceptor
    device_type = ecowitt-client
    mode = listen
    port = 8000
    iface = wlan0

The result is it seems (seems...) to listen ok although I don't have any gear emitting data that it could hear. At a minimum things seem to run ok and the info above might be worth using when you get around to updating the toplevel readme for v5....

Re: how to get the non-privileged user weewx (or pi etc.) to listen on a privileged port, all I can find is references to set network capabilities on the python binary itself ala sudo setcap cap_net_raw+eip /usr/bin/python3.11 but to me that seems like a bit of a security risk. Quick test without doing that seems to listen ok in a dpkg installation on unprivileged ports such as 8000.

@vinceskahan
Copy link
Author

vinceskahan commented Mar 28, 2024

added dpkg commands for getting the pcap items installed (tested in vagrant deb12) and also how to possibly permit the unprivileged user access to sniff or listen on privileged ports, which seems like a security risk to me. At a minimum it would make things quietly break if you ever updated your python version afterward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant