Connecting the EC600 4G Module to EMQX via MQTT Protocol

Command Description

Connecting the EC600 4G Module to EMQX via MQTT Protocol

Basic AT Commands

Connecting the EC600 4G Module to EMQX via MQTT Protocol

ATI displays the MT ID information

AT+CIMI queries the IMSI

AT+QCCID queries the ICCID

AT+CSQ queries the signal strength

AT+CGATT? queries the current PS domain status

MQTT Configuration Commands

Connecting the EC600 4G Module to EMQX via MQTT Protocol

AT+QMTCFG configures MQTT optional parameters

AT+QMTCFG configures MQTT optional parameters.

AT+QMTOPEN opens the MQTT client network

AT+QMTCLOSE closes the MQTT client network

AT+QMTCONN connects the client to the MQTT server.

AT+QMTDISC disconnects the client from the MQTT server

AT+QMTSUB subscribes to a topic

AT+QMTUNS unsubscribes from a topic

AT+QMTPUBEX publishes a message

AT+QMTRECV reads messages from the buffer

Connecting the EC600 4G Module to EMQX via MQTT Protocol

Process

Connecting the EC600 4G Module to EMQX via MQTT Protocol

Setting up EMQX

Connecting the EC600 4G Module to EMQX via MQTT Protocol

Access the download page: https://www.emqx.io/zh/downloads, select the appropriate version based on your needs

Upload the downloaded compressed package to the server (recommended to store in the root directory of C drive for easier subsequent operations), and extract it to the specified path (e.g., C:\emqx).

Press Win+R, type cmd and press Enter to open the Windows command line interface.

Connecting the EC600 4G Module to EMQX via MQTT Protocol

Type cd C:\emqx\bin (replace with the actual path if different), and press Enter to enter the bin folder.

Connecting the EC600 4G Module to EMQX via MQTT Protocol

Type emqx start and press Enter to execute the start command.

Connecting the EC600 4G Module to EMQX via MQTT Protocol

Open the browser and enter the server’s public IP and management port: http://PublicIP:18083

Log in to the system: default username: admin, default password: public

Connecting the EC600 4G Module to EMQX via MQTT Protocol

After deploying on a public server, it can be accessed from any device using this IP address for remote management.

Connecting the EC600 4G Module to EMQX via MQTT Protocol

4G Module Wiring

Connecting the EC600 4G Module to EMQX via MQTT Protocol

4G Module —– USB to TTL

VCC —– 5V

GND —– GND

TX —– RX

RX —– TX

Physical Wiring

Connecting the EC600 4G Module to EMQX via MQTT Protocol

Connecting to the EMQX Platform

Connecting the EC600 4G Module to EMQX via MQTT Protocol

Connect the USB to TTL module to the device, open the serial debugging assistant, select the corresponding communication port, and set the baud rate to 115200. Then, by sending AT commands, the device can connect to the EMQX platform, completing data upload and downlink operations.

Connecting the EC600 4G Module to EMQX via MQTT Protocol

AT Command Process and Command Results:

1. Query Module Information

Send command: ATI

Description: Query basic information such as module model and firmware version.

Expected response: Quectel EC600M

Revision: EC600MCN_LAAR02A07M1G OK

Connecting the EC600 4G Module to EMQX via MQTT Protocol

2. Query International Mobile Subscriber Identity (IMSI)

Send command: AT+CIMI

Description: Obtain the IMSI number of the SIM card for identifying mobile users.

Expected response: 460049167111311 OK

Connecting the EC600 4G Module to EMQX via MQTT Protocol

3. Query SIM Card ID (ICCID)

Send command: AT+QCCID

Description: Obtain the unique identifier of the SIM card.

Expected response: 89860471162180011311 OK

Connecting the EC600 4G Module to EMQX via MQTT Protocol

4. Query Signal Strength

Send command: AT+CSQ

Description: Check the current network signal quality (0-31, the higher the value, the stronger the signal).

Expected response: +CSQ:20,99 OK

Connecting the EC600 4G Module to EMQX via MQTT Protocol

5. Query GPRS Attachment Status

Send command: AT+CGATT?

Description: Check if the module is attached to the GPRS network (1=attached, 0=not attached).

Expected response: +CGATT: 1 OK

Connecting the EC600 4G Module to EMQX via MQTT Protocol

6. Configure MQTT Protocol Version

Send command: AT+QMTCFG=”version”,0,4

Description: Set the MQTT client (ID=0) to use MQTT v3.1.1 protocol.

Expected response: OK

Connecting the EC600 4G Module to EMQX via MQTT Protocol

7. Open MQTT Connection

Send command: AT+QMTOPEN=0,”101.200.212.234″,1883

Description: Establish a server connection, MQTT client identifier is 0.

“101.200.212.234” is the MQTT server, and 1883 is the server port number.

Expected response: OK +QMTOPEN: 0,0

Connecting the EC600 4G Module to EMQX via MQTT Protocol

8. Connect Client to MQTT Server

Send command: AT+QMTCONN=0,”4G”,”admin”,”public”

Description: Parameter 0 is the MQTT client identifier, “4G” is the MQTT client ID, “admin” is the username, and “public” is the password.

Expected response: OK +QMTCONN: 0,0,0

Connecting the EC600 4G Module to EMQX via MQTT Protocol

9. Subscribe to MQTT Topic

Send command:

AT+QMTSUB=0,1,”test”,2

Description: Subscribe to the topic set by the platform, 0 is the MQTT client identifier, 1 is the packet identifier, “test” is the subscribed topic name, and 2 is the QoS level.

Expected response: OK +QMTSUB: 0,1,0,2

Connecting the EC600 4G Module to EMQX via MQTT Protocol

10. Publish MQTT Message

Send command:

AT+QMTPUBEX=0,0,0,0,”test4G”,15

Description: Prepare to publish an MQTT message to the specified topic (length 15 bytes).

Expected response: >

At this point, send data: {“temp”:”23.5″}

Final response: OK +QMTPUBEX: 0,0,0

Connecting the EC600 4G Module to EMQX via MQTT Protocol

EMQX Platform Data Interaction Operations:

In the left navigation bar, select “Tools” → “WebSocket” to enter the WebSocket interaction page.

Enter the target server’s IP address, fill in the WebSocket server port, input the topic to listen to, and click the “Subscribe” button to establish topic listening. Input the target topic for data reporting, which will be used for subsequent message sending.

Connecting the EC600 4G Module to EMQX via MQTT ProtocolConnecting the EC600 4G Module to EMQX via MQTT Protocol

In the [Subscribed Message List], you can view the reported data content in real-time.

Connecting the EC600 4G Module to EMQX via MQTT Protocol

Platform Data Downlink Operations

In the message input box, enter the command content to be sent down, ensure the published topic is the target topic subscribed by the device, and click the [Send] button. The platform will push the command to the device via WebSocket.

Connecting the EC600 4G Module to EMQX via MQTT Protocol

In the serial debugging assistant, you can monitor the status of the data received by the device in real-time:

Connecting the EC600 4G Module to EMQX via MQTT ProtocolConnecting the EC600 4G Module to EMQX via MQTT Protocol

Summary of Commands

config.css
ATI
AT+CIMI
AT+QCCID
AT+CSQ
AT+CGATT?
AT+QMTCFG="version",0,4
AT+QMTOPEN=0,"101.200.212.234",1883
AT+QMTCONN=0,"4G","admin","public"
AT+QMTSUB=0,1,"test",2
AT+QMTPUBEX=0,0,0,0,"test4G",15
{"temp":"23.5"}

Purchase Link

https://item.taobao.com/item.htm?id=638309299841

Leave a Comment