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
Last updated