本文へスキップ

AT Commands

AT commands are text-based instructions sent to a modem (communication module) over a serial interface. They are used to control the modem's behavior, c...

コピー/保存

このページはまだ日本語では利用できません。現在は英語版を表示しています。ブラウザの翻訳機能をご利用ください。

ブラウザで翻訳する
  • Chrome / Edge: アドレスバーの翻訳アイコン、またはページを右クリックして「日本語に翻訳」を選択してください。
  • Safari: アドレスバーの「aA」メニューから「翻訳」を選択してください。

翻訳メニューが表示されない場合は、ブラウザ設定で翻訳機能が有効になっているか確認してください。

英語版を見る

AT Commands

AT commands are text-based instructions sent to a modem (communication module) over a serial interface. They are used to control the modem's behavior, check its status, and configure its connection settings. The name comes from the word "attention" - each command begins with the prefix AT to signal the modem that an instruction follows.

AT commands are standardized by 3GPP and ETSI, which means that a core set of commands works across modems from different manufacturers. However, each manufacturer may also provide additional vendor-specific commands. This page covers the generic, standards-based commands that apply to most cellular modems.

Overview

When working with cellular IoT devices, you may need to interact directly with the modem to:

  • Verify that the modem detects the SIM and reads its identity
  • Check whether the modem is registered to a network
  • Inspect the signal quality at the device's location
  • View or change the selected network operator
  • Configure the APN (Access Point Name) and data connection settings
  • Enable or disable modem functionality

AT commands give you direct control over these operations, making them essential for initial device setup, troubleshooting connectivity issues, and verifying modem behavior in the field.

Accessing the AT Command Interface

To send AT commands, you need a serial or USB connection between your computer (or terminal) and the modem. The typical setup involves:

  1. Connect your computer to the modem's serial or USB interface using an appropriate cable or adapter.
  2. Open a serial terminal application and connect to the correct port at the modem's configured baud rate.

Common serial terminal applications include:

  • Windows: PuTTY or Tera Term , connected to the COM port where the modem is attached.
  • macOS / Linux: The screen or minicom command, connected to a device file such as /dev/tty.usbmodem* or /dev/ttyUSB*. For example: screen /dev/ttyUSB0 115200 or minicom -D /dev/ttyUSB0 -b 115200.

Some devices also provide access to the AT command interface through a built-in console, web interface, or debug port. Check your device's documentation for details.

Not all devices expose the modem's serial interface. If you are unsure whether your device allows direct access, review the device manual or contact the device manufacturer.

Soracom does not provide a way to send AT commands to a modem that does not already support them. While Soracom offers remote access services that can be used to reach a device over the network, these services only work if the device itself natively supports and has been configured for remote access to its AT command interface. The ability to execute AT commands depends entirely on your device's capabilities and configuration.

Command Format and Responses

Every AT command starts with the AT prefix and ends with a carriage return. Commands are not case-sensitive, but uppercase is conventional.

There are three standard forms for most commands:

FormSyntaxPurpose
TestAT+CMD=?Query the range of supported parameters
ReadAT+CMD?Query the current value or setting
WriteAT+CMD=<value>Set a new value

After you send a command, the modem responds with one of the following:

  • OK indicates the command was accepted and executed successfully.
  • ERROR or +CME ERROR: <code> indicates the command failed. The error code provides details about what went wrong. By default, some modems return only a generic ERROR response. Setting AT+CMEE=2 configures the modem to return readable error descriptions instead of numeric codes, which can simplify troubleshooting. Look up CME error codes in your modem's AT command manual for specific details about each error.

Some commands produce one or more lines of output before the final OK or ERROR response. For example, AT+CSQ responds with +CSQ: 15,99 followed by OK on a separate line.

Safety Considerations

Before sending AT commands, be aware of the following:

  • Persistent settings: Some commands change modem settings that survive a reboot. Incorrect values can affect the modem's ability to connect until they are corrected.
  • Connection loss: Commands such as AT+CFUN=0 disable the modem's radio, which immediately drops any active connection. If you are connected to the device remotely, this can make it unreachable.
  • Network disruption: Changing the APN, authentication, or operator selection to incorrect values can prevent the modem from reconnecting to the network.
  • Read before write: Use the read form (AT+CMD?) before using the write form (AT+CMD=<value>) so you understand the current configuration before changing it.

Always have your modem's AT command manual available. Incorrect parameters can leave the modem in a state that requires a factory reset to recover. If you are unsure about a command or its parameters, consult the manual or contact the modem manufacturer before proceeding.

Common AT Commands

