Introduction: Secure MQTT With QUECTEL EC25 Guide on ESP32 Based NORVI GSM Series
NORVI devices are durable industrial controllers built for IoT applications. By integrating the Quectel EC25 module with SSL configurations, these devices can utilize cellular connectivity to securely communicate with cloud platforms via the MQTT protocol.
This guide offers detailed instructions for using NORVI GSM series devices alongside the Quectel EC25 module to establish a secure SSL connection with an MQTT broker using AT commands. The Quectel EC25, a widely used LTE module in IoT, enables cellular communication. The guide covers the required setup, code details, and key AT commands.
Supplies
MQTT Protocol -Click here
SSL MQTT Communication
SSL (Secure Sockets Layer) is a widely used security protocol for creating an encrypted connection between a client and a server. In MQTT communication, SSL ensures that the data transmitted between the device and the MQTT broker is encrypted, safeguarding confidentiality and maintaining data integrity.
Configuring SSL on NORVI GSM series EC25 Devices #
To establish an SSL-encrypted MQTT connection with the NORVI GSM series EC25 device, follow these steps,
- Ensure the SIM card is correctly inserted into the NORVI GSM series EC25 device.
- Connect the device to a power source and power it on.
- Open the serial monitor on your development environment to interact with the device.
- Configure the Quectel EC25 module to use SSL for MQTT communication. This involves sending specific AT commands to the module.
- Ensure your device and broker certificates are up-to-date to maintain a secure connection.
Setting Up Norvi EC25 to MQTT SSL
Key Features
- Industrial-grade design: Suitable for harsh environments.
- Versatile I/O options: Digital and analog inputs/outputs for various sensors and actuators.
- Cellular connectivity: LTE support via the Quectel EC25 module for remote monitoring and control.
- SSL/TLS security: Secure data transmission using SSL/TLS over MQTT.
Prerequisites
- NORVI GSM series Device with an integrated Quectel EC25 module
- MQTT broker details (hostname, port, username, password)
- MQTT.fx software for testing and monitoring
- Arduino IDE and necessary libraries for programming the NORVI GSM series device.
- Data visualization platform (e.g., DATACAKE)
- SSL Certificates: ( CA certificate, client certificate, and client key).
Libraries
- Arduino.h
- Wire.h
- WiFi.h
- ArduinoJson.h
- Datacake.h
- Secret.h: This file should contain the MQTT username and password,
SSL Certificate Setup to establish an SSL-encrypted connection, include the SSL certificates in the code.
- Root CA Certificate: The certificate authority that issued the broker’s certificate.
- Client Certificate: Your device’s certificate.
- Client Key: The private key corresponding to the client certificate.
Hardware setup
Pin Connections
- MODEM_TX (TX Pin)
- MODEM_RX (RX Pin)
- GSM_RESET (Reset Pin)
- Digital Input Pins (D0, D1, D2, D3)
- Relay Output Pin (R0)
Step 1: Test Program
Click here to get the code github - EC25_Connecting_to_Datacake_with_MQTT_Broker_TLS_secured
This code is designed for an ESP32-powered NORVI GSM series device connected to a Quectel EC25 module over UART. It establishes a secure MQTT connection with SSL, subscribes to a topic for controlling a relay output, and regularly publishes the status of multiple digital inputs to an MQTT broker. Additionally, the code manages automatic reconnections to both the network and MQTT broker if either connection is interrupted.
Click here for understand the test program
AT Commands
Once the code is uploaded to the NORVI GSM series device, it’s essential to confirm that the SIM card is properly registered and that the device can communicate with the network. This can be verified by monitoring the serial output for responses to specific AT commands.
Step 2: Steps to Configure in Mqtt.fx
Check this link for detailed instructions on how to configure the MQTT broker and the Subscriber.
- Download MQTT.fx client and install it.
- Open the MQTT.fx and click the Settings icon.
- Click + to create a profile.
- Enter the Connection Profile and General information.
Step 3: Enter the User Credentials Information
Step 4: SSL/TLS
- After completing the above steps, click Apply > OK to save.
- Then, select the name of the file just created in the profile box and click Connect.
- If the round icon in the top-right corner is green, the connection to IoT Hub is successful, and publishing and subscribing operations can be performed.
- Select the Subscribe tab in the client, scan and select the topic name, and click Subscribe to subscribe to the topic.
- The subscribing result can be seen in the bottom right corner.
Step 5: Subscribing Result
Step 6: Integration With Data Visualization Platform
NORVI devices can be connected to an IoT platform, enabling users to view and analyze data gathered by the devices. In this case, the platform used is Datacake. Below is a guide on how to integrate NORVI devices with Datacake.Click here
Step 7: Access the DATACAKE
- Access the DATACAKE from this link and navigate the Datacake dashboard. Select the “Add Devices”.
Step 8: For the MQTT Integration Select the API
- This will add the device to the Datacake account.
Step 9: Add API Device
Step 10: Fill in the Server Details and Add.
- Click on Configuration Scroll down a bit and go to the new panel “MQTT Configuration”. Press on “Add New MQTT Broker”. Fill in the server details and add.





