-
-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't get disconnected info when internet disconnection #32
Comments
When we had fixed the 2.3.0 version (esp8266/Arduino#3537) , the write function returns false after 25 tries and then the mqtt server was disconnected . I made a quick test in the 2.4.0 (they release the final version a week ago) and saw that it does not disconnected from the server, but also does not enter in a endless loop as it was doing lately. I think they just flush the data they cannot send. As I dont need to have the server disconnected when there is no internet connection I didn't investigate further for now. I am using the version 1.0.0 of Paho client, so I think version 1.1.0 is not the problem. I've also noticed that after the first connection, all others connection closes fast. I thought it was a amazon issue, but as you said, it seems to be a paho client issue. I will try to investigate this issue in the next days (although I cant promisse). Paho could have a timeout for the heartbeat message and disconnect automatically. Maybe we could try to use another client, as pubsubclient. |
Thanks for your consideration. I'll try with pubsubclient. :D |
Think I fixed the disconnection issue. It is in a two day run with just 4 reconnections. Give it a try if you can. |
The reconnection issue seems fixed. I'm still using extra ping (https://github.com/dancol90/ESP8266Ping) to detect internet disconnection and this method is not bad. |
I am still getting disconnection issues. :-( It seems that amazon is sending a disconnect message, but it does not make sense, because after I reset the device it stops from disconnect. It disconnects after what it seems to be a disconnection message. The log I have is this: [WS][0][handleWebsocketWaitFor] size: 2 cWsRXsize: 0 @handgear were you having this issue? |
I'm also not sure where that clientDisconnect code: 1000 coming from. when using latest paho library i get [WS][0][handleWebsocketWaitFor] size: 2 cWsRXsize: 0 |
@handgear I am still facing this problem. First connection last hours, but next ones just a couple of minutes. Do you had some progress on it? I am trying to see the websocket layer logs to see why the server is asking to close the connection. (following the suggestion from Links2004/arduinoWebSockets#294) Other idea is to change paho client to pubsubclient as I already mention to you. This would try to isolate the mqtt client from this bizarre behavior |
Hello,
Is there a way to get disconnect info when internet is off-line?
I'm trying to get connected status in loop by MQTT::Client->isConnected() and AWSWebSocketClient->connected().
In normal case it send & receive heartbeat(?) once a minute.
When the internet is off-line, after about 1min, it send below and never send it again.
(situation pretend sudden disconnection after normal state)
In this situation(off-line), MQTT::Client->isConnected() and AWSWebSocketClient->connected() are both true during loop.
It actually detects the disconnection after the internet recovered.
log after internet recovered:
in this point MQTT::Client->isConnected() == true, AWSWebSocketClient->connected() == false in loop
and after this, it init webSocket and connect MQTT
Is there a way to get disconnect info when internet is off-line?
I tried with latest eclipse/paho.mqtt.embedded-c (release vertion 1.1.0)
wonder this was my case(eclipse/paho.mqtt.embedded-c@5509124)
interestingly with this MQTTClient.h, MQTT::Client->isConnected() is false after MQTT connection.
So it reconnect session after every 1min.
The text was updated successfully, but these errors were encountered: