weewx.drivers.vantage: Socket error while opening port 22222

254 views
Skip to first unread message

Ed Surowiec

unread,
Jan 21, 2024, 4:13:44 PM1/21/24
to weewx-user

I am having trouble getting weewx to connect to my WeatherLink Live ethernet box.  I am able to connect to the WeatherLink Live using a browser and also using netcat to port 22222 from the raspberry pi I have weewx installed on.  Here is the error.  Any help would be appreciated.



Jan 21 13:51:26 rpi-blue weewxd[12964]: INFO weewx.engine: Loading station type Vantage (weewx.drivers.vantage)

Jan 21 13:51:26 rpi-blue weewxd[12964]: ERROR weewx.drivers.vantage: Socket error while opening port 22222 to ethernet host 10.0.1.180.

Jan 21 13:51:26 rpi-blue weewxd[12964]: ERROR weewx.engine: Import of driver failed: [Errno 111] Connection refused (<class 'weewx.WeeWxIOError'>)


I am able to connect to weatherlink live box using the link http://10.0.1.180:80/v1/current_conditions

and see data in my browser.


I can also connect to the weatherlink live with netcat from the raspberry pi that I have weewx installed on.

pi@rpi-blue:~ $ nc -nvulp 22222

Bound on 0.0.0.0 22222

Connection received on 10.0.1.180 43539

{"did":"001D0A712868","ts":1705869635,"conditions":[{"lsid":326721,"data_structure_type":1,"txid":1,"wind_speed_last":4.00,"wind_dir_last":207,"rain_size":1,"rain_rate_last":0,"rain_15_min":0,"rain_60_min":0,"rain_24_hr":28,"rain_storm":28,"rain_storm_start_at":1705832820,"rainfall_daily":28,"rainfall_monthly":54,"rainfall_year":54,"wind_speed_hi_last_10_min":10.00,"wind_dir_at_hi_speed_last_10_min":244}]}^C


My weewx.config contains the following:

##############################################################################

[Vantage]
    # This section is for the Davis Vantage series of weather stations.
   
    # Connection type: serial or ethernet
    #  serial (the classic VantagePro)
    #  ethernet (the WeatherLinkIP or Serial-Ethernet bridge)
       type = ethernet
   
    # If the connection type is serial, a port must be specified:
    #   Debian, Ubuntu, Redhat, Fedora, and SuSE:
    #     /dev/ttyUSB0 is a common USB port name
    #     /dev/ttyS0   is a common serial port name
    #   BSD:
    #     /dev/cuaU0   is a common serial port name
    port = /dev/ttyUSB0
   
    # If the connection type is ethernet, an IP Address/hostname is required:
       host = 10.0.1.180
   
    ######################################################
    # The rest of this section rarely needs any attention.
    # You can safely leave it "as is."
    ######################################################
   
    # Serial baud rate (usually 19200)
    baudrate = 19200
   
    # TCP port (when using the WeatherLinkIP)
    tcp_port = 22222
   
    # TCP send delay (when using the WeatherLinkIP):
    tcp_send_delay = 0.5
   
    # The type of LOOP packet to request: 1 = LOOP1; 2 = LOOP2; 3 = both
    loop_request = 1
   
    # The id of your ISS station (usually 1). If you use a wind meter connected
    # to a anemometer transmitter kit, use its id
    iss_id = 1
   
    # How long to wait for a response from the station before giving up (in
    # seconds; must be greater than 2)
    timeout = 4
   
    # How long to wait before trying again (in seconds)
    wait_before_retry = 1.2
   
    # How many times to try before giving up:
    max_tries = 4
   
    # Vantage model Type: 1 = Vantage Pro; 2 = Vantage Pro2
    model_type = 2
   
    # The driver to use:
    driver = weewx.drivers.vantage

##############################################################################


John Smith

unread,
Jan 22, 2024, 12:27:04 AM1/22/24
to weewx...@googlegroups.com
On Mon, 22 Jan 2024 at 08:13, Ed Surowiec <esur...@gmail.com> wrote:

I am having trouble getting weewx to connect to my WeatherLink Live ethernet box.  I am able to connect to the WeatherLink Live using a browser and also using netcat to port 22222 from the raspberry pi I have weewx installed on.  Here is the error.  Any help would be appreciated.



