Version latest

7 MQTT use cases

  • The MQTT client in NORA-W36 uses version MQTT v3.1.1
  • For more about the Message Queuing Telemetry Transport (MQTT), see the MQTT beginner’s guide
  • The TLS implementation in NORA-W36 supports only version 1.2

7.1 MQTT client without TLS - Mosquitto

mqtt
This use case connects NORA-W36 as a Wi-Fi Station and a MQTT Broker on port 1883. In this scenario, the module connects to Mosquitto without a certificate.
Parameters and values
  • Host: test.mosquitto.org
  • Port: 1883 (no TLS connection)
  • Client ID: -
  • Username: -
  • Password: -
  • CA Root certificate: -
  • Client certificate: -
  • Client private key: -
Before connecting to MQTT, set up Wi-Fi Connection, as described in Wi-Fi station, steps 1-5.
Nr
Instructions
AT command
AT event
1
Configure MQTT host and port
AT+UMQCP=0,"test.mosquitto.org",1883
2
Connect to MQTT broker
AT+UMQC=0
+UEMQC:0
3
Publish Message on topic pubtopic
AT+UMQP=0,0,0,"pubtopic","HelllofromNORA-W36"
4
Subscribe on topic subtopic
AT+UMQS=0,0,"subtopic"
5
Post a Message to the MQTT Broker on subtopic the message should be Hello from remote device
-
-
6
Receive Message on subtopic
+UEMQD:0,24
7
Read String Message
AT+UMQRS=0
+UMQRS:0,0,"subtopic",24,"Hellofromremotedevice"
8
Disconnect from MQTT broker
AT+UMQDC=0
Note: Use the wildcard “*” to receive messages for all topics. Note that this option may not be supported by all brokers, like Azure.

7.2 MQTT TLS client - Mosquitto

mqtt
mqtt
This use case connects NORA-W36 as a Wi-Fi Station and a MQTT Broker. In this scenario, the module connects to Mosquitto using certificates.
To generate client certificate and clinet key, follow the procedures described on the Mosquitto web page: https://test.mosquitto.org/ssl/
Parameters and values
  • Host: test.mosquitto.org
  • Port: 8884 (TLS)
  • Client ID: -
  • Username: -
  • Password: -
  • CA Root certificate: mosquitto.org.crt
  • Client certificate: client.crt
  • Client private key: client.key
Note: The parameters given in this scenario use the port 8884 for connections and encryption for security.
To authenticate the client and ensure the following:
  • Only authorized devices can establish a connection with the MQTT broker
  • Clients provide a valid certificate when making a connection
  • 1883 : MQTT, unencrypted, unauthenticated
  • 1884 : MQTT, unencrypted, authenticated
  • 8883 : MQTT, encrypted, unauthenticated
  • 8884 : MQTT, encrypted, client certificate required (used in this example)
  • 8885 : MQTT, encrypted, authenticated
  • 8886 : MQTT, encrypted, unauthenticated
Before connecting to MQTT, set up a Wi-Fi Connection like that described in Wi-Fi station, steps 1-5.
Nr
Instructions
AT command
AT event
1
Configure MQTT host and port
AT+UMQCP=0,"test.mosquitto.org",8884
2
Write a X.509 certificate and private key using Binary data
AT+USECUB=0,"mosquitto.org.crt"{sendbinarycontentof"mosquitto.org.crt"]
AT+USECUB=1,"client.crt"{sendbinarycontentof"client.crt"}
AT+USECUB=2,"client.key"{sendbinarycontentof"client.key"}
See Binary data for more information, note that the brackets { and } should NOT be sent, they are just here in this example.
3
Setup TLS connection config
AT+UMQTLS=0,1,"mosquitto.org.crt","client.crt","client.key"
4
Connect to MQTT broker
AT+UMQC=0
+UEMQC:0
5
Publish Message on topic pubtopic
AT+UMQP=0,0,0,"pubtopic","HelllofromNORA-W36"
6
Subscribe on topic subtopic
AT+UMQS=0,0,"subtopic"
7
Post a Message to the MQTT Broker on subtopic. The message should say Hello from remote device
-
-
8
Receive Message on subtopic
+UEMQD:0,24
9
Read String Message
AT+UMQRS=0
+UMQRS:0,0,"subtopic",24,"Hellofromremotedevice"
10
Disconnect from MQTT broker
AT+UMQDC=0

7.3 MQTT TLS client - Thingstream

mqtt
mqtt
Thingstream is the u-blox service delivery platform for:
  • IoT Communication-as-a-Service
  • IoT Location-as-a-Service
This use case connects NORA-W36 as a Wi-Fi Station and a MQTT Broker. In this scenario NORA-W36 connects to Thingstream using a CA Root certificate, Client-ID, Username and Password.
Thingstream uses the AWS Root Certificate found here: https://www.amazontrust.com/repository/AmazonRootCA1.pem
Before connecting to MQTT, set up Wi-Fi Connection, like that described Wi-Fi station, steps 1-5. The parameters and values necessary for the the use case include:
Parameters and values
  • Host: mqtt.thingstream.io
  • Port: 8883 (TLS)
  • Client ID: device:78e3d356-876f-483b-872f-3485853fAAAA
  • Username: HMVK8C09FQP245O2BBBB
  • Password: ofYyBB/L3GkPvo060J6Dv+t+mfrh0XpGMcf7CCCC
  • CA Root certificate: AmazonRootCA1.pem
  • Client certificate: -
  • Client private key: -
