However, I've noticed that after about 11 hours, the application is losing connection with AWS IoT server. So I've set up some devices to understand this behaviour better.
First what I found out that each of 6 device loose this connection after approximately 11-12 h
Code: Select all
id avr time between disconnect (s)
GA97DF0001 42086.690
GA97DF0002 42599.138
GA97DF0003 41970.993
GA97DF0004 39538.257
GA97DF0005 39316.676
GA97DF0006 39731.619
42000s = 11.6h
Device with id 1-3 are connected to different wifi router and network than devices 4-6,
Also similar frequency I've noticed based on database records in another location, so at this point I kind of excluded router settings or wifi network configuration as potential reason.
This mean that is time to capture some logs from device:
Code: Select all
2024-07-21 22:03:02 E (38279117) coreMQTT: sendMessageVector: Unable to send packet: Network Error.
E (38279127) coreMQTT: MQTT PUBLISH failed with status MQTTSendFailed.
E (38279127) coreMQTT: MQTT operation failed with status MQTTSendFailed
I (38279177) supervisor: coreMQTT-Agent disconnected. Preventing coreMQTT-Agent commands from being enqueued.
I (38279147) gate_control: Task "GateReport" sending publish request to coreMQTT-Agent with message "{"openReceived": 0,"gateSensors":{ "IN1": 0, "IN2": 0},"keyboard":{ "new_key": 0, "key": ""}, "iteration": 4141}" on topic "/gates/GA97DF0004" with ID 12438.
I (38279187) ota_over_mqtt: coreMQTT-Agent disconnected. Suspending OTA agent.
I (38279227) core_mqtt_agent_manager: coreMQTT-Agent disconnected.
E (38279307) esp-tls-mbedtls: mbedtls_ssl_setup returned -0x7F00
E (38279317) esp-tls: create_ssl_handle failed
E (38279317) esp-tls: Failed to open new connection
2024-07-21 22:03:03 I (38279627) core_mqtt_agent_manager: Retry attempt 1.
2024-07-21 22:03:03 E (38279767) esp-tls-mbedtls: mbedtls_ssl_setup returned -0x7F00
E (38279777) esp-tls: create_ssl_handle failed
E (38279777) esp-tls: Failed to open new connection
2024-07-21 22:03:03 I (38280227) core_mqtt_agent_manager: Retry attempt 2.
2024-07-21 22:03:04 E (38280387) esp-tls-mbedtls: mbedtls_ssl_setup returned -0x7F00
E (38280387) esp-tls: create_ssl_handle failed
E (38280387) esp-tls: Failed to open new connection
2024-07-21 22:03:05 I (38281867) core_mqtt_agent_manager: Retry attempt 3.
[...]