Open arslan437 opened 1 year ago
Hi @arslan437
MQTT_ProcessLoop
and receiveSingleIteration
would essentially manage keep-alive at MQTT layer.
It would send MQTT Ping request every keepAliveSeconds
(set to MQTT_KEEP_ALIVE_INTERVAL_SECONDS in the application) and waits for CONFIG_MQTT_PINGRESP_TIMEOUT_MS
for the response.
If the response isn't received within the set time,MQTT_ProcessLoop
would return error.
Is the library have a dedicated function for that ?
Lets say internet is limited or for some reason esp32 can access the internet.
How can I check if library is still connected with the aws?
Warming this up as is extremely vital for many, including our, application, too - and nothing moved since start of 2023 on such crucial aspect. At the moment it seems it is virtually impossible to realise that network (at any layer) has gone away and handle disconnect/reconnect when MQTT session has to be alive "permanently" - instead of creating connection then demolishing everything as examples do. Even if one propagates up the MQTT status from e.g. publish to topic calls, it is rather opaque - some status codes like receive failed don't say much about underlying reason - therefore, one might try re-establishing MQTT session from transport link upward... but... how.
here is my code snippet.
How can I check if the device is still connected to aws or not.