I have an MQTT broker (mosquitto) running in Windows 10. It is tested and fully working on 127.0.0.1. I have a Docker container of the Chirpstack Gateway Bridge. It attempts to connect to the broker through port 1883, but always fails. I should see it failing to connect in the log of the broker but nothing appears there. The same error occurs “connection refused” even when the broker is turned off. I suspect the container is not getting outside of itself to communicate with port 1883 on the host. Your thoughts?
PS C:\BRIDGE> docker compose up
[+] Running 1/0
- Container bridge-lora-bridge-1 Created 0.0s
Attaching to bridge-lora-bridge-1
bridge-lora-bridge-1 | INFO[0000] starting ChirpStack Gateway Bridge docs="https://www.chirpstack.io/gateway-bridge/" version=
bridge-lora-bridge-1 | INFO[0000] backend/semtechudp: starting gateway udp listener addr="0.0.0.0:1700"
bridge-lora-bridge-1 | ERRO[0000] [client] dial tcp 127.0.0.1:1883: connect: connection refused module=mqtt
bridge-lora-bridge-1 | WARN[0000] [client] failed to connect to broker, trying next module=mqtt
bridge-lora-bridge-1 | ERRO[0000] [client] Failed to connect to a broker module=mqtt
bridge-lora-bridge-1 | FATA[0000] network Error : dial tcp 127.0.0.1:1883: connect: connection refused
bridge-lora-bridge-1 exited with code 1
Contents to docker-composer.yml
version: "3.6"
services:
lora-bridge:
image: chirpstack/chirpstack-gateway-bridge
stdin_open: true # docker run -i
tty: true # docker run -t
privileged: true
volumes:
- C:\BRIDGE\.config:/etc/chirpstack-gateway-bridge/
ports:
- 1883:1883
- 1700:1700