Skip to content

Fix CONNACK IndexError #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2019
Merged

Fix CONNACK IndexError #5

merged 1 commit into from
Aug 16, 2019

Conversation

brentru
Copy link
Member

@brentru brentru commented Aug 16, 2019

rc reads 3 bytes, not 4. The 3rd byte is the error code, referenced by CONNACK_ERRORS

Pre-PR:

b'\x02\x00\x05'
Traceback (most recent call last):
  File "code.py", line 121, in <module>
  File "/lib/adafruit_iotcore/adafruit_iotcore.py", line 121, in connect
  File "/lib/adafruit_minimqtt.py", line 284, in connect
IndexError: bytes index out of range

Post-PR:

4132.02: DEBUG - Receiving CONNACK packet from broker
b'\x02\x00\x05'
Traceback (most recent call last):
  File "code.py", line 121, in <module>
  File "/lib/adafruit_iotcore/adafruit_iotcore.py", line 121, in connect
  File "/lib/adafruit_minimqtt.py", line 284, in connect
MMQTTException: Connection Refused - Unauthorized

@brentru brentru added the bug Something isn't working label Aug 16, 2019
@brentru brentru requested a review from a team August 16, 2019 17:15
@brentru brentru merged commit 25b344a into adafruit:master Aug 16, 2019
@brentru brentru deleted the fix-connack-exception branch August 16, 2019 17:18
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 16, 2019
rtwfroody pushed a commit to rtwfroody/Adafruit_CircuitPython_MiniMQTT that referenced this pull request Sep 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants