256dpi / arduino-mqtt

MQTT library for Arduino
MIT License
1.02k stars 237 forks source link

Nano33IoT (MKR1010) BearSSL X509 Azure IoTHub: LWMQTT_PUBLISH_PACKET never received #290

Closed mikaelj closed 1 year ago

mikaelj commented 1 year ago

As topic suggests.

Connected to Microsoft Azure IOTHub, the high-level onMessage callback is never called.

Low-level debugging: lwmqtt_detect_packet_type() never reads a byte of type publish packet, except for directly after connection -- it then receives packet publish packet (2) of length 4, followed by a suback packet (9) of length 5, then just a bunch of pingresp packets (13) of length 2 (keepalive) as long the connection is up.

But never any publish packet when I publish a message to the subscribed topic (i.e. the device id).

Previously used ArduinoMQTT. It successfully received messages using the same connection parameters and wireless network, but I had to switch it out because it wouldn't reconnect to IOTHub after lost connection. So I know for a fact that messages are sent from IoTHub.

mikaelj commented 1 year ago

Invalid (wrong topic).