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

You are here

AT Command MQTT client

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

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

The MQTT client is made possible via the Gemalto Java AT Command Extensions (JAT).

You can add new AT Commands to the ELS61 rel 1 "MR" / ELS61 rel 2 / PLS62-W rel 2 and EHSx rel 4 modules

No Java programming needed - drive everything just using AT Commands!

+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'/'Hello - from your friendly broker :)'

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

OK

at^sjmqtt="close"

OK

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

OK

^SYSSTART

MQTT Dashboard

1 - 10 of 19 Comments

Pages

Alopez's picture
Alopez

Really nice!!

thank you for the contribution

Regards

ALopez

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

Shaheen8911's picture
Shaheen8911

Hi

Great work!!

Can I use this example for ELS81-E?

Regards,

SS

Alopez's picture
Alopez

Hi,

Of Course

Regards

ALopez

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

JOSE's picture
JOSE

Thanks !!

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

Regards

J Sanchez

mullengers's picture
mullengers

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.

Shaheen8911's picture
Shaheen8911

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

mullengers's picture
mullengers

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). 

Shaheen8911's picture
Shaheen8911

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

mullengers's picture
mullengers

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.

Shaheen8911's picture
Shaheen8911

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 19 Comments

Pages

mullengers