Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

fix implementation of connect header to allow header sized above 128 bytes #131

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

superkartoffel
Copy link

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?

  • ESP32 DSTIKE
  • 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')

@CLAassistant
Copy link

CLAassistant commented Mar 11, 2021

CLA assistant check
All committers have signed the CLA.

@stevegoobermanhill
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants