AWSIoTMQTTClient keepalive interval?
-
I've just gotten my FiPy to connect to AWS IoT via TLS and MQTT. In monitoring the device it is sending a little over 200 bytes to AWS every 20 seconds. I see Packet sent. (Length: 2) at 20 second intervals. While this might be fine over WiFi it will nearly use up my 1MB LTE Cat M1 data plan after one day just with these keepalive packets. How do I reduce the keepalive interval with the built-in AWSIotMQTTClient? There is no way I can deploy on LTE with this much data being transmitted. This doesn't even include any of my actual MQTT messages! Just the keepalives.
-
@reidfo Sure looks like it. Change line 294, see if you get a different behavior.
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349238
-
@cmisztur That does take a parameter, in connect() called keepAliveIntervalSecond, but when I set it it seems to be ignored. Keepalive packets are still being sent every 20 seconds. Following the code, AWSIotMQTTClient.connect() ends up calling MQTTClient._send_connect() and is passed the keepalive parameter, but it does nothing with it.
-
@reidfo looks like simple.py constructor takes a keepalive
def __init__(self, client_id, server, port=0, user=None, password=None, keepalive=0, ssl=False, ssl_params={}):
oh I wasn't aware of AWSIotMQTTClient... maybe this: