Using Huawei-Certified Modules for Access
Overview
Certified modules are pre-integrated with the IoT Device SDK Tiny. They have passed Huawei test, and comply with Huawei's AT command specifications. The following benefits are available for using Huawei-certified modules:
- Device manufacturers do not need to concern about how to connect to the HUAWEI CLOUD IoT platform on the MCU (for example, how to set the secret encryption algorithm and clientID composition mode during MQTT connection setup). To connect their devices to the platform, they only need to invoke AT commands, accelerating device interconnection and commissioning.
- The MCU does not need to integrate the MQTT protocol stack or IoT Device SDK Tiny, greatly reducing MCU resource consumption.
- Huawei releases certified modules on HUAWEI CLOUD Marketplace so that device manufacturers and service providers can purchase these certified modules to quickly connect to HUAWEI CLOUD IoT.
The following figure shows how a certificated module is used to connect a device to the platform.

Recommended Modules
|
Module |
Manufacturer |
Model |
|---|---|---|
|
4G Cat1 module |
Fibocom |
L610 |
|
China Mobile IoT |
ML302 |
|
|
4G Cat4 module |
Quectel |
EC20CEFASG |
|
Quectel |
EC20CEHDLG |
|
|
Neoway |
N720 |
|
|
NB-IoT module |
China Mobile IoT |
M5319-A |
- The LTE Cat4 module applies to the scenarios where the service data transmission rate ranges from 50 Mbit/s to 150 Mbit/s. The LTE Cat1 module applies to the scenarios where the service data transmission rate ranges from 5 Mbit/s to 10 Mbit/s.
- If you cannot find a required module in the preceding list, submit a service ticket to describe your service scenario and requirements.
|
Module |
Manufacturer |
Model |
|---|---|---|
|
NB-IoT module |
Quectel |
BC39 |
|
BC95 |
||
|
BC35 |
||
|
BC26 |
||
|
BC28 |
||
|
Neoway |
N27 |
|
|
N25 |
||
|
N21 |
||
|
DWnet |
TPB41 |
|
|
TPB23 |
||
|
Yuchen Technology |
CFB-608 |
|
|
Lierda |
NB86-G |
|
|
4G Cat4 module |
Yuge |
CLM920_NC5 |
|
CLM920_NC3 |
||
|
Quectel |
EC20 |
|
|
4G Cat1 module |
Neoway |
N58 |
|
Quectel |
EC200S |
|
|
2G/3G/4G module |
Quectel |
M25 |
|
ZigBee intelligent module |
SHUNCOM |
SZ05 |
|
5G module |
Huawei |
MH5000 |
|
LoRa module |
Neoway |
LR70 |
|
WINEXT |
M100C |
Prerequisites
- The SIM card data service has been enabled, and the module can access the Internet.
- You have subscribed to the IoTDA service.
Development Process
The figure below shows the process for a manufacturer to develop a device.

Purchasing a Certificated Module
- Visit HUAWEI CLOUD Marketplace.
- Purchase the required module. For details on available modules, see Table 1.
Connecting Hardware
Insert a 4G card into the SIM card slot. Ensure that the notch of the card faces inwards and the chip faces upwards. (This document uses the L610 module as an example.)

Installing the USB Driver
- Install the USB driver.
- Run the installation file and perform the installation as prompted.
The USB driver version varies according to the device manufacturer. Contact the device manufacturer to obtain the required driver.
- After the driver is installed, connect the USB port of the development board to the PC and power on the PC. You can view the serial port devices in the device manager.
- Run the installation file and perform the installation as prompted.
- Use a serial port tool to debug AT commands.
- Run the installation file and perform the installation as prompted.
The version of the serial port tool varies according to the device manufacturer. Contact the device manufacturer to obtain a serial port tool that meets the requirements.
- Open the serial port tool, select an AT serial port enumerated in 2, set the baud rate to 115200, and click Open Port.

Ensure that the settings are correct. Otherwise, the AT command cannot be parsed or an error will occur during parsing.
- Run the AT+COPS? command. Click Send Command. If OK is returned, the network registration is successful. Otherwise, check the settings and hardware cable connections.