Jan 21 13:51:26 rpi-blue weewxd[12964]: INFO weewx.engine: Loading station type Vantage (weewx.drivers.vantage)

Jan 21 13:51:26 rpi-blue weewxd[12964]: ERROR weewx.drivers.vantage: Socket error while opening port 22222 to ethernet host 10.0.1.180.

Jan 21 13:51:26 rpi-blue weewxd[12964]: ERROR weewx.engine: Import of driver failed: [Errno 111] Connection refused (<class 'weewx.WeeWxIOError'>)


It looks like you are connecting to the wrong IP or it's not reachable on the LAN 

Bill Hattel

unread,
Jan 26, 2024, 12:33:35 PM1/26/24
to weewx-user
I'm having the same issue after an upgrade to 5.0.0-1. I inspected the configuration file even though I selected no changes and found everything was correct. I also completely removed weewx and reinstalled it with a new configuration file. I can communicate with the Davis console through WeatherLink with the same settings and interface with no issue. The port is closed when WeatherLink exits.

Davis Vantage Vue
Raspberry PI
NetBurner SBL2E Dual Serial to Ethernet converter
Homemade RS-232 level shifter.

-- Logs begin at Thu 2024-01-25 19:43:48 MST, end at Fri 2024-01-26 09:03:07 MST. --
Jan 25 19:44:05 raspberrypi systemd[1]: Started WeeWX.
Jan 25 19:44:10 raspberrypi weewxd[298]: INFO __main__: Initializing weewxd version 5.0.0
Jan 25 19:44:10 raspberrypi weewxd[298]: INFO __main__: Command line: /usr/share/weewx/weewxd.py /etc/weewx/weewx.conf
Jan 25 19:44:10 raspberrypi weewxd[298]: INFO __main__: Using Python 3.7.3 (default, Oct 11 2023, 09:51:27)
                                         [GCC 8.3.0]
Jan 25 19:44:10 raspberrypi weewxd[298]: INFO __main__: Located at /usr/bin/python3
Jan 25 19:44:10 raspberrypi weewxd[298]: INFO __main__: Platform Linux-5.10.103+-armv6l-with-debian-10.13
Jan 25 19:44:10 raspberrypi weewxd[298]: INFO __main__: Locale: 'en_GB.UTF-8'
Jan 25 19:44:10 raspberrypi weewxd[298]: INFO __main__: Entry path: /usr/share/weewx/weewxd.py
Jan 25 19:44:10 raspberrypi weewxd[298]: INFO __main__: WEEWX_ROOT: /etc/weewx
Jan 25 19:44:10 raspberrypi weewxd[298]: INFO __main__: Configuration file: /etc/weewx/weewx.conf
Jan 25 19:44:10 raspberrypi weewxd[298]: INFO __main__: User module: /etc/weewx/bin/user
Jan 25 19:44:10 raspberrypi weewxd[298]: INFO __main__: Debug: 0
Jan 25 19:44:10 raspberrypi weewxd[298]: INFO weewx.engine: Loading station type Vantage (weewx.drivers.vantage)
Jan 25 19:44:10 raspberrypi weewxd[298]: ERROR weewx.drivers.vantage: Socket error while opening port 23 to ethernet host 192.168.50.39.     <<<<  ******************** this line ************************
Jan 25 19:44:10 raspberrypi weewxd[298]: ERROR weewx.engine: Import of driver failed: [Errno 101] Network is unreachable (<class 'weewx.WeeWxIOError'>)
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****  Traceback (most recent call last):
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 354, in openPort
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****      self.socket.connect((self.host, self.port))
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****  OSError: [Errno 101] Network is unreachable
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****  During handling of the above exception, another exception occurred:
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****  Traceback (most recent call last):
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/engine.py", line 115, in setupStation
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****      self.console = loader_function(config_dict, self)
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 32, in loader
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****      return VantageService(engine, config_dict)
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 2046, in __init__
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****      Vantage.__init__(self, **config_dict[DRIVER_NAME])
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 536, in __init__
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****      self.port.openPort()
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****    File "/usr/share/weewx/weewx/drivers/vantage.py", line 359, in openPort
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****      raise weewx.WeeWxIOError(ex)
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL weewx.engine:     ****  weewx.WeeWxIOError: [Errno 101] Network is unreachable
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL __main__: Unable to load driver: [Errno 101] Network is unreachable
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL __main__:     ****  Exiting...
Jan 25 19:44:10 raspberrypi systemd[1]: weewx.service: Main process exited, code=exited, status=4/NOPERMISSION
Jan 25 19:44:10 raspberrypi systemd[1]: weewx.service: Failed with result 'exit-code'.

