Fundamentals 9 min read

Mastering AT Commands for NB‑IoT: Essential Guide and Tools

This article explains the purpose and syntax of AT command sets used in IoT, details common NB‑IoT commands with examples, and introduces popular serial debugging tools such as IoT Studio and QCOM for effective module testing and network management.

Huawei Cloud Developer Alliance
Huawei Cloud Developer Alliance
Huawei Cloud Developer Alliance
Mastering AT Commands for NB‑IoT: Essential Guide and Tools

In the Internet of Things (IoT), AT command sets are used to control communication modules, perform device testing, and manage network connections. This article introduces the most frequently used NB‑IoT AT commands and the tools that help developers debug them.

What Is an AT Command Set?

AT commands are strings that start with the characters “AT” and end with a carriage‑return. They define the interaction rules between Terminal Equipment (TE) and Mobile Terminals (MT). In GSM networks, AT commands can initiate calls, send SMS, manage phonebooks, handle data services, and even control fax operations.

AT Command Syntax Types

AT commands are divided into three categories:

Execution commands : Set parameters, e.g., AT+<x>=<...> (with parameters) or AT+<x> (without parameters).

Test commands : Query the legal range of parameters, e.g., AT+<x>=?.

Query commands : Retrieve the current value of a setting, e.g., AT+<x>?.

Most modules support the 3GPP TS27.007 command set and may add vendor‑specific extensions. Commands beginning with “C” (e.g., AT+CFUN) are standard, while those starting with “N” are often custom.

Common AT Commands for NB‑IoT

AT+CGSN (Query Module Serial Number)

Usage: AT+CGSN=<snt>. If <snt> is omitted, the module returns “OK”. <snt>=0: Returns the module’s serial number. <snt>=1: Returns the IMEI, a globally unique identifier used by most IoT platforms. <snt>=2: Returns the IMEISV (software version). <snt>=3: Returns the firmware version (SVN).

Example:

AT+CGSN=1
+CGSN:868744036640526
OK

AT+CGMR (Query Firmware Version)

Returns the firmware revision of the module.

AT+CGMM
<Revision>
OK

AT+CMEE (Error Reporting)

Enables numeric error reporting to help locate issues.

AT+CMEE=1
OK

AT+NRB (Module Reboot)

AT+NRB
REBOOTING
... (boot logs) ...
OK

AT+CSQ (Signal Strength Query)

Returns +CSQ:<rssi>,<ber>. The RSSI value is converted to dBm by Signal = 113dBm + (rssi*2).

AT+CSQ
+CSQ:31,99
OK

rssi=0 → very poor signal.

rssi=31 → excellent signal.

rssi=99 → no signal.

AT+CGATT (Network Attachment Query)

Returns +CGATT:1 if the network is attached, otherwise +CGATT:0.

AT+CGATT?
+CGATT:1
OK

AT+CEREG (Network Registration Status)

Queries EPS network registration and can be configured to report changes automatically.

AT+CEREG=1
OK
+CEREG:1,1
OK

AT+CSCON (Current Connection Status)

Returns +CSCON:<n>,<mode> where n controls asynchronous notifications and mode indicates IDLE (0) or connected (1) state.

AT+CSCON?
+CSCON:0,1
OK

AT+CFUN (RF Function Control)

Enables or disables the module’s radio frequency functionality.

AT+CFUN=0   // disable RF
OK
AT+CFUN=1   // enable RF
OK
AT+CFUN?
+CFUN:1
OK

AT Command Debugging Tools

Serial debugging tools (also called AT command debugging tools) help developers send, receive, and log AT commands. The most common tools are IoT Studio and QCOM.

IoT Studio

IoT Studio, based on Huawei LiteOS, supports C, C++, and assembly languages, offering code editing, compilation, flashing, and real‑time debugging. It can track key system data, save logs, and replay them.

QCOM

QCOM is a classic serial debugging assistant that supports multiple command windows, individual delay settings, and easy NB‑IoT module development.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

IoTNB-IoTmodule testingAT commandsserial debugging
Huawei Cloud Developer Alliance
Written by

Huawei Cloud Developer Alliance

The Huawei Cloud Developer Alliance creates a tech sharing platform for developers and partners, gathering Huawei Cloud product knowledge, event updates, expert talks, and more. Together we continuously innovate to build the cloud foundation of an intelligent world.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.