If the last digit of +COPS: 0,0,"CHN-CT",7 in the returned message is not 7, the network is faulty. Replace the SIM card or check whether the SIM card can access the Internet.
- Run the installation file and perform the installation as prompted.
Creating a Product and Device
- Create a product that uses MQTT by following the instructions provided in Creating a Product.
- Register a device.
After the device is registered, keep the device ID and secret properly. The secret cannot be retrieved. If you forget the secret, click Reset Secret on the device details page to obtain a new one.
- Access the IoTDA console to obtain the MQTT/MQTTS device connection address. If MQTT is used, the port is 1883. If MQTTS is used, the port is 8883.
Connecting to the Platform
The module provides AT commands in two encoding modes to connect to HUAWEI CLOUD: ASCII and hexstring. ASCII indicates the original encoding mode, and hexstring indicates the hexadecimal encoding mode.
- Using the ASCII mode
- Connect to the platform. Send the command AT+HMCON=bs,lifetime,"serverip","serverport","deviceID","passwd",codec, for example, AT+HMCON=0,300,"iot-mqtts.cn-north-4.myhuaweicloud.com","8883","deviceID","passwd",0. If +HMCON OK is received, the device is connected to the platform.
The parameters in the preceding command are described as follows:
- bsmode: whether device provisioning is used. Set this parameter to 0. The value 0 means that the device is directly connected to the platform, and 1 means that the device is connected to the platform through device provisioning.
- lifetime: MQTT heartbeat time. The default value is 300.
- serverip: MQTT/MQTTS connection address. For details, see Platform Connection Information. If the device is connected to the platform through device provisioning, set this parameter to the address provisioned by the device. For details, see Device Provisioning.
- serverport: port for device access. If MQTT is used, the port is 1883. If MQTTS is used, the port is 8883. If device provisioning is used, the service provisioning port is used.
- deviceID: device ID returned for the registered device. For details, see 2.
- passwd: secret set during device registration. For details on how to obtain the secret, see 2. If the certificate mode is used, you can leave this parameter unspecified. However, you must set the public key and private key certificates of the device in advance.
- codec: data transmission mode. Set this parameter to 0 or 1. The value 0 indicates the ASCII mode, and 1 indicates the hexstring mode. If the ASCII mode is used, the data mode is len,ascii_payload, for example, 2,"ab". If the hextring mode is used, the value is 2,"6162".
- Subscribe to a custom topic. Send the AT+HMSUB=qos,topic command, for example, AT+HMSUB=0,"$oc/devices/device_id/user/mytopic". If +HMSUB OK is received, the subscription is successful.
The parameters in the preceding command are described as follows:
- qos: QoS of the topic. The default value is 0.
- topic: a new custom topic. For details, see Adding a Custom Topic. Set the device operation permission to Subscribe and replace deviceID with the actual device ID.
- Report a message. Send the AT+HMPUB=qos,topic,payload_len,payload command, for example,
AT+HMPUB=0,"$oc/devices/device_id/user/mytopic",16,"{\"test\":\"hello\"}". If +HMPUB OK is received, the reporting is successful.
The payload is in ASCII mode. The string must start and end with double quotation marks (""), and the special characters in the string must be escaped.
The parameters in the preceding command are described as follows:
- qos: QoS defined in MQTT. The recommended value is 0.
- topic: a new custom topic. For details, see Adding a Custom Topic. Set the device operation permission to Publish and replace deviceID with the actual device ID.
- payload_len: length of the reported message, excluding the slash (\).
- payload: reported message.
- Report a property. Send the AT+HMPUB=qos,topic,payload_len,payload command, for example,
AT+HMPUB=0,"$oc/devices/device_id/sys/properties/report",82,"{\"services\":[{\"service_id\":\"Clock\",\"properties\":{\"card_no\":\"3028\",\"use_type\":1}}]}". If +HMPUB OK is received, the reporting is successful. You can view the reported property values on the device details page.
Before reporting properties, customize a product model or use the preconfigured product model. For details, see Developing a Product Model Online and Preconfigured Product Models.
- qos: QoS defined in MQTT. The recommended value is 0.
- topic: topic preconfigured on the platform. For more topics, see Topic Definition. Replace deviceID with the actual device ID.
- payload_len: length of the reported property, excluding the slash (\).
- payload: reported property.
- Deliver a command. On the Commands tab page of the device details page of the IoTDA console, click Deliver Command on the right of Synchronous Command Delivery. Select the command to deliver and the command value. After the delivery is successful, the device receives +HMREC:topic,payload_len,payload, for example, +HMREC: "$oc/devices/device_id/sys/commands/request_id={request_id}{"paras":{"value":1},"service_id":"SmokeDetectorControl","command_name":"QUITSILENCE"}",86,{"paras":{"value":1},"service_id":"SmokeDetectorControl","command_name":"QUITSILENCE"}.

