Introduction: Secure MQTT With SIMCOM SIM7500 Guide on NORVI GSM Series
NORVI devices are industrial IoT controllers that use the SIMCOM SIM7500 module for secure cellular connectivity via SSL MQTT communication. This guide outlines the process of setting up NORVI devices with the SIM7500 modem, including configuring the modem, connecting to the network, and establishing an SSL-secured MQTT session using AT commands.
Click here to view the web guide
MQTT Protocol
Supplies
SSL MQTT Communication
SSL (Secure Sockets Layer) safeguards data in transit from being intercepted or altered by unauthorized entities. It creates an encrypted connection between a client (such as the SIM7500 modem) and a server (like an MQTT broker), ensuring that any information exchanged remains confidential and protected from eavesdropping or tampering. This encryption technology is essential for maintaining the security of data during transmission over networks, especially in IoT communications where sensitive data is involved.
To configure SSL on NORVI SIM7500 devices for secure MQTT communication, follow these steps:
1. Insert the SIM card into the NORVI GSM series SIM7500 device.
2. Power on the NORVI device.
3. Open the serial monitor in your development environment.
4. Send AT commands to the SIM7500 module to enable SSL for MQTT communication.
5. Ensure the device and MQTT broker certificates are up-to-date for secure connections.
NORVI SIM7500 Devices (Click here to check SIM7500 Devices)
Setting Up NORVI GSM series SIM7500 to MQTT SSL
Here we’ll be considering the NORVI GSM series SIM7500 device as a Publisher and “MQTT.FX” software as the Subscriber. With the NORVI device, we’ll be storing the I/O values in the MQTT Subscriber and the data visualization platform.
Key features of NORVI devices with the SIM7500 module,
- 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 SIM7500 module for remote monitoring and control.
- SSL/TLS security: Secure data transmission using SSL/TLS over MQTT.
Prerequisites
Before you begin, ensure you have the following,
- NORVI Device with an integrated SIM7500 module
- MQTT broker details (hostname, port, username, password)
- MQTT.fx software for testing and monitoring
- Arduino IDE and necessary libraries for programming the NORVI device.
- Data visualization platform (e.g., DATACAKE)
- SSL Certificates: ( CA certificate, client certificate, and client key).
Required Libraries
- Arduino.h
- Wire.h
- WiFi.h
- ArduinoJson.h
- Datacake.h
Sensitive Information Handling
- Secret.h: This file should contain the MQTT username and password, which should be kept secure.
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
1. Pin Connections
- MODEM_TX (TX Pin)
- MODEM_RX (RX Pin)
- GSM_RESET (Reset Pin)
- Digital Input Pins (D0, D1, D2, D3)
Step 1: Test Program
Click here to get the code (Github) SIM7500_Connecting_to_Datacake_with_MQTT_Broker_TLS_Secured
This code configures a NORVI device with the SIM7500 modem for SSL-secured MQTT communication over a cellular network. It initializes the modem, connects to GPRS, and uploads an SSL certificate. The code sets up MQTT communication by using specific AT commands to establish a secure connection with an MQTT broker. The `mqttCallback` function handles incoming MQTT messages and checks if they match the device’s serial number. Periodic data is sent to the broker, and connection status is monitored, reconnecting if necessary. The code also supports publishing sensor data in JSON format.
Step 2: Enter the User Credentials Information
We also included a step to enter the user credentials for the SSL certificate. This requires providing the necessary authentication details, such as the client certificate, private key, and CA certificate, to establish a secure connection. These credentials are essential for the device to verify its identity and securely communicate with the MQTT broker over SSL. This step is a key difference from the SIM7500_MQTT setup used with Datacake, which does not require SSL.
Step 3: Steps to Configure MQTT.FX
Click here to guide the steps of configure in MQTT.fx
- Check this link for detailed instructions on how to configure the MQTT broker and the Subscriber.
Download MQTT.FX client & install it .
Open the MQTT.FX and click the setting icon.
Click + to create a profile
Enter the connection profile & general information.
Step 4: Enter the Connection Profile & General Information
Step 5: Enter the User Credentials Information
- 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.
Step 6: MQTT Subscriber Dashboard
- The subscribing result can be seen in the bottom right corner.
Step 7: Integration With Data Visualization Platform
- Access the DATACAKE from this link and navigate the Datacake dashboard. Select the “Add Devices.