#Having a hard time getting my QTPy S3 to

1 messages · Page 1 of 1 (latest)

woven perch
#
1553.845: DEBUG - Attempting to establish MQTT connection...
1553.846: INFO - Establishing an INSECURE connection to hautomation.azure-devices.net:8883
1554.040: DEBUG - Sending CONNECT to broker...
1554.041: DEBUG - Fixed Header: bytearray(b'\x10\x84\x02\x00')
1554.042: DEBUG - Variable Header: bytearray(b'\x04MQTT\x04\xc2\x00x')
1554.046: DEBUG - Receiving CONNACK packet from broker
1564.081: INFO - MMQT error: No data received from broker for 10 seconds.
1564.083: DEBUG - Reconnect timeout computed to 2.00
1564.083: DEBUG - adding jitter 0.65 to 2.00 seconds
1564.085: DEBUG - Attempting to connect to MQTT broker (attempt #1)
1564.086: DEBUG - Attempting to establish MQTT connection...
1564.087: DEBUG - Sleeping for 2.65 seconds due to connect back-off
1566.736: INFO - Establishing an INSECURE connection to hautomation.azure-devices.net:8883
1567.006: DEBUG - Sending CONNECT to broker...
1567.008: DEBUG - Fixed Header: bytearray(b'\x10\x84\x02\x00')
1567.010: DEBUG - Variable Header: bytearray(b'\x04MQTT\x04\xc2\x00x')
1567.013: DEBUG - Receiving CONNACK packet from broker``` is output when I attach a logger to the device. it just hangs after sending the connect to the broker
silver remnant
#

I guessed the api changed, needs TLS or something, checking bard seems true:
The port is different etc, and the change came in Feb this year.

woven perch
#

That explains it

#

I guess I'll see about changing the params and seeing how far that gets me

woven perch
#
499.814: DEBUG - Sending CONNECT to broker...
499.816: DEBUG - Fixed Header: bytearray(b'\x10\xfe\x01\x00')
499.818: DEBUG - Variable Header: bytearray(b'\x04MQTT\x04\xc2\x00x')
499.826: DEBUG - Receiving CONNACK packet from broker
499.850: DEBUG - Got message type: 0x48
499.853: DEBUG - Got message type: 0x54
499.855: DEBUG - Got message type: 0x54
499.857: DEBUG - Got message type: 0x50
499.860: DEBUG - Got message type: 0x2f
499.863: INFO - MMQT error: Topic length 12576 in PUBLISH packet exceeds remaining length 46 - 2```
#

That's after updating to have the MQTT library use TLS on 443, per bards suggestion lel

silver remnant
#

I get that from adafruit when I've done something bad, cant remember what caused it, but for a start check your topic length and what's initially happening on connect?

woven perch
#

well, this is azure IOT. i have no idea how to specify the topic, it's not part of the example code and the issues i'm having are all during connecting to the broker

silver remnant
woven perch
#

I created the issue on GH 😛 the root cause is that it's a hard-coded port int he library, and IOT Hub stopped supporting the port, forcing TLS traffic only. Just changing the port isn't enough though, there's other work that needs to be done to resolve the issue