Open Pfannex opened 8 years ago
Hi, I had an odd incident today where one of my sensors running arduino/esp8266 and lmroy pubsubclient was seemingly connected to the mosquitto server and sending publishes, in my loop I have if (client.connected()), but at the broker side, the last log entry at the time the sensor went down shows a socket error disconnect.
Im wondering how the pubsubclient could go on thinking it was connected and be making pubs for hours while in fact it was not "connected" at the broker side?
Is this the same issue as mentioned where we should really be checking the return value of client.loop() and reconnect if it fails? If so whats the point of client.connected()?
I'm trying to run the PubSubClient with my ESP8266-12e. I run the following Code on my ESP:
Generally the Code runs, but after a while it seams that the ESP lost his TCP-connection to the MQTT-Server.
At this point the debug :
At this point the TCP-connection should be renewed, but no network activity will shown on my WireShark monitor!
Maybe, the TCP-Connection is always active. The WiFi-connection schould be stable.
Is the someone who has problems like this? I´m not a C expert, so maybe someone has fun to help me to set some more debug-informations to solve the problem.
The MQTT-broker runs on a Rapberry. Used version of the Mosquitto broker is 1.4.4.
Thaks for your Help.......