I have developed an application that does simple publish-subscrible messages with AWS IOT Core service. As per the requirement of AWS IoT SDK, I need to call aws_iot_mqtt_yield() frequently. Following is description of function aws_iot_mqtt_yield
Called to yield the current thread to the underlying MQTT client. This time is used by the MQTT client to manage PING requests to monitor the health of the TCP connection as well as periodically check the socket receive buffer for subscribe messages. Yield() must be called at a rate faster than the keepalive interval. It must also be called at a rate faster than the incoming message rate as this is the only way the client receives processing time to manage incoming messages. This is the outer function which does the validations and calls the internal yield above to perform the actual operation. It is also responsible for client state changes
I am calling this function at a period of 1 second. As it is sending PING on tcp connection, it creates too much internet data usage in long run when system is IDLE for most of the time.
My system works on LTE as well and paying more money for IDLE time is not acceptable for us.
I tried to extend period from 1 second to 30 seconds to limit our data usage but it adds 30 seconds latency in receiving messages from cloud.
My requirement is to achieve fast connectivity with low additional data usage in maintaining connection with AWS.