The following commands are defined by 3GPP standards and are supported by most cellular modems. For each command, the expected response format and key values to look for are described.

Error Reporting

AT+CMEE=2

Enable verbose error reporting. By default, some modems return only a generic ERROR response when a command fails. This command configures the modem to return readable error descriptions, which simplifies troubleshooting.

AT+CMEE=2
OK

The available modes are:

ValueBehavior
0Disable extended error reporting (modem returns only ERROR)
1Enable numeric error codes (e.g., +CME ERROR: 10)
2Enable verbose error descriptions (e.g., +CME ERROR: SIM not inserted)

It is recommended to set AT+CMEE=2 at the beginning of any troubleshooting session. This setting may not persist across modem restarts on all devices.

Modem and SIM Identification

ATI

Display modem identification information.

ATI
Quectel
BG96
Revision: BG96MAR02A07M1G

OK

The response format varies by manufacturer but typically includes the modem model and firmware version.

AT+CIMI

Display the IMSI (International Mobile Subscriber Identity) stored on the SIM.

AT+CIMI
295050012345678

OK

The response should be a 15-digit number that matches the IMSI of your Soracom IoT SIM.

AT+CCID

Display the ICCID (Integrated Circuit Card Identifier) of the SIM.

AT+CCID
+CCID: 8942310000012345678

OK

The response should be a 19- or 20-digit number that matches the ICCID of your Soracom IoT SIM.

AT+CPIN?

Check the SIM card status, including whether a PIN is required.

AT+CPIN?
+CPIN: READY

OK

Common response values:

ValueMeaning
READYSIM is unlocked and ready for use
SIM PINSIM is locked and waiting for a PIN
SIM PUKSIM is blocked and requires a PUK to unlock
SIM NOT INSERTEDNo SIM detected

If the response is anything other than READY, the modem cannot register to a network. Verify that the SIM is correctly inserted and that the correct PIN has been provided.

Terminal / Command Session

ATE

Enable or disable command echo.

ATE1
OK

ATE1 enables echo, causing the modem to send back each character it receives before processing the command. ATE0 disables modem echo, so only the command response is shown. Note that some terminal programs may display local echo independently of the modem setting.

Disabling echo is typically preferred when sending commands programmatically from scripts or software, while enabling echo can be helpful for interactive debugging in a terminal.

Modem Functionality

AT+CFUN?

Query the current modem functionality level.

AT+CFUN?
+CFUN: 1

OK

A value of 1 means full functionality is enabled (radio on). A value of 0 means the radio is disabled. A value of 4 means flight mode (radio off, SIM accessible).

AT+CFUN=0

Disable the modem radio (minimum functionality). The modem deregisters from the network and drops any active data connection.

AT+CFUN=0
OK

If you are connected to the device remotely over a cellular connection, sending this command will make the device unreachable until the radio is re-enabled locally.

AT+CFUN=1

Enable full modem functionality (turn on the radio).

AT+CFUN=1
OK

AT+CFUN=4

Enable flight mode. The radio is turned off, but the SIM remains accessible. This is useful when you need to read SIM data or change modem configuration without maintaining a network connection.

AT+CFUN=4
OK

Network Operator Selection

When specifying an operator in AT+COPS commands, always use the numeric PLMN format (2) rather than the alphanumeric name. Alphanumeric operator names can vary between regions, firmware versions, and network configurations. For example, a device configured to select "Verizon" may fail to connect in locations where the network identifies itself as "Verizon Wireless". Numeric PLMN codes are standardized and do not change, so using AT+COPS=X,2,"PLMN" avoids these issues.

AT+COPS=?

Scan for available network operators. This command typically takes 2-3 minutes to complete.

AT+COPS=?
+COPS: (2,"T-Mobile","T-Mo","310260",7),(1,"AT&T","AT&T","310410",7)

OK

Each entry follows the format (status,"long name","short name","PLMN",access technology). The status value indicates the operator's availability:

StatusMeaning
0Unknown
1Available
2Currently registered
3Forbidden

The access technology value indicates the network type. The most common values are listed below; refer to 3GPP TS 27.007 for the full set:

ValueNetwork Type
02G (GSM)
23G (UTRAN)
74G (LTE/LTE-M)
9NB-IoT

In the example above, T-Mobile (status 2) is the currently registered operator on 4G, and AT&T (status 1) is available on 4G.

AT+COPS?

Display the currently selected network operator.

AT+COPS?
+COPS: 0,0,"T-Mobile"

OK

The response format is +COPS: <mode>,<format>,"<operator>". The mode indicates how the operator was selected:

ModeMeaning
0Automatic
1Manual
2Deregistered
4Manual with automatic fallback

The format indicates how the operator name is displayed (0 = long alphanumeric, 1 = short alphanumeric, 2 = numeric PLMN). Use AT+COPS=3,<format> to change the display format.

AT+COPS=0

Return to automatic network operator selection.

AT+COPS=0
OK

AT+COPS=1,2,"<PLMN>"

Manually select a network operator by its PLMN code. For example, to select AT&T in the United States:

AT+COPS=1,2,"310410"
OK

The parameters are: 1 = manual selection mode, 2 = numeric PLMN format.

Using manual selection mode overrides all network steering, including preferences configured with AT+CPOL. The modem will only attempt to register on the specified network and will not fall back to any other operator. If the specified network is unavailable due to an outage, a roaming agreement change, or a coverage gap, the device will remain without connectivity until the network becomes available again or the setting is changed manually.

In most cases, using AT+COPS=4,2,"<PLMN>" (manual with automatic fallback) is preferred over AT+COPS=1, as it allows the modem to automatically select an alternative operator if the specified one is unavailable.

AT+COPS=3,<format>

Set the format used when displaying operator information in AT+COPS? responses, without changing the current operator selection. The format values are:

FormatDisplay Type
0Long alphanumeric (e.g., "T-Mobile")
1Short alphanumeric (e.g., "T-Mo")
2Numeric PLMN (e.g., "310260")

For example, to display the operator as a numeric PLMN code:

AT+COPS=3,2
OK

AT+COPS?
+COPS: 0,2,"310260"

OK

AT+COPS=4,2,"<PLMN>"

Attempt manual operator selection first, and fall back to automatic selection if the manual selection fails. This is useful when you prefer a specific operator but want the modem to find an alternative if that operator is unavailable.

AT+COPS=4,2,"310410"
OK

The parameters follow the same format as manual selection (AT+COPS=1), but with mode 4 instead of 1.

AT+CPLS and AT+CPOL

These commands allow you to view and configure the UPLMN (User-controlled PLMN selector with Access Technology) list stored on the SIM. The UPLMN list defines which network operators the modem should prefer when searching for networks, and which radio access technologies to use with each operator.

AT+CPLS selects which PLMN list subsequent AT+CPOL commands will read or modify:

ValueListDescription
0UPLMNUser-controlled preferred list (read/write)
1OPLMNOperator-controlled preferred list (read only)
2HPLMNHome PLMN list (read only)

AT+CPOL? displays the entries in the currently selected PLMN list.

AT+CPOL= adds or modifies entries in the UPLMN list. The parameters are: slot number, format (2 = numeric PLMN), PLMN code, followed by flags for each supported radio access technology.

For example, to configure the UPLMN list with T-Mobile US on all radio access technologies and AT&T on 4G only:

AT+CPLS=0
OK

AT+CPOL=1,2,"310260",1,0,1,1
OK

AT+CPOL=2,2,"310410",0,0,0,1
OK

The radio access technology flags in AT+CPOL are positional:

PositionRadio Access Technology
1st2G (GSM)
2ndGSM Compact (legacy, typically set to 0)
3rd3G (UTRAN)
4th4G (LTE, LTE-M, and NB-IoT)

A value of 1 enables the radio access technology and 0 disables it. In the example above, T-Mobile is configured with 2G, 3G, and 4G enabled (1,0,1,1), while AT&T is configured with 4G only (0,0,0,1).

Modifying the UPLMN list changes persistent SIM data. The OPLMN and HPLMN lists are read-only and cannot be modified with AT+CPOL.

Network Registration

AT+CREG?

Check network registration status (2G/3G networks).

AT+CREG?
+CREG: 0,5

OK

AT+CEREG?

Check network registration status (4G/LTE networks).

AT+CEREG?
+CEREG: 0,5

OK

In both responses, the second value indicates the registration status:

ValueMeaning
0Not registered, not searching
1Registered, home network
2Not registered, searching
3Registration denied
4Unknown
5Registered, roaming

When using a Soracom IoT SIM with a global coverage plan such as plan01s, the expected value is 5 (registered, roaming). For plans with local coverage, the expected value is 1 (registered, home network).

Signal Quality

AT+CSQ

Query signal strength (RSSI) and bit error rate.

AT+CSQ
+CSQ: 15,99

OK

The first value is the RSSI index:

RSSI ValueApproximate Signal Strength
0-9Poor (below -95 dBm)
10-14Fair (-95 to -85 dBm)
15-19Good (-85 to -75 dBm)
20-31Excellent (above -75 dBm)
99Unknown or not detectable