Before connecting to MQTT, set up Wi-Fi Connection like in steps 1-5 in Wi-Fi station
Nr
Instructions
AT command
AT event
1
Configure the MQTT host, port, client-ID, username and passsword
AT+UMQCP=0,"mqtt.thingstream.io",8883,device:78e3d356-876f-483b-872f-3485853fAAAA,HMVK8C09FQP245O2BBBB,ofYyBB/L3GkPvo060J6Dv+t+mfrh0XpGMcf7CCCC
+UEMQC:0
2
Write a X.509 CA Root certificate using Binary data
AT+USECUB=0,"AmazonRootCA1.pem"{sendbinarycontentof"AmazonRootCA1.pem"}
See Binary data for more information, note that the brackets { and } should NOT be sent, they are just here in this example
3
Set up TLS connection config. Thingstream doesn´t use a client certificate or key - only the root CA.
AT+UMQTLS=0,1,"AmazonRootCA1.pem"
4
Connect to MQTT broker
AT+UMQC=0
+UEMQC:0
5
Publish a message on pubtopic
AT+UMQP=0,0,0,"pubtopic","HelllofromNORA-W36"
6
Subscribe on topic subtopic
AT+UMQS=0,0,"subtopic"
7
Post a message to the MQTT broker on subtopic. The message should say Hello from remote device
-
-
8
Receive a message on subtopic
+UEMQD:0,24
9
Read String Message
AT+UMQRS=0
+UMQRS:0,0,"subtopic",24,"Hellofromremotedevice"
10
Disconnect from MQTT broker
AT+UMQDC=0

7.4 MQTT TLS client - AWS IoT Core

mqtt
Connect as a Wi-Fi Station and a MQTT Broker. In this scenario, NORA-W36 connects to Amazon AWS IoT Core using certificates.
Parameters and values
  • Host: a3loryode2aaaa-ats.iot.us-east-2.amazonaws.com
  • Port: 8883 (TLS)
  • Client ID: -
  • Username: -
  • Password: -
  • CA Root certificate: AmazonRootCA1.pem
  • Client certificate: aws_client.crt
  • Client private key: aws_priv_key.key
Before connecting to MQTT, set up Wi-Fi Connection like in steps 1-5 in Wi-Fi station
Nr
Instructions
AT command
AT event
1
Configure MQTT host and port
AT+UMQCP=0,"a3loryode2aaaa-ats.iot.us-east-2.amazonaws.com",8883
2
Write a X.509 certificate and private key using Binary data
AT+USECUB=0,"AmazonRootCA1.pem"{sendbinarycontentof"AmazonRootCA1.pem"}
AT+USECUB=1,"aws_client.crt"{sendbinarycontentof"aws_client.crt"}
AT+USECUB=2,"aws_priv_key.key"{sendbinarycontentof"aws_priv_key.key"}
See Binary data for more information, note that the brackets { and } should NOT be sent, they are just here in this example
3
Setup TLS connection config
AT+UMQTLS=0,1,"AmazonRootCA1.pem","aws_client.crt","aws_priv_key.key"
4
Connect to MQTT broker
AT+UMQC=0
+UEMQC:0
5
Publish Message on topic pubtopic
AT+UMQP=0,0,0,"pubtopic","HelllofromNORA-W36"
6
Subscribe on topic subtopic
AT+UMQS=0,0,"subtopic"
7
Post a Message to the MQTT Broker on subtopic the message should be Hello from remote device
-
-
8
Receive Message on subtopic
+UEMQD:0,24
9
Read String Message
AT+UMQRS=0
+UMQRS:0,0,"subtopic",24,"Hellofromremotedevice"
10
Disconnect from MQTT broker
AT+UMQDC=0

7.5 MQTT TLS client - Azure IoT Hub

Connect as a Wi-Fi Station and an Access Point and a MQTT Broker. In this scenario, NORA-W36 connects to Microsoft Azure using certificates.
mqtt
Note that Azure IoT Hub isn’t a full-featured MQTT broker and doesn’t support all the behaviors specified in the MQTT v3.1.1 standard
Parameters and values
  • Host: iothub-test-sw.azure-devices
  • Port: 8883 (TLS)
  • Client ID: device1
  • Username: iothub-test-sw.azure-devices.net/device1/
  • Password: -
  • CA Root certificate: AzureCa.pem
  • Client certificate: azure_client.crt
  • Client private key: azure_priv_key.key
Before connecting to MQTT, set up Wi-Fi Connection like in steps 1-5 in Wi-Fi station
Nr
Instructions
AT command
AT event
1
Configure MQTT Host, Port, Cient and Usename
AT+UMQCP=0,"iothub-test-sw.azure-devices.net",8883,device1,iothub-test-sw.azure-devices.net/device1
2
Write a X.509 certificate and private key using Binary data
AT+USECUB=0,"AzureCa.pem"{databinarycontentof"AzureCa.pem"}
AT+USECUB=1,"azure_client.crt"{databinarycontentof"azure_client.crt"}
AT+USECUB=2,"azure_priv_key.key"{databinarycontentof"azure_priv_key.key"}
See Binary data for more information, note that the brackets { and } should NOT be sent, they are just here in this example
3
Setup TLS connection config
AT+UMQTLS=0,1,"AzureCa.pem","azure_client.crt","azure_priv_key.key"
4
Connect to MQTT broker
AT+UMQC=0
+UEMQC:0
5
Publish Message on topic pubtopic
AT+UMQP=0,0,0,"pubtopic","HelllofromNORA-W36"
6
Subscribe on topic subtopic
AT+UMQS=0,0,"subtopic"
7
Post a Message to the MQTT Broker on subtopic the message should be Hello from remote device
-
-
8
Receive Message on subtopic
+UEMQD:0,24
9
Read String Message
AT+UMQRS=0
+UMQRS:0,0,"subtopic",24,"Hellofromremotedevice"
10
Disconnect from MQTT broker
AT+UMQDC=0

Last updated: 25 August 2025
Need help?Contact Support
Questions?Contact us