Gemalto is now part of the Thales Group, find out more.

You are here

How to do MQTT on EXS82 platform

Tutorial, December 27, 2019 - 3:39am, 145 views

  Because EXS82 doesn’t support JAVA like PLS62 and ELS61 series, we need to use AT command to achieve MQTT feature.

  • Environment setting:
  1. Ubuntu 18.04.03 for MQTT broker and client
  2. EXS82 CS2 FW:REVISION 00.038, A-REVISION 01.000.00 
  • Steps:

     Ubuntu:

      1. Install MQTT related update and

            "sudo apt install -y mosquito" (Install Mosquitto MQTT Broker)

            "sudo apt install -y mosquitto-clients" (Install Mosquitto Client)

      2. Make sure MQTT subscriber/publisher works

             mosquitto_sub -h IP -t Topic (Create a subscriber for specific Topic)

                  ex: "mosquitto_sub -h 60.250.82.33 -t test" means to wait for Topic as test message

             mosquitto_pub -h IP -t Topic -m Message (Create a publisher for specific Topic and send message)

                  ex: "mosquitto_pub -h 60.250.82.33 -t test -m 1234" means to send Topic as test and message is 1234 to the subscriber.

    Module (EXS82-W):

      AT command for publisher:

           AT+COPS?

           +COPS: 0,0,"Chunghwa Telecom",7

           at^SICA=0,1

           OK

           AT^SISS=1,srvType,"Mqtt"

           OK

           AT^SISS=1,conId,"1"

           OK

           AT^SISS=1,address,"mqtt://60.250.82.33"

           OK

           AT^SISS=1,cmd,"publish"

           OK

           AT^SISS=1,hcContLen,4

           OK

           AT^SISS=1,clientId,"1111"

           OK

           at^SISS=1,Topic, "test"

           OK

           at^SISS?

           ^SISS: 0,"srvType",""

           ^SISS: 1,"srvType","Mqtt"

           ^SISS: 1,"conId","1"

           ^SISS: 1,"address","mqtt://60.250.82.33"

           ^SISS: 1,"cmd","publish"

           ^SISS: 1,"hcContLen","4"

           ^SISS: 1,"clientid","1111"

           ^SISS: 1,"topic","test"

           ^SISS: 2,"srvType",""           

           at^sica=1,1

           OK

           AT^SISO=1

           OK

           ^SIS: 1,0,8800,"Mqtt connect 60.250.82.33:1883"

           ^SIS: 1,0,2500,"Connection accepted on clean session."

           at^SISW=1,4

           ^SISW: 1,4,0

           Result:

                      Module side: (After Sending at^SISW=1,4 command, type “abcd”)

                      Ubuntu side:

                             You can see the result like:

                                            mosquitto_sub -h 60.250.82.33 -t test

                                            abcd => Receive the message from publisher

leon.weng