AT+COPS
The AT+COPS command allows retrieving information about the current mobile network operators and their status. It facilitates selecting automatic or manual network selection mode.
The AT+COPS command allows users to check mobile carrier status and select carriers automatically or manually. Below is a guide to executing the AT+COPS command under the default Mobile-Data protocol with MMCLI command sets.
Please turn the roaming function on before manually selecting the mobile carrier using the AT+COPS command. You can turn on/off mobile roaming under "Network > Interface > Mobile: Edit."
Test Command
The AT+COPS test command returns five parameters, each representing an operator present in the network. Some formats may be unavailable, which means the fields will be empty.
MMCLI Example:
mmcli -m 2 --command=AT+COPS=?
+COPS: (2, "VODAFONE-DE", "VODAFONE", "26202", 7),(1, "Telefónica O2", "O2", "26203", 2),(3, "TELEKOM-DEUTSCHLAND", "TELEKOM", "26206", 7)
Read Command
The AT+COPS read command returns the current mobile carrier and its mode. The format, operator, and access technology parameters are omitted from the response if no operator is connected.
MMCLI Example:
mmcli -m 2 --command=AT+COPS?
+COPS: (2, "VODAFONE-DE", "VODAFONE", "26202", 7)
Carrier Selection
The AT+COPS write command attempts to select and register with the specified network operator. If the selected operator is unavailable (unless mode 4 of automatic selection is set), no other operator will be selected. The format of the selected operator name will be used for subsequent AT+COPS read commands.
MMCLI Example of Select by Carrier's Numbric ID: <format> 2
mmcli -m 2 --command=AT+COPS=1,2,26202,7
' ' We can also input the carrier's short name: <format> 1
mmcli -m 2 --command=AT+COPS=1,1,Vodafone,7
If select by the carrier's full name, expecially when it has space or special characters, such as "-": <format> 0
mmcli -m 2 --command=AT+COPS=1,0,\"Vodafone-DE\",7
Response Time
When the mobile signal is weak or unstable, the AT+COPS command can take a long time to execute before getting a response. Suggest adding the timeout parameter for test/read/write commands. The typical maximum response time is 180 seconds, determined by the actual mobile network.
Example of Adding 120-Second Timeout for Test Command
mmcli -m 2 --command=AT+COPS? --timeout=120
Parameters
Parameter | String / Integer | Description |
---|---|---|
<stat> | 0 | Unknown |
1 | Operator available | |
2 | Current operator | |
3 | Operator forbidden | |
<oper> | String Type | Operator in format as per <mode>. |
<mode> | 0 | Automatic mode. field is ignored. |
1 | Manual operator selection. The field shall be present and optionally. | |
2 | Manually deregister from network. | |
3 | Set only (for AT+COPS? Read Command), and do not attempt registration/deregistration (and fields are ignored). This value is invalid in the response of Read Command. | |
4 | The manual/automatic selection. The field shall be presented. If manual selection fails, automatic mode ( = 0) will be entered. | |
<format> | 0 | Long format alphanumeric, which can be up to 16 characters long. |
1 | Short format alphanumeric. | |
2 | Numeric . Mobile operators MCC MNC number. | |
<Act> | Integer Type | Selected mobile network type. Values 4, 5, and 6 occur only in the response of Read Command, while MS is in a data service state and is not intended for the AT+COPS Write Command. |
2 | 3G - UTRAN | |
4 | 3G - UTRAN W/HSDPA | |
5 | 3G - UTRAN W/HSUPA | |
6 | 3G - UTRAN W/HSDPA and HSUPA | |
7 | 4G - E-UTRAN | |
10 | 4G - E-UTRAN connected to a 5GCN | |
11 | 5G - 5GNR connect to 5GCN | |
12 | 5G - NG-RAN | |
13 | 4G & 5G - E-UTRAN_NR dual connectivity |
Last updated