Telit Cinterion IoT Developer Community
MQTT(s) Demo using Embedded Processing SDK
Showcase, January 18, 2021 - 7:13am, 2507 views
MQTT is one of the most commonly used applicative protocols in the IOT Domain. With the attached example you will be able to connect to our MQTT broker over with or without SSL over IPv4 or IPv6. I have also shared the certificate required to authenticate the broker during the SSL process.
There is 3 settings to configure the attached project.
ENABLE_MQTT_WILL: MQTT WILL management is enabled (default setting)
ENABLE_SSL_MQTT: To use SSL to connect to MQTT Broker (default setting)
ENABLE_MQTT_IPV4: To select IPv4 MQTT Broker address (default setting),OR
ENABLE_MQTT_IPV6: To select IPv6 MQTT Broker address
Also, in order to try this example, you are required to load the certificates (in /certs folder in .pem format) in the module file system and change the APN name depending on your network provider as shown below:
static char apn = "m2minternet";
Once these changes are done you could try to connect to our MQTT Broker or the one hosted by you. In case you want to connect to your broker, please change the MQTT Broker IP address in the source code as well.
The code also uses the QAPI_NET_SSL_CA_LIST_E option to load the certificate in the module. Do take care that when you use certificate to connect to your broker, provide the entire certificate chain, from the root CA all the way to the penultimate certificate in the .pem format.
I hope to see that you can try this example and feel free to get in touch for any clarifications.