Open superkartoffel opened 4 years ago
This is not just an issue with the connect() message - it is also implicit in subscribe(). It is particularly a problem when working with modern cloud-based MQTT brokers (eg MS Azure IoT Hub) where the connection credentials and topic names can be long, exceeding the implicit assumption of a 127 byte maximum
What does this implement/fix? Explain your changes.
This change fixes a bug in the mqtt.py CONNECT message implementation, where the connection would be reset by the broker right after your device has send the CONNECT message. The error is, that mqtt.py does implement the "Remaining Length" field correctly for values above 128.
Does this close any currently open issues?
130
Any other comments?
The publish packet seems to implement this field correctly. Anyway, I only found that out after fixing the bug myself, so feel free to reject or modify the PR.
Where has this been tested?
os.uname()
output:(sysname='esp32', nodename='esp32', release='1.12.0', version='v1.12-464-gcae77daf0-dirty on 2020-06-28', machine='ESP32 module with ESP32')