MQTT Connection loop


#1

Hi guys!

I’m spinning my head arround using NodeMCU V3 with openmqttgateway. I checked and rechecked my configuration and tried DHCP, disabling passwords on mosquitto, connecting nothing except noceMCU and can’t get pass a loop where it connects to the Wifi and then appears the following:
MQTT connection…
failed, rc=
-2

Sometimes it appears to connect succefully (“Connected to broker Subscription OK to the subjects”) but than again it starts on the above loop.

Any idea? I activated RF only.


#2

Full:
MQTT connection…
Connected to broker
Subscription OK to the subjects
Uptime (s)
488
Remaining memory
33848
RSSI
-72
SSID
Leal
Activated modules
RF
MQTT connection…
failed, rc=
-2
try again in 5s


#3

Is it the only client with “OpenMQTTGateway” as the gateway name that you are using?
If it is not the case you should change the name of the gateway.


#4

Hi!
Yes, it’s the only device I have (it’s the first one). I also tried to change the name before with the same results.
I’ve deleted all the libraries in my arduino IDE folder and copied only the ones in the zip file.
I also checked my mosquitto log and it says something like gateway connected and then “a device is reconnecting. it already has a session. ending last session and opening new one. connected” also in a loop.


#5

Hi,

did you try to update your broker to the latest version?

Could you post the result of the build from the arduino IDE?


#6

mosquitto version 1.5.5 ; MQTT v3.1.1 broker.

You mean the messages on the botton after flashing?

Sketch uses 465096 bytes (44%) of program storage space. Maximum is 1044464 bytes.
Global variables use 35548 bytes (43%) of dynamic memory, leaving 46372 bytes for local variables. Maximum is 81920 bytes.
Uploading 469248 bytes from C:\Users\NUNOLE~1\AppData\Local\Temp\arduino_build_791023/OpenMQTTGateway.ino.bin to flash at 0x00000000
................................................................................ [ 17% ]
................................................................................ [ 34% ]
................................................................................ [ 52% ]
................................................................................ [ 69% ]
................................................................................ [ 87% ]
...........................................................                      [ 100%

#7

Could you indicate what is the version of ESP8266 board you are using (from arduino IDE, tools->boards->boards manager)

Secondly if you check on your borker log could you post what you are seeing?