SIM7028 NB-IoT HAT Integration
Preparations
Hardware Preparation
Prepare a Waveshare SIM7028 NB-IoT HAT

Connect the antenna, NB card, ensure that the jumper cap is connected to side A, and connect it to a Windows computer. Test the connectivity using a serial port debugging assistant.

Login to WaveshareCloud to Obtain Parameters
Open the Waveshare Cloud official website, go to Devices | Attribute List, and add the SIM7028 NB-IoT HAT template device through One-Click Add Device.
Click the yellow button on the right side of the device in the device list View Address to obtain the parameters.
Obtained parameters:
MqttPath: mqtt.waveshare.cloud
Port: 1883
Client ID: 7d7a94c2
Pub Topic: Pub/10/14/7d7a94c2
Sub Topic: Sub/10/14/7d7a94c2
Example Video:
Sending Commands Using Serial Port
Command Set | Response | Continue Input? | Input Value | Description |
---|---|---|---|---|
AT+CSQ | +CSQ: 26,0 | —— | Query network quality; when returning +CSQ: 99,99, check the antenna and SIM card status. | |
AT+CMQTTSTART | +CMQTTSTART: 0 | —— | Enable MQTT functionality | |
AT+CMQTTACCQ=0,"7d7a94c2",0 | OK | —— | Set Client ID 7d7a94c2 as the Client ID obtained from the platform; the last digit 0 indicates the use of the mqtt protocol (non-ssl). | |
AT+CMQTTCONNECT=0, tcp://mqtt.waveshare.cloud: 1883,20,1 | +CMQTTCONNECT: 0,0 | —— | Connect to the MQTT server; return value 0,0 indicates successful connection. | |
AT+CMQTTTOPIC=0,18 | > | Pub/10/14/7d7a94c2 | Enter the publish topic; 18 is the length of the topic. | |
AT+CMQTTSUB=0,18,1 | > | Sub/10/14/7d7a94c2 | Enter the subscribe topic; 18 is the length of the topic. | |
AT+CMQTTPAYLOAD=0,41 | > | {"message":"This is SIM7028 NB-IoT HAT!"} | Enter the message body | |
AT+CMQTTPUB=0,1,60 | +CMQTTPUB: 0,0 | —— | Send the message |
Command Set | Response | Continue Input? | Input Value | Description |
---|---|---|---|---|
AT+CSQ | +CSQ: 26,0 | —— | Query network quality; when returning +CSQ: 99,99, check the antenna and SIM card status. | |
AT+CMQTTSTART | +CMQTTSTART: 0 | —— | Enable MQTT functionality | |
AT+CMQTTACCQ=0,"7d7a94c2",1 | OK | —— | Set Client ID 7d7a94c2 as the Client ID obtained from the platform; the last digit 1 indicates the use of mqtts protocol (ssl). | |
AT+CMQTTCONNECT=0, tcp://mqtt.waveshare.cloud: 8883,20,1 | +CMQTTCONNECT: 0,0 | —— | Connect to the MQTT server; return value 0,0 indicates successful connection. | |
AT+CMQTTTOPIC=0,18 | > | Pub/10/14/7d7a94c2 | Enter the publish topic; 18 is the length of the topic. | |
AT+CMQTTSUB=0,18,1 | > | Sub/10/14/7d7a94c2 | Enter the subscribe topic; 18 is the length of the topic. | |
AT+CMQTTPAYLOAD=0,41 | > | {"message":"This is SIM7028 NB-IoT HAT!"} | Enter the message body | |
AT+CMQTTPUB=0,1,60 | +CMQTTPUB: 0,0 | —— | Send the message |
Command Set | Response | Continue Input? | Input Value | Description |
---|---|---|---|---|
AT+CSQ | +CSQ: 26,0 | —— | Query network quality. When returns +CSQ: 99,99, check the antenna and SIM card status. | |
AT+CSSLCFG="authmode",0,2 | OK | —— | Set certificate mode. | |
AT+CSSLCFG="cacert",0, "rootCA.crt" | OK | —— | Specify CA certificate. | |
AT+CSSLCFG="clientcert",0, "server.crt" | OK | —— | Specify device certificate. | |
AT+CSSLCFG="clientkey",0, "server.key" | OK | —— | Specify device key. | |
AT+CMQTTSTART | +CMQTTSTART: 0 | —— | Enable MQTT functionality. | |
AT+CMQTTACCQ=0,"7d7a94c2",1 | OK | —— | Set Client ID. 7d7a94c2 represents the Client ID obtained from the platform, and the last digit 1 represents the use of the mqtts protocol (SSL). | |
AT+CMQTTCONNECT=0, tcp://mqtt.waveshare.cloud: 8884,20,1 | +CMQTTCONNECT: 0,0 | —— | Connect to the MQTT server. Return value 0,0 indicates successful connection. | |
AT+CMQTTTOPIC=0,18 | > | Pub/10/14/7d7a94c2 | Enter the publishing topic. 18 is the topic length. | |
AT+CMQTTSUB=0,18,1 | > | Sub/10/14/7d7a94c2 | Enter the subscribing topic. 18 is the topic length. | |
AT+CMQTTPAYLOAD=0,41 | > | {"message":"This is SIM7028 NB-IoT HAT!"} | Enter the message body. | |
AT+CMQTTPUB=0,1,60 | +CMQTTPUB: 0,0 | —— | Send the message. |
View Online Communication Information on WaveshareCloud
Open the
Online Debugging
page and select the created device for communication testing.

Example Video: