MQTT packet format for EMQ Broker running on Amazon servers

Dear Ravi,
I followed your tutorial
https://www.youtube.com/watch?v=Tp5EFG4W5WU
but I want to eliminate MQTT.fx software out of the system because I want to see the GPS data directly sent to MySQL database using MQTT protocol. Now, when I have looked around for how I can make the packets for MQTT. I am not sure what username and password should be used for creating my connect packet. I want to test it first using the Hercules software as you did in one of your videos. Can you help in what my packets would be like?

I will be highly obliged.

P.s. I have seen your video in which you explain what packets should be used for cloudmqtt but I need for the amazon servers.
Regards,
Usman Ashraf

Hi Usman,
Here are the packets those worked with emq.
WORKS FOR EMQ

CONNECT
102C00044D5154540402003C00206161633038303035666339633435343339306132363564643130396133643763
PUBLISH
3051000876616c6574726f6e7b227265736f75726365223a5b7b226c6174223a22313233222c226c6f6e223a22343536222c2274696d65223a6e756c6c2c226465766964223a2276616c747261636b227d5d7d

You can always use Wireshark to see the packet details when sending from any MQTT client softwares.

The major changes would be to remove authentication because in my demo i did not enable authentication on EMQ. So you need to remove username and password fields and change the flags in connect packet to tell the broker that username and password are not present.
The protocol name will be MQTT instead of MQIsdp (for cloudmqtt).

Thanks so much @RaviPujar.

1 Like