I’m getting the following error when I start my docker compose container:
ERROR:weatherflow2mqtt.weatherflow_mqtt:Could not start listening to the UDP Socket. Error is: Could not open a local UDP endpoint
Here is my docker compose setup:
weatherflow2mqtt:
container_name: weatherflow2mqtt
environment:
- TZ=America/Chicago
- UNIT_SYSTEM=imperial
- LANGUAGE=en
- RAPID_WIND_INTERVAL=0
- DEBUG=False
- ELEVATION=0
- WF_HOST=<Tempest Hub IP Address>
- WF_PORT=50222
- MQTT_HOST=mosquitto
- MQTT_PORT=1883
- MQTT_DEBUG=False
- STATION_ID=<Station Name>
- STATION_TOKEN=<Station Token>
- FORECAST_INTERVAL=30
image: briis/weatherflow2mqtt:latest
#network_mode: host
ports:
- 50222:50222/udp
#- 0.0.0.0:50222:50222/udp
#- <Host IP Address>:50222:50222/udp
restart: unless-stopped
volumes:
- /srv/homeautomation/weatherflow2mqtt:/data
Could someone help me understand why it’s not able to open the UDP endpoint? I’ve done the following trying to make it work:
- Changed the network_mode to host, same error message
- Tried all 3 ports entries (1 at a time)
I’m wondering if perhaps I have the wrong IP address for my Tempest Hub or is the error indicating it can’t actually create the UDP port for the container to the host? I searched my docker compose file and there’s no other 50222 ports being opened so it’s not a conflict. As a side note when I tried adding the WeatherFlow integration in Home Assistant (HA) it wasn’t able to connect using the IP address, I thought perhaps it was a problem because I don’t have HA running as “network_mode: host” anymore, when I did have HA running as “network_mode: host”, the WeatherFlow integration was able to locate it on its own without me having to manually enter an IP address.
To clarify I’m looking to accomplish the Weatherflow2MQTT image running in a docker compose container without “network_mode: host”. Also, what’s the easiest way to verify I have the correct IP address for my Tempest hub that I need in order to use it for the WF_HOST environment variable. Also, what’s the format I should use for the “ports” entry and if I need to specify an IP address before the port, what should that IP address be of, host, container, 0.0.0.0, something else?
Any guidance would be appreciated.