Network selection
Here we will discuss how to perform:
Operator selection
Check current network
Check available networks
Operator selection
To force a SIM to a network, we can use the following AT command:
AT+COPS=<mode>,<format>,<operator>
Here <mode> determines if the network selection is done automatically or forced to a network specified in <operator> using the format specified in <format>.
Possible values for <mode> are as follows:
<mode> | Meaning | Actions |
0 | Automatic selection (<operator> field is ignored) | SIM will connect to any operator |
1 | Manual selection (<operator> field is mandatory) | SIM will only connect to the operator specified |
2 | Deregister from network | SIM will not connect to any operator |
3 | Sets the <format> for the read command +COPS? (<operator> field is ignored) | No attempt to connect/ disconnect |
4 | Manual selection, if possible (<operator> field is required). Switches to automatic (<mode>=0) if manual selection fails | SIM will attempt to connect to the operator specified and switch to any operator if that fails. |
Possible values for <format> are as follows:
<format> | Meaning |
0 | <loperator> Long format alphanumeric (E.g. T-Mobile USA) |
1 | <soperator> Short format alphanumeric (E.g. TMO) |
2 | <noperator> Numeric (E.g. 310260) which is the Country and Network code (MCC, MNC) |
The <operator> can be retrieved from the result of a AT+COPS=? to check available networks.
Some examples below of how to perform operator selection in various modes/ formats.
Check current network
To check the network registration status of the SIM, we can use the following AT command:
AT+COPS?
This command returns the current <mode> and currently selected operator. If operator is not selected the <operator> and <format> are omitted. The results of the command could be as follows:
<mode> | Meaning |
0 | Automatic selection, registered to network if <operator> and <format> are present |
1 | Manual selection, registered to network if <operator> and <format> are present |
2 | Deregistered from network |
4 | Manual selection, if possible, registered to network if <operator> and <format> are present |
Examples below:
Check available networks
To scan and report visible networks the network registration status of the SIM, we can use the following AT command:
AT+COPS=?
This command returns a list of quadruplets, each representing an operator present on GSM network followed by a list of supported modes and formats.
The quadruplet consists of:
+COPS: <status>,<loperator>,<soperator>,<noperator>
where the status carries the following meaning:
Status | Meaning |
0 | Unknown |
1 | Available |
2 | Current |
3 | Forbidden |
Examples below:
Last updated