MQTT over TCP - packet error - ARM controller, Quectel Modem, Losant broker


#1

Hello,
So I have been trying to send MQTT packets to the Losant broker using the GSM Quectel M66 modem. But I have been unable to do so.

The TCP connection is established without any trouble, but when I try to create and send the connect packet, I get SEND OK and then no response from the server. To prepare the Hex format I am using DockLight
Similarly tried a connect packet to cloudmqtt and that doesn’t work either.

This is the Hex packet I constructed
10 8C 00 04 4D 51 54 54 03 C2 00 2C 00 18 35 61 37 61 30 66 66 65 63 38 34 37 36 39 30 30 30 36 32 64 61 63 30 63 00 24 32 34 37 65 64 30 63 61 2D 35 39 62 38 2D 34 30 36 65 2D 38 30 63 34 2D 34 33 66 62 38 66 34 39 63 64 31 66 00 40 37 38 32 36 32 38 37 65 32 34 66 63 33 37 36 65 38 39 30 63 30 33 63 61 34 31 65 37 66 63 63 64 33 66 32 37 39 36 65 36 62 64 30 61 64 65 31 64 62 64 63 63 65 66 37 31 30 30 61 62 37 64 66 65

In bold is the client id length (00 18), client id, user id length (00 24), user id, and password length (00 40), password

Been referring to Geir’s issue, which is similar to mine, but haven’t been able to resolve it yet. In his case it was something to do with Adafruit library, but that can’t be the issue in my case, since its C code running on an ARM controller, no special libraries involved. Any clues here would be helpful…

Thanks
Craig


#2

What I might recommend is running a broker yourself for better debug logging. There are several options available based on your language of choice:

  1. Node.js - Mosca
  2. Python - Mosquitto

You can then attempt to connect to your own broker to get additional logging and debugging information as to why the connection does not succeed.