Achieving Reliable MQTT Connection #685
Replies: 8 comments
-
Posted at 2017-01-19 by navas This is the console output of my server when the client is trying to reconnect. Any ideas ?
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-19 by navas OK, I think I figured the problem a) When it disconnects from the server it throws "disconnected" event twice. Can it be fixed ? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-19 by @gfwilliams Strange - but yes, the code's here: https://github.com/espruino/EspruinoDocs/blob/master/modules/MQTT.js If you wanted to create a pull request that fixed it it'd be great! I'm not sure, but it might also be worth reconnecting after a timeout, rather than straight away? It might help... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-19 by Ollie I think that's the tinyMQTT module rather than the core MQTT module. It's not behaviour I've seen but but I haven't used it in a long while TBH. A fix/pull request welcome though. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-20 by navas I haven't figured out any fixes yet. I saw the previous post by @ollie and requested his code, if he can help. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-20 by Ollie See other thread I responded on. If you're using tinyMQTT from here : https://github.com/olliephillips/tinyMQTT, that's all I have :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-23 by @gfwilliams Also, you could try the non-tinyMQTT module and see if that helps? I know I recently fixed the double-disconnect issue there. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-02-11 by navas Hey @gordon, Sorry for the delayed response. I was away for a business trip... https://github.com/olliephillips/tinyMQTT this one works pretty well so far since these guys fixed the "double" reconnect and enabled the "keepalive" functionality. I will test with the official MQTT and will report it back when I get time. thanks |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-01-19 by navas
Is there anyone who can help me achieving reliable MQTT connection? I cannot reconnect to the MQTT server after it disconnects for some reason. I tried with two different MQTT server and results are same. Connecting back to the MQTT server on disconnected event does not work.
Beta Was this translation helpful? Give feedback.
All reactions