Our product uses QAPI to publish the sensor data using MQTT to AWS.
What we observe is that some of the data being sent multiple times (2-3) withing the reasonable timeout (5 sec) without any problem with the connectivity.
All the data s being published to AWS with QOS=1 using the
qapi_Net_MQTT_Publish_Get_Msg_Id call, where we wait for the PUBACK with the message ID returned from this call. Even though all data is published like this, only some messages gets resent to the broker. As a result, this retransmission causes higher battery consumption.
What we would like to understand is:
- How is this behavior configured/controlled? Where the timeout after which the message is resent is defined? There is no
publish_timeoutfield in the
qapi_Net_MQTT_Config_tstructure, yet there is a
connack_timed_out_sec. Are they related or identical?
- This behaviour is seen more often when the modem is completely powered off (cut from power) and brought back on before the transmissions. Is there perhaps a HW configuration bit that might affect the MQTT resend functionality somehow?
Thanks in advance for any ideas.
EDIT: this question is similar to the one in [BG95] Causes of retry for MQTT publish messages, but since the time to ACK by broker is definitiely too short, seems that the modem sends duplicate data unnecessarily.