Introduction: MQTT With QUECTEL EC25 Guide on NORVI GSM Series
NORVI devices are industrial controllers optimized for IoT applications. When paired with the Quectel EC25 LTE module, they can securely connect to cloud platforms using the MQTT protocol. This guide illustrates how to set up NORVI devices with the EC25 module to connect to an MQTT broker via AT commands. The focus is on the setup process, code details, and key AT commands necessary for implementation.
Supplies
Key features of NORVI devices with the Quectel EC25 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 Quectel EC25 module for remote monitoring and control.
Prerequisites
Before you begin, ensure you have the following,
- NORVI Device with an integrated Quectel EC25 module
- Registered Sim card
- 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)
Required Libraries
- Arduino.h
- Wire.h
- WiFi.h
- ArduinoJson.h
Sensitive Information Handling
- Secret.h: This file should contain the MQTT username and password, which should be kept secure.
Hardware Setup
1. 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: Setup NORVI GSM Device and Quectel EC25
- Connect the sim card to EC25 module securely for the NORVI GSM device.
- 2. Power on your device.
- 3. Make sure you have the GPRS credentials from your provider:
- APN, User, and Password (for GPRS connection).
Step 2: : Clone the Example Firmware Repository
- Clone the repository that contains the firmware for EC25 and MQTT communication: click here to get the code
- Open the project in your preferred IDE (e.g., Arduino IDE).
Step 3: Configure the Code for Your Setup
This Arduino code establishes a connection between a NORVI device and an MQTT broker using a Quectel EC25 LTE module. It initializes the GSM modem, connects to GPRS, and subscribes to an MQTT topic. The device sends digital input states as JSON payloads to the broker and handles incoming messages, decoding them as necessary. The code also includes functions for sending AT commands to the modem, managing MQTT connections, and monitoring network status to ensure reliable communication.
Step 4: You Will Need to Configure the Following
- GPRS Credentials: Enter your APN and GPRS user/pass in the code.
- MQTT Broker Details: Input the Datacake MQTT broker, port, and credentials from your Datacake account.
Step 5: Connect the Device to MQTT
Once the firmware is uploaded, the Quectel EC25 will try to connect to your GPRS network and MQTT broker. The device's status and digital inputs will be published to the Datacake MQTT topic.
- Check the serial monitor for feedback on GPRS and MQTT connection.
- If the device is connected, it will subscribe to the downlink topic for receiving messages and will start publishing sensor data
Step 6: Verify the Connection on Datacake
- Log in to your Datacake account.
- Go to the Devices section to see if your NORVI GSM device is online and receiving data from the EC25 module.
- You can now create dashboards and trigger actions based on the MQTT messages sent by the device.
Step 7: Configure the MQTT Broker
- 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 8: Enter the User Credential 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.
Step 9: Connected to the Broker
Step 10: Subscribe to the MQTT Topic
- Select the Subscribe tab in the client, scan and select the topic name, and click Subscribe to subscribe to the topic
Step 11: MQTT Subscriber Dashboard
- The subscribing result can be seen in the bottom right corner.
Step 12: Integration With Data Visualization Platform
- Access the DATACAKE from this link and navigate the Datacake dashboard. Select the “Add Devices”.(Datacake dashboard)
Step 13: For the MQTT Integration Select the API.
- This will add the device to the Datacake account.
Step 14: Add MQTT Broker Configuration.
- 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.
Step 15: MQTT Broker Connected Successfully
Step 16: Decoder Function to Verify Functionality
- To create a first database field, click on the “Add Field”. This will open another modal asking for some required input for the fields.
- When typing the name for that field, the identifier auto-fills. This identifier is unique and cannot be changed. it’s required for accessing the field from within the payload decoder or API.
Step 17: Added Fields
- If the device is already sending data, an indication of incoming data can be seen in the “Last data” column.
Step 18: Data Logs
- After the settings in the configuration section, the dashboard can be created. Use the Tab Bar on the Device to navigate into the ”Dashboard” view.





