From setting up data connections and verifying SIM information to sending SMS messages or debugging connectivity, AT commands form the foundation of communication between your device and the cellular network.
Whether you are building a new IoT solution or managing thousands of deployed devices, mastering AT commands ensures that you can optimize connectivity, reduce downtime, and make the most of your Com4 IoT SIM.
Table of Contents
What Are AT Commands
Why AT Commands Matter for IoT Connectivity
AT Commands in Practice
AT Command Standards and Manufacturer Differences
AT Commands and IoT Standards
How AT Commands Work
Common AT Command Responses
AT Command Quick Reference
Core AT Commands for IoT Connectivity
Security and Access Control
Advanced Debugging with AT Commands
Optimizing AT Command Usage with Com4
The Future of AT Commands in IoT
Final Tips for IoT Developers
What Are AT Commands
AT commands, short for “Attention commands,” were originally designed for Hayes modems in the 1980s. Over time, they evolved into a universal language for controlling cellular modules used in IoT, M2M, and embedded systems.
Each command begins with “AT” to get the modem’s attention, followed by specific instructions.
Example:
AT+CREG?
This command checks whether the device is registered on the cellular network.
AT commands are sent through a serial interface such as UART or USB, and the device responds with simple text outputs like OK, ERROR, or diagnostic codes.
Why AT Commands Matter for IoT Connectivity
For IoT devices, AT commands are the foundation of every cellular action. They allow you to:
-
Configure APN and network settings.
-
Attach or detach from the cellular network.
-
Establish LTE, LTE-M, or NB-IoT data sessions.
-
Check signal quality and registration status.
-
Send and receive SMS messages.
-
Run diagnostic checks and update firmware.
AT commands provide direct, programmable control over how your IoT device behaves on the network.
When using Com4 connectivity, AT commands are essential for validating device behavior, debugging network issues, and automating registration and reconnection processes.
AT Commands in Practice
AT commands are used widely across industries in real IoT environments.
Smart metering: Reboot or query meters remotely when communication timeouts occur.
Fleet management: Monitor SIM status and signal strength across vehicles.
Industrial automation: Perform diagnostics or firmware updates without field visits.
Environmental monitoring: Trigger recalibration or data transmission based on sensor thresholds.
Integrating AT command control into firmware or backend systems improves reliability and reduces operational costs.
AT Command Standards and Manufacturer Differences
Most cellular modules follow these standard sets:
-
ITU T V.250, the original modem command set
-
3GPP TS 27.007 and 27.005, which extend support for GSM, UMTS, LTE, LTE M, and NB IoT
Each manufacturer, such as Teltonika, Quectel, Telit, and u blox, may include proprietary commands for specific functions.
Examples:
- Teltonika: AT+UPING for ping tests
- Quectel: AT+QIOPEN for TCP or UDP socket connections
Always refer to the manufacturer’s AT Command Manual for compatibility details and supported features.
AT Commands and IoT Standards
AT commands are closely aligned with global IoT standards such as:
- GSMA SGP.32 for IoT eSIM, enabling remote SIM profile control.
- 3GPP Releases 15 and later, introducing commands for LTE M and NB IoT low power operation.
- OMA LwM2M, integrating AT command functionality for large scale device management.
Understanding these standards ensures long term compatibility and efficient operation across diverse IoT ecosystems.
How AT Commands Work
An AT command typically follows this structure. In general all commands starting with "C" are 3GPP standardised. Other commands are usually vendor proprietary:
|
Element |
Purpose |
Example |
|
AT |
Attention prefix |
AT+CREG? |
|
COMMAND |
Specific instruction |
+CGDCONT |
|
SUFFIX |
Action type (=, ?, =?) |
AT+CREG? |
|
DATA |
Optional parameters |
AT+CGDCONT=1,"IP","com4" |
Command types:
- Set command (=): sets configuration
- Read command (?): reads current settings
- Test command (=?): lists supported options
- Execution command: performs an immediate action
Example:
AT+CREG?
+CREG: 0,5
OK
Meaning: the device is registered and roaming.
Common AT Command Responses
|
Response |
Meaning |
|
OK |
Command executed successfully |
|
ERROR |
Command failed |
|
+CME ERROR: <code> |
Equipment error |
|
+CMS ERROR: <code> |
SMS related error |
|
ABORTED |
Command interrupted |
Unsolicited Responses (URCs):Automatic notifications such as +CREG: 5 inform the host device in real time about changes in network registration or SIM state.
AT Command Quick Reference
|
Purpose |
Command Example |
Description |
|
Test communication |
AT |
Checks if the modem is responsive |
|
Signal quality |
AT+CSQ |
Returns signal strength (0–31) |
|
LTE registration |
AT+CEREG? |
Checks network registration |
|
Set APN |
AT+CGDCONT=1,"IP","com4" |
Defines PDP context |
|
Attach to network |
AT+CGATT=1 |
Connects device to the network |
|
List operators |
AT+COPS=? |
Shows available networks |
|
Enable roaming |
AT+URDFLT=1 |
Enables roaming |
|
Ping test |
AT+UPING="8.8.8.8" |
Tests data connectivity |
|
SIM ID |
AT+CCID |
Displays SIM ICCID |
Note: The commands AT+URDFLT=1 (enables roaming) and AT+UPING="8.8.8.8" (tests data connectivity) are u-blox-specific and not part of any official AT command standard. These are referring to u-blox modems.
Core AT Commands for IoT Connectivity
Checking Connectivity and Signal Strength
AT // Communication test of the AT interface
AT+CSQ // Signal check
AT+CREG? // GSM registration
AT+CEREG? // LTE registration
Setting Up a Data Connection
Define APN:
AT+CGDCONT=1,"IP","com4"
Attach to network:
AT+CGATT=1
Activate data session:
AT+CGACT=1,1
Verify connection:
AT+CGATT?
Expected response: +CGATT: 1
Reading Modem and SIM Information
|
Command |
Description |
Example Response |
|
ATI |
Modem information |
Teltonika TRB255 |
|
AT+GMM |
Module model |
TRB255 |
|
AT+GMI |
Manufacturer |
Teltonika Networks |
|
AT+CGSN |
IMEI number |
356789123456789 |
|
AT+CIMI |
IMSI |
242012345678901 |
|
AT+CCID |
ICCID |
89470400001234567890 |
Note: The commands AT+GMM (returns the module model, e.g., TRB255) and AT+GMI (returns the manufacturer, e.g., Teltonika Networks) are Teltonika-specific implementations of standard AT commands. Their output may vary depending on the device and should be referenced only in the context of Teltonika modems.
Pinging a Server
AT+UPING="8.8.8.8"
Note: The command AT+UPING="8.8.8.8" is u-blox-specific and not part of any official AT command standard. It is used to test data connectivity by sending a ping to a specified IP address (in this case, 8.8.8.8). This command should only be referenced when working with u-blox modems.
Used to test data connectivity and network reachability.
TCP and UDP Socket Communication
AT+USOCR=6 // Create TCP socket
AT+USOCO=0,"example.com",80
AT+USOWR=0,20,"GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"
AT+USORD=0,100
Note: The commands used for TCP and UDP socket communication — for example,
AT+USOCR=6 (create TCP socket), AT+USOCO=0,"example.com",80 (connect to a remote host), AT+USOWR=0,20,"GET / HTTP/1.1\r\nHost: example.com\r\n\r\n" (send data), and AT+USORD=0,100 (read data) — are u-blox-specific AT commands. These are not part of any official AT command standard and should only be referenced when working with u-blox modems.
Security and Access Control
- Restrict remote AT access to authorized hosts
- Encrypt communication using TLS or SSL where possible
- Disable sensitive AT operations without authentication
- Use Com4 SIM level access control for enhanced protection
Advanced Debugging with AT Commands
If connectivity issues occur, follow this diagnostic sequence:
AT+CMEE=2
AT+CSQ
AT+CEREG?
AT+CGDCONT?
AT+CGATT?
Common issues and actions:
|
Symptom |
Likely Cause |
Command |
Action |
|
No network registration |
APN misconfigured |
AT+CGDCONT? |
Set correct APN (com4) |
|
Weak signal |
Poor coverage |
AT+CSQ |
Adjust antenna or location |
|
SIM rejected |
Provisioning issue |
AT+CCID |
Contact Com4 support |
|
Data inactive |
PDP not established |
AT+CGACT? |
Reactivate data context |
Optimizing AT Command Usage with Com4
Com4’s IoT connectivity platform enhances AT command operations through real time SIM and signal monitoring. These capabilities reduce downtime and simplify IoT fleet management.
The Future of AT Commands in IoT
As IoT evolves with 5G, iSIM, and edge computing, AT commands will continue to expand their capabilities. Com4 ensures that customers remain ready for emerging technologies and evolving global standards.
Common Mistakes To Avoid
Even experienced engineers can face issues when handling AT commands, especially in large IoT deployments. These mistakes often cause unstable connectivity, higher power usage, or silent failures that are hard to trace.
- Sending the next command before receiving OK
Many devices push commands too quickly without waiting for a clear OK response. This can confuse the modem and lead to failed registrations or broken data sessions. - Using fixed delays instead of checking registration status
Relying on time based delays rather than commands like AT+CEREG? can result in unreliable behaviour. Network response times vary, especially in roaming or low coverage areas. - Ignoring ERROR responses
Some firmware skips over ERROR replies instead of reacting to them. This prevents proper recovery and makes troubleshooting difficult in the field. - Not logging AT command responses
Without storing raw AT responses, diagnosing issues becomes guesswork. Clear logs help teams identify whether the problem lies in the SIM, network, or device logic.
Final Tips for IoT Developers
-
Add retry logic and small delays between commands.
-
Monitor unsolicited responses for live status updates.
-
Always use the correct APN (com4).
-
Keep device firmware updated.
-
Automate regular signal and registration checks.
AT commands remain the universal interface for managing cellular IoT connectivity. By mastering them, developers can configure modems, optimize performance, and ensure reliable communication at scale.
With more than a decade of experience, Com4 provides the tools, expertise, and infrastructure needed for secure, high performance, and future ready IoT connectivity.
Test Your IoT Device with Com4
Start testing your IoT solution with Com4’s IoT SIM and experience secure, reliable connectivity designed for the future.
AT Commands 101: The IoT Developer’s FAQs
What does “AT commands” mean?
How to list all AT commands?
There is no universal AT commands list. Each module supports its own set. You can view supported commands using:
AT+CLAC
This displays all commands available on that specific modem.
How to give AT commands?
AT commands are sent through a serial interface using tools like a terminal or serial console.
Example:
AT
If the modem replies with OK, the command was received correctly.
What are 3GPP AT commands?
3GPP AT commands are standard commands defined for cellular devices to ensure consistent behaviour across networks.
Example:
AT+CEREG?
This checks LTE network registration status.
How to send AT commands to a modem?
You connect the modem to a device, open a serial interface, and type the command followed by a line break.
Example:
AT+CSQ
This returns signal strength information.
CASE STUDY