Is it possible to roll back a version?

Thanks,
Bill

vince

unread,
Jan 26, 2024, 1:11:19 PM1/26/24
to weewx-user
On Friday, January 26, 2024 at 9:33:35 AM UTC-8 Bill Hattel wrote:
I'm having the same issue after an upgrade to 5.0.0-1. I inspected the configuration file even though I selected no changes and found everything was correct. I also completely removed weewx and reinstalled it with a new configuration file. I can communicate with the Davis console through WeatherLink with the same settings and interface with no issue. The port is closed when WeatherLink exits.

Davis Vantage Vue
Raspberry PI
NetBurner SBL2E Dual Serial to Ethernet converter
Homemade RS-232 level shifter.


Hmmm....that's pretty unusual/exotic hardware connecting the Vue to the pi....
 
Jan 25 19:44:10 raspberrypi weewxd[298]: ERROR weewx.drivers.vantage: Socket error while opening port 23 to ethernet host 192.168.50.39.     <<<<  ******************** this line ************************
Jan 25 19:44:10 raspberrypi weewxd[298]: ERROR weewx.engine: Import of driver failed: [Errno 101] Network is unreachable (<class 'weewx.WeeWxIOError'>)
]
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL __main__: Unable to load driver: [Errno 101] Network is unreachable
Jan 25 19:44:10 raspberrypi weewxd[298]: CRITICAL __main__:     ****  Exiting...
Jan 25 19:44:10 raspberrypi systemd[1]: weewx.service: Main process exited, code=exited, status=4/NOPERMISSION


Network unreachable is a different issue than others are having. 

What's your weewx system ip ?  What is the ip you are trying to talk to ?   If they're on different networks you are possibly missing a route on your weewx system.   From the weewx system you might try "traceroute -n 192.168.50.39" if the destination address in your logs is correct.

This one looks like a routing or packet filter issue on a router in between the weewx box and the serial-to-ethernet converter 'if' they are on different subnets

Bill Hattel

unread,
Jan 27, 2024, 11:59:15 AM1/27/24
to weewx-user
Hi Vince,
Thank you for replying. It turns out, it was something simple as usual. It's not starting at power-up and in my haste to recognize that, I reset the Ethernet to serial adapter to factory defaults which set the baud rate to 115200. Once I set it back to 19200 and started weewx, it began reporting. I'm still having an issue with it starting after reboot, but I think I can resolve it without too much trouble. I'd like to hear any suggestions you have for that issue though.

As far as the complexity of my setup, I originally started out with the Davis Instruments serial module on a PC which was kind of pricey back in the early 2000s. The NetBurner approach let me keep my existing hardware and add it to my home network for a reasonable cost.

Thanks again!
Bill

vince

unread,
Jan 27, 2024, 12:27:52 PM1/27/24
to weewx-user
Cool you solved it.  Wouldn't have thought that a baud rate thing would get you network unreachable. 

Bill Hattel

unread,
Jan 27, 2024, 2:55:33 PM1/27/24
to weewx-user
Hi Vince,
Not quite solved. It still fails to start after reboot. I think I solved it before by adding a line somewhere.

I have this in my notes:

Wait for network before startup:
Add $network to # Required-Start

I can't remember where I placed this before or if there's a better way to delay weewx start until the network is ready.

Any suggestions?

Thanks,
Bill

jterr...@gmail.com

unread,
Jan 28, 2024, 6:37:59 AM1/28/24
to weewx-user
I am coming back to your first message of this discussion since  it seems that you are trying to use the weewx Vantage driver to connect to a Weatherlink Live.
The communication protocol of the Weatherlink Live is completely different of the one used by VP2 or Vantage Vue + datalogger., and the built-in Vantage driver will not work with a Weatherlink Live.

If you want weewx to capture data from the Weatherlink Live, you will have to use one of the available third-party weewx driver specifically written for the Weatherlink Live . See https://github.com/weewx/weewx/wiki/#drivers
Reply all
Reply to author
Forward
0 new messages