Skip to content

Commit 2fedb12

Browse files
author
brentru
committed
fixing connack payload issues caused by 0-value KeepAlive and incorrect length fixed header
1 parent 2cccc6b commit 2fedb12

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_minimqtt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
MQTT_SUB = b'\x82'
6565
MQTT_UNSUB = b'\xA2'
6666
MQTT_PUB = bytearray(b'\x30\0')
67-
MQTT_CON = bytearray(b'\x10\0\0')
67+
MQTT_CON = bytearray(b"\x10\x00\x00\x00")
6868
# Variable CONNECT header [MQTT 3.1.2]
6969
MQTT_CON_HEADER = bytearray(b"\x04MQTT\x04\x02\0\0")
7070
MQTT_DISCONNECT = b'\xe0\0'
@@ -138,7 +138,7 @@ def __init__(self, socket, broker, port=None, username=None,
138138
self._is_connected = False
139139
self._msg_size_lim = MQTT_MSG_SZ_LIM
140140
self.packet_id = 0
141-
self._keep_alive = 0
141+
self._keep_alive = 60
142142
self._pid = 0
143143
self._user_data = None
144144
self._subscribed_topics = []

0 commit comments

Comments
 (0)