hirotakaster / MQTT-TLS

Other
61 stars 30 forks source link

OTA Firmware updates blocked #14

Open CameronTurner opened 6 years ago

CameronTurner commented 6 years ago

When using the default 15 second keep alive, the firmware updates appear to be blocked from completing an over the air (OTA) update.

Can we avoid this from occurring, regardless of the keep alive duration?

It appears it can be fixed by running client.disconnect() before running an OTA, however- it would be ideal to fix this rather than use a work around that is unreliable.

hirotakaster commented 6 years ago

this issue is related with #13 ? if you have a something about the OTA, you should be better research about the OTA firmware source code.

gitjoost commented 6 years ago

I realize this issue is old but in case you are still looking for a solution, you might want to consider dismissing the mqtt-tls component when an OTA update comes in. To get an OTA update callback, set the callback function somewhere in your setup() code:

System.on(firmware_update, onFirmwareUpdate);

Then in the callback: void onFirmwareUpdate() { mqttClient().~MQTT() // created with MQTT mqttClient(SeRVER, PORT, KEEPALIVE, dispatch); }

hope this helps.

hirotakaster commented 6 years ago

hi @gitjoost that's nice idea.