The parameters in the preceding command are described as follows:
- qos: QoS defined in MQTT. The recommended value is 0.
- topic: topic preconfigured on the platform. For more topics, see Topic Definition. Replace deviceID with the actual device ID. {request_id} is used to uniquely identify the request. If this parameter is carried in a message sent by a device, ensure that the parameter value is unique on the device by using an incremental number or UUID. If this parameter is carried in a message received by a device, the parameter value needs to be also carried in the response message sent to the platform.
- payload_len: length of the delivered command, excluding the slash (\).
- payload: delivered command.
- Unsubscribe from the custom topic. Send the AT+HMUNS="topic" command, for example, AT+HMUNS="$oc/devices/deviceID/user/mytopic". If +HMUNS OK is received, the unsubscription is successful.
In the preceding command, topic is the custom topic added in 2. Replace deviceID with the actual device ID.
- Disconnect the device from the platform by sending the AT+HMDIS command.
- Set the server or client certificate.
- To set a CA certificate, run AT+HMPKS=type,para1,[para2],"Certificate", for example, AT+HMPKS=0,1360.
- To set a client certificate, run AT+HMPKS=type,para1,[para2],"Certificate", for example, AT+HMPKS=1,1022.
- To set a private key certificate, run AT+HMPKS=type,para1,[para2],"Certificate", for example, AT+HMPKS=1,1732.
- type: The value can be 0, 1, or 2, indicating a CA certificate, client certificate, and private key certificate, respectively. All the certificates are transmitted using para1. If a password is available, the password is transmitted through para2.
- para1/[para2]: The para1 parameter specifies the certificate. If it is left blank, the certificate is to be deleted. The para2 parameter specifies the password of the private certificate. It is valid only when the private certificate is set and the certificate is transmitted in the PEM format.
- Certificate: character length of the certificate content.
- Connect to the platform. Send the command AT+HMCON=bs,lifetime,"serverip","serverport","deviceID","passwd",codec, for example, AT+HMCON=0,300,"iot-mqtts.cn-north-4.myhuaweicloud.com","8883","deviceID","passwd",0. If +HMCON OK is received, the device is connected to the platform.
- Using the hexstring mode
- Connect to the platform by sending the command AT+HMCON=bs,lifetime,"serverip","serverport","deviceID","passwd",codec, for example, AT+HMCON=0,300,"iot-mqtts.cn-north-4.myhuaweicloud.com","8883","deviceID","passwd",0. If +HMCON OK is received, the device is connected to the platform.
For details on the parameters, see 1.
- Subscribe to a custom topic by sending the AT+HMSUB=qos,topic command, for example, AT+HMSUB=0,"$oc/devices/device_id/user/mytopic. If +HMSUB OK is received, the subscription is successful.
For details on the parameters, see 2.
- Report a message by sending the AT+HMPUB=qos,topic,payload_len,payload command, for example, AT+HMPUB=0,"$oc/devices/device_id/user/mytopic",16,7b2274657374223a2268656c6c6f227d.
Note: The payload is in hexadecimal data format and can be a hexadecimal character string without double quotation marks at the beginning or end.
For details on the parameters, see 3.
- Deliver a command. On the Commands tab page of the device details page of the IoTDA console, click Deliver Command on the right of Synchronous Command Delivery. Select the command to deliver and the command value. After the command is delivered, the device receives the +HMREC,topic,payload_len,payload command, for example,
+HMREC: "$oc/devices/device_id/sys/commands/request_id={request_id}",102,7B227061726173223A7B2276616C7565223A223132333435363738393071617A77737865646372667674676279686E756A6D696B6F6C70227D2C22736572766963655F6964223A224E42444F4F52222C22636F6D6D616E645F6E616D65223A2273656E64227D
For details on the parameters, see 5.
- Unsubscribe from the custom topic by sending the AT+HMUNS="topic" command, for example, AT+HMUNS="$oc/devices/device_id/user/mytopic". If +HMUNS OK is received, the cancellation is successful.
For details on the parameters, see 6.
- Disconnect the device from the platform by sending the AT+HMDIS command.
- Connect to the platform by sending the command AT+HMCON=bs,lifetime,"serverip","serverport","deviceID","passwd",codec, for example, AT+HMCON=0,300,"iot-mqtts.cn-north-4.myhuaweicloud.com","8883","deviceID","passwd",0. If +HMCON OK is received, the device is connected to the platform.
Device Management
The platform supports batch device management, remote control and monitoring, OTA upgrades, and flexible data forwarding to other HUAWEI CLOUD services.
Last Article: Node.js Demo
Next Article: Development on the Application Side



Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.