Thales' cellular IoT products business is now part of Telit Cinterion, find out more.

You are here

Telit Cinterion IoT Developer Community

AT Command MQTT client

Showcase, January 22, 2019 - 4:37pm, 34323 views

This project allows you to use our, more recent, Java modules as simple MQTT clients.
Just use AT Commands - no Java programming needed.

The MQTT client is made possible via the Thales IoT Java AT Command Extensions (JAT).
Both Plain text :1883 and TLS 1.2 secure sockets :8883 Broker connections can be used (even AWS).

You can add new AT Commands to the ELS61 rel 1 "MR" / ELS61 rel 2 / PLS62-W rel 2 and EHSx rel 4 modules. URCs are generated showing broker connections, loss, and reconnections.

Publishing JSON formatted strings is supported, see the attached documentation for the syntax needed.

Publishing HEX formatted binary byte[] strings is supported, see the attached documentation for the syntax needed.

 

+PBREADY

 

at^sjam=1,"a:/ATSJMQTT.jad",""

OK

^SYSSTART_EXTENDED_AT

 

at^sjmqtt="tcp://broker.hivemq.com:1883","","","ATSJMQTTDemo","ATSJMQTTDemoListener","bearer_type=gprs;access_point=internet;username=;password=;timeout=30"

OK

 

at^sjmqtt="open"

OK

^SJMQTT: 'ATSJMQTTDemoListener'/****** - from your friendly broker :)'

 

at^sjmqtt="pub","The module says a big MQTT client Hello back to the broker"

OK

at^sjmqtt="pub","{'JSON style temperature': '35 degrees C'}"

OK

at^sjmqtt="close"

OK

 

at^sjam=2,"a:/ATSJMQTT.jad",""

OK

^SYSSTART

MQTT Dashboard

 

Netbeans 7.2 offline install: https://iot-developer.thalesgroup.com/tutorial/netbeans-72-offline-insta...

See other related articles:

https://iot-developer.thalesgroup.com/tutorial/data-transfer-methods-mqt...

https://iot-developer.thalesgroup.com/tutorial/flash-file-system-access-...
https://iot-developer.thalesgroup.com/tutorial/flash-file-system-access-...

1 - 10 of 27 Comments

Pages

Really nice!!

thank you for the contribution

Regards

ALopez

Somewhere over the rainbow!!! Looking for the Oz Land!!!

Hi

Great work!!

Can I use this example for ELS81-E?

Regards,

SS

Hi,

Of Course

Regards

ALopez

Somewhere over the rainbow!!! Looking for the Oz Land!!!

Thanks !!

This little piece of code is going to make many people happy. Looking forward to testing it.

Regards

J Sanchez

A good (3rd party) MQTT client for an iPhone :

MQTTool by Brent Petit
https://itunes.apple.com/gb/app/mqttool/id1085976398?mt=8

This is not supported by Gemalto but works nicely.

Hi

I have used the above example to connect to the AWS IOT and I am successfully connected and can see data on channel but I have to add IMEI number after the topic name.

Ex: at^sjmqtt="PUB","test data","test" 

> > it comes to topic "test/004401082448966" where the number is IMEI number of my module. 

Now I want to update and read the shadow content.

So i tried this:

at^sjmqtt="PUB","{  \"state\": {\"desired\": {\"device\":{\"status\": \"request\"}}}} ","$aws/things/001WV7PRTOZA/shadow/update".

But nothing changed there.

Kindly help.

Regards,

SS

Hi,

Thank you for trying the demo :)

I have rebuilt it to remove the automatic adding of ClientID after the Publication Topic Name.

now: at^sjmqtt="PUB","test data","test" 

> will come to topic "test" without any "/ClientID" appended (which by default is the module's IMEI number). 

Hi

Thanks for the modification.

I have downloaded the above "dist zip".

Uninstall the old ATSJMQTT.jad file then remove the same file from the flash of the module.

del midlt

then

del4mflash

Upload .jar and .jad file then install it.

install_new

then connect to AWS IOT and try to publish to the channel "test" but again get data on "test/004401082449469" instead of "test".

at^sjmqtt="pub","{ \"name\":\"gemalto\" }","test"<CR>

sameData

Kindly look into this issue.

Regards,

SS

Hi,

The reposne of your AT^SJAM=4 command shows a too long JAR file size (322,322 bytes is the older version).

Please try to download the dist.zip once more from the Developer Zone. Check to contents of the ZIP file:

ATSJMQTT.jad 212 bytes dated 15/02/2019 at 12:36
ATSJMQTT.jar 320,199 bytes dated 15/02/2019 at 12:36

Modify the .JAD file to add any parameters that you need such as Broker and Connection info. See the PDF file for details.

Copy the JAD and JAR to the module's A:/ drive, using our "MES" or any other method you like.

The issue these commands only:

AT^SJAM=2,"a:/ATSJMQTT.jad",""

AT^SJAM=0,"a:/ATSJMQTT.jad",""

AT^SJAM=1,"a:/ATSJMQTT.jad",""

See if that helps.

Hi

I have checked that new .jar file and its 320,199 bytes.

But as you said I tried once again and downloaded the zip file from above and repeat the steps.

The output remains same.

I have not edited .jad file as broker configuration is done using AT commands and its working fine except publishing to the "channel/imei".

regards,

SS

1 - 10 of 27 Comments

Pages

Author

mullengers's picture
mullengers