Now I try to connect MQTT client to my clock project. I have found that Espruino MQTT module does not work, because its onConnect() function is called twice when it is connected to server. I have just added workaround into the function and everything is working.
Is it a bug in net module in the version or something else?
I can add my code here, of course, but I think it is trivial - I just call require() and then connect().
Workaround in first line of onConnect() is to check if #onend is already registered in socket and return if it is.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Now I try to connect MQTT client to my clock project. I have found that Espruino MQTT module does not work, because its onConnect() function is called twice when it is connected to server. I have just added workaround into the function and everything is working.
Is it a bug in net module in the version or something else?
I can add my code here, of course, but I think it is trivial - I just call require() and then connect().
Workaround in first line of onConnect() is to check if #onend is already registered in socket and return if it is.