The second value is the bit error rate. A value of 99 means it is not available, which is normal for most network types.

AT+CESQ

Query extended signal quality measurements. This command provides more detailed metrics than AT+CSQ, including values specific to 3G and 4G networks.

AT+CESQ
+CESQ: 99,99,255,255,20,55

OK

The response contains six values:

PositionMetricNetwork Type
1stRXLEV (received signal level)2G
2ndBER (bit error rate)2G
3rdRSCP (received signal code power)3G
4thEc/No (energy per chip to noise ratio)3G
5thRSRQ (reference signal received quality)4G
6thRSRP (reference signal received power)4G

Values of 99 or 255 indicate that the measurement is not available, which is expected for metrics that do not apply to the current network type. In the example above, the device is connected to a 4G network, so only RSRQ and RSRP contain valid measurements.

For RSRP, higher values indicate stronger signal. The approximate dBm equivalent is value - 141:

RSRP ValuedBm RangeApproximate Signal Strength
0-30-141 to -111 dBmPoor
31-50-110 to -91 dBmFair
51-70-90 to -71 dBmGood
71-97-70 to -44 dBmExcellent

For RSRQ, higher values indicate better signal quality. The approximate dB equivalent is (value / 2) - 20:

RSRQ ValuedB RangeApproximate Signal Quality
0-9-20 to -15.5 dBPoor
10-19-15 to -10.5 dBFair
20-29-10 to -5.5 dBGood
30-46-5 to 3 dBExcellent

AT+CESQ is defined in 3GPP TS 27.007 and supported by most modern modems, but some older modems may not support it. If the command returns an error, use AT+CSQ instead or check your modem's AT command manual for a vendor-specific alternative.

APN and Data Connection

AT+CGDCONT?

Query the current PDP context configuration.

AT+CGDCONT?
+CGDCONT: 1,"IP","soracom.io","",0,0

OK

AT+CGDCONT=1,"IP","soracom.io"

Define a PDP (Packet Data Protocol) context with Soracom's APN settings. This saves the configuration to PDP context slot 1.

AT+CGDCONT=1,"IP","soracom.io"
OK

AT+CGAUTH=1,2,"sora","sora"

Set CHAP (Challenge-Handshake Authentication Protocol) authentication credentials for PDP context 1. The parameters are: 1 = PDP context identifier, 2 = CHAP authentication type, followed by the username and password.

AT+CGAUTH=1,2,"sora","sora"
OK

For Soracom APN settings including the APN name, username, password, and authentication type, see Service Endpoints.

AT+CGATT?

Check whether the modem is attached to the packet domain.

AT+CGATT?
+CGATT: 1

OK

A value of 1 means the modem is attached. A value of 0 means it is not attached.

AT+CGACT?

Check whether a PDP context is activated.

AT+CGACT?
+CGACT: 1,1

OK

The first value is the PDP context identifier and the second value is the activation status. 1 = activated, 0 = deactivated.

AT+CGPADDR=1

Display the IP address assigned to PDP context 1.

AT+CGPADDR=1
+CGPADDR: 1,"10.0.123.45"

OK

If the modem has been assigned an IP address, the data connection is established and the device should be able to send and receive data.

Generic vs. Manufacturer-Specific Commands

The commands described above are defined by 3GPP standards and are supported by most cellular modems. However, modem manufacturers often provide additional proprietary commands that offer:

  • More detailed diagnostic information (such as serving cell details, band information, or connection quality metrics)
  • Simplified configuration for device-specific features
  • Access to hardware-specific functionality not covered by the 3GPP standard

For the full set of commands available on your modem, refer to the AT command manual published by your modem's manufacturer. If you cannot find the manual, contact the manufacturer directly.

Example: Generic vs. Vendor-Specific Signal Information

The generic AT+CSQ command returns a basic signal strength index:

AT+CSQ
+CSQ: 15,99

OK

This provides a general indication of signal strength but limited detail. Some modem manufacturers offer proprietary commands that return much more detailed information. For example, a vendor-specific command might return the serving cell details including the frequency band, channel number, and additional signal quality measurements such as SINR:

AT+VENDORCMD="servingcell"
+VENDORCMD: "servingcell","NOCHANGE","LTE","FDD",310,260,BFD3,318E202,100,7,5,5,-95,-8,15,25

OK

The vendor-specific command shown above is a fictional example for illustration purposes. The actual command name, syntax, and output format will differ depending on your modem manufacturer and model. Refer to your modem's AT command manual for the correct command.

検索 Escで閉じる / Enterで検索結果