You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
^^ Note that username and password are not None. They are an empty string "".
Attempting to MQTT connect to 192.168.10.238
460.552: DEBUG - Attempting to establish MQTT connection...
460.556: INFO - Establishing an INSECURE connection to 192.168.10.238:1883
460.582: DEBUG - Sending CONNECT to broker...
460.583: DEBUG - Fixed Header: bytearray(b'\x10\x13\x00')
Variable Header: bytearray(b'\x04MQTT\x04\x02\x00<')
460.737: DEBUG - Receiving CONNACK packet from broker
FATAL! Unable to MQTT connect to 192.168.10.238: No data received from broker for 10 seconds.
on the mqtt server side, I observe the following:
1668979633: New connection from 192.168.10.245:62670 on port 1883.
1668979633: New client connected from 192.168.10.245:62670 as cpy22457 (p2, c1, k60).
1668979633: Client cpy22457 disconnected due to protocol error.
It turns out, the existing logic in the code that checks if username is provided is not consistent when
determining if such needs to be sent or not:
Connect needs to distinguish None from an empty string when
populating and sending CONNECT to the MQTT broker.
Fixesadafruit#129
Signed-off-by: Flavio Fernandes <flavio@flaviof.com>
I got in trouble with CONNECT in the following way:
^^ Note that username and password are not
None
. They are an empty string""
.on the mqtt server side, I observe the following:
It turns out, the existing logic in the code that checks if username is provided is not consistent when
determining if such needs to be sent or not:
Adafruit_CircuitPython_MiniMQTT/adafruit_minimqtt/adafruit_minimqtt.py
Line 485 in b707805
and then, a few lines below:
Adafruit_CircuitPython_MiniMQTT/adafruit_minimqtt/adafruit_minimqtt.py
Line 535 in b707805
in my case, this discrepancy caused the username/password
""
/""
to be sent without MQTT header (var_header[6]) properly accounting for it in linesAdafruit_CircuitPython_MiniMQTT/adafruit_minimqtt/adafruit_minimqtt.py
Lines 485 to 492 in b707805
ouch! ;)
The text was updated successfully, but these errors were encountered: