Interceptor driver "cannot assign requested address" - noob here - thoughts?

296 views
Skip to first unread message

Kruse Ludington

unread,
Jan 11, 2022, 10:55:59 PM1/11/22
to weewx-user
I have an Ambient WS-2902C with a console publishing to four places specified in the awnet app: 1. AmbientWeather.net; 2. Wunderground; 3. Weathercloud; and 4; Customized - to <IP ADDRESS OF MY RASPBERRY PI> on port 80 (both on the same network internal network) but the PI is having trouble loading the interceptor driver with weird error messages (probably something simple as I am a noob). As per the Interceptor installation instructions for this model state I should use device-type=observer and listen (as I am not intercepting), these are the error messages I am running into from the log - 

sudo /etc/init.d/weewx start

then here's the log info:

Jan 11 21:53:24 kruse-pi weewx[4814] INFO __main__: Initializing weewx version 4.5.1
Jan 11 21:53:24 kruse-pi weewx[4814] INFO __main__: Using Python 3.9.2 (default, Mar 12 2021, 04:06:34) #012[GCC 10.2.1 20210110]
Jan 11 21:53:24 kruse-pi weewx[4814] INFO __main__: Platform Linux-5.10.63-v7l+-armv7l-with-glibc2.31
Jan 11 21:53:24 kruse-pi weewx[4814] INFO __main__: Locale is 'en_US.UTF-8'
Jan 11 21:53:24 kruse-pi weewx[4814] INFO __main__: PID file is /var/run/weewx.pid
Jan 11 21:53:24 kruse-pi weewx[4818] INFO __main__: Using configuration file /etc/weewx/weewx.conf
Jan 11 21:53:24 kruse-pi weewx[4818] INFO __main__: Debug is 1
Jan 11 21:53:24 kruse-pi weewx[4818] DEBUG __main__: Initializing engine
Jan 11 21:53:24 kruse-pi weewx[4818] INFO weewx.engine: Loading station type Interceptor (user.interceptor)
Jan 11 21:53:24 kruse-pi weewx[4802]: Starting weewx weather system: weewx.
Jan 11 21:53:24 kruse-pi weewx[4818] INFO user.interceptor: driver version is 0.53
Jan 11 21:53:24 kruse-pi weewx[4818] INFO user.interceptor: device type: observer
Jan 11 21:53:24 kruse-pi weewx[4818] INFO user.interceptor: mode is listen
Jan 11 21:53:24 kruse-pi weewx[4818] INFO user.interceptor: listen on 192.168.0.29:80
Jan 11 21:53:24 kruse-pi weewx[4818] ERROR weewx.engine: Import of driver failed: [Errno 99] Cannot assign requested address (<class 'OSError'>)
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****  Traceback (most recent call last):
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/engine.py", line 119, in setupStation
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****      self.console = loader_function(config_dict, self)
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****    File "/usr/share/weewx/user/interceptor.py", line 315, in loader
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****      return InterceptorDriver(**config_dict[DRIVER_NAME])
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****    File "/usr/share/weewx/user/interceptor.py", line 2522, in __init__
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****      self._device = self.DEVICE_TYPES.get(self._device_type)(**stn_dict)
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****    File "/usr/share/weewx/user/interceptor.py", line 1284, in __init__
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****      super(Observer, self).__init__(
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****    File "/usr/share/weewx/user/interceptor.py", line 429, in __init__
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****      self._server = Consumer.TCPServer(address, port, handler)
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****    File "/usr/share/weewx/user/interceptor.py", line 584, in __init__
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****      TCPServer.__init__(self, (address, int(port)), handler)
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****    File "/usr/lib/python3.9/socketserver.py", line 452, in __init__
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****      self.server_bind()
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****    File "/usr/lib/python3.9/socketserver.py", line 466, in server_bind
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****      self.socket.bind(self.server_address)
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL weewx.engine:     ****  OSError: [Errno 99] Cannot assign requested address
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL __main__: Unable to load driver: [Errno 99] Cannot assign requested address
Jan 11 21:53:24 kruse-pi weewx[4818] CRITICAL __main__:     ****  Exiting...

so, I also tried this for debugging:

pi@kruse-pi:~ $ PYTHONPATH=bin python3 /usr/share/weewx/user/interceptor.py --device=observer --mode=listen address=<IP ADDRESS OF THE CONSOLE> --port=80

And came up with this which is not very helpful!

Traceback (most recent call last):
  File "/usr/share/weewx/user/interceptor.py", line 302, in <module>
    import weewx.drivers
ModuleNotFoundError: No module named 'weewx'

????

A little help - any ideas?

Thank you!

vince

unread,
Jan 12, 2022, 12:00:36 AM1/12/22
to weewx-user
You didn't literally type "<ip address of..." in those commands did you ?  How about telling us what you actually typed.   There's nothing scary in whatever your addresses are.  Your log snippet already told us one address anyway...

Re: your PYTHONPATH line, that looks wrong to me for a dpkg installation like you did... it should probably be /usr/share/weewx

I didn't get anywhere in a quick attempt of installing interceptor on a modern ubuntu which is all python3, with all kinds of issues trying to get the pcap library installed, but I ran out of time trying to get it to work.   I'm sure somebody else here who uses it will chime in with a more authoritative answer.....


Rainer Lang

unread,
Jan 12, 2022, 1:21:02 PM1/12/22
to weewx...@googlegroups.com
1. choosing port 80 for the custom server to send/post to is not a smart choice as this port is already used by the local (RPi) web server (nginx, apache2, ...). You must choose a unique port e.g. 8000, 8080, ...

2. in weewx.conf you must not assign the port along with the ip address.
the entry should be:
ip_address = 192.168.0.29
only, no colon or port added - it's, however, not needed

below a working [Interceptor] section

# ------ start weewx.conf excerpt --------------------
[Interceptor]
    # This section is for the network traffic interceptor driver.
    
    # The driver to use:
    driver = user.interceptor
    
    # Specify the hardware device to capture.  Options include:
    #   acurite-bridge - acurite internet bridge, smarthub, or access
    #   observer - fine offset WH2600/HP1000/HP1003, ambient WS2902
    #   lw30x - oregon scientific LW301/LW302
    #   lacrosse-bridge - lacrosse GW1000U/C84612 internet bridge
    #   ecowitt-client - any hardware that uses the ecowitt protocol
    #   wu-client - any hardware that uses the weather underground protocol
    device_type = observer
     port = 8000
    iface = eth0
 # ---------- end excerpt weewx.conf ------------
if you use the WLAN interface of the RPi ("WiFi"), then use: iface = wlan0 instead of iface = eth0
(the last character is a zero !!)
You don't need to enter your IP address here, it's obviously the one of the RPi

the port (8000) should also be the same in the WS View / awnet app (customized server)
You can of course choose another number, however not 80 !
there (WS View, awnet) the IP address of your RPi has to be entered (NO http:// in front of the address !! - only the address)
the path has to show at least "/" - an empty path will keep the console from posting

good luck
--
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/0237bcb5-61c8-4b97-9fe2-55ecb0b421f6n%40googlegroups.com.


vince

unread,
Jan 12, 2022, 2:54:14 PM1/12/22
to weewx-user
Probably silly question, but does the interceptor stuff work for 'sniff' mode on a modern python3-only system ?   I got pretty much nowhere trying to get the prereqiosote libpcap stuff installed on debian10 or debian11 under python3, but it seems to install ok on debian10 under python2.

Reply all
Reply to author
Forward
0 new messages