I have a problem trying to connect the lora-gateway-bridge, which is running on a raspberryp pi, with the MQTT-broker on a remote server. The loraserver and the lora-app-server are both running on the remote server and can connect to the MQTT-broker with passwords. I was following these two topic to figure out the issue:
The MQTT-broker remote server is listening on port 1883:
tcp 0 0 127.0.0.1:1883 0.0.0.0:* LISTEN
Because of the timeout I first tried to run it without the TLS with the following command.
/usr/bin/lora-gateway-bridge --mqtt-server “tcp://xxx.xx.x.xxx:1883” --mqtt-username USERNAME --mqtt-password PASSWORD --log-level 5
Is it possible that it is a firewall issue due to the timeout?
Thank you for your answer. Ok, that was one failure. After correcting that issue by binding the mosquitto to 0.0.0.0 instead, the issue remains. I tried the following on the remote:
The server is now listening on all interfaces and scanning the open ports of the server from the gateway shows that the port is accessible.
sudo nmap -p 1883 xxx.xx.x.xxx
Starting Nmap 7.40 ( https://nmap.org ) at 2018-03-27 19:40 CEST
Nmap scan report for “srv.example.org” (xxx.xx.x.xxx)
Host is up (0.021s latency).
PORT STATE SERVICE
1883/tcp filtered mqtt
Nmap done: 1 IP address (1 host up) scanned in 1.71 seconds
Above it says, that the port is filtered could it still be the firewall? In the configuration I defined the user and the password:
Content of lora-gatway-bridge config
server=“tcp://xxx.xx.x.xxx:1883”
username=“loraserver_gw”
password=“xxx”
I entered the user in mosquitto’s password file on the server and disabled the ACL for the testing. I will add the auth_plugin later and the SSL support later.
Content of Mosquitto password_file
loraserver_gw:$xxxxxxxxxxxxxxxxxxxxxxxxxxx==
Maybe you have another hint. I will go over the MQTT settings again maybe I missed something.
To find out if it is a firewall issue, you could try telnet xxx.xx.x.xxx 1883 to find out if you can reach the MQTT broker. I assume this is a networking related issue, when It would be related to your credentials it would give a different error.