Error msg="could not setup mqtt backend [...] read: connection reset by peer"

Hello everybody,

here is the situation.
I’ve set up lora-gatewaybridge on the gateway and lora server. The problem seems really easy to solve but, googling doesn’t give any result.
So after gateway reboot lora-gateway-bridge.log is next :
time="2017-10-05T20:26:51-05:00" level=info msg="backend: connecting to mqtt broker" server="ssl://172.28.2.2:1883"
time="2017-10-05T20:26:51-05:00" level=error msg="could not setup mqtt backend, retry in 2 seconds: Network Error : read tcp 172.28.3.9:35059->172.28.2.2:1883: read: connection reset by peer"

How to resolve the problem?

EDIT: here is the runGatewa.sh file(credentials part, rest is the same as in example):
export MQTT_SERVER="ssl://172.28.2.2:1883"
export MQTT_USERNAME="loraserver"
export MQTT_PASSWORD="somepass"
Explanation:
loraserver it’s server user, like my user. The logic of using it next. When I tried to stop MQTT server, it’s said like:“You need to enter password to mosquitto user:“loraserver””. I’ll try to use mosquitto user.
Also tried:’MQTT_SERVER="172.28.2.2:1883"
MQTT_SERVER="tcp://172.28.2.2:1883"

UPD:Changed usarname and password to mosquitto and somepass
password for user created using next command:
sudo mosquitto_passwd -c /etc/mosquitto/passwd mosquitto
Also I checked connection with this username and pass with mosquitto_sub and *_pub.

Result is the same.

This looks like a networking / firewall issue.

Ok, so yesterday, almost right after I wrote this question I’ve fixed it. Problem was, that I didn’t specify MQTT_USERNAME and MQTT_PASSWORD in loraserver and lora-app-server configuration files. And I got my gateway online yesterday.
But it was only gateway, I tried to send some information to the Appserver and didn’t see even join request.

TODAY I have my server rebooted, gateway wasn’t rebooted, and again, the same problem. I did all MQTT user/pass configurations. Saved them, restarted all services, and viola, magic. Everything working!

But initially problem was in the MQTT settings.
Thank you, @brocaar.

A post was split to a new topic: Manually decode PHYPayload or decrypt FRMPayload