Having to manually select networks

For typical SIM cards, a phone or GSM module can scan all available networks, however it will only try and connect to those for which the SIM is authorized. That is because these type of SIM cards have steering – the SIM card can instruct the phone / GSM module on which operator to connect to.

IoT SIM cards are often designed to work globally, as permanently roaming SIM cards. Unless you are using one from some specific operator, it will likely not have a default network it is authorised for. Some will offer a single roaming operator in each region, others may offer connectivity with more operators in each region. The catch though is that with these roaming SIMs the SIM card often won’t have steering. Instead it is up to your software to tell the GSM module the network scanning/selection protocols based on where your product is being used.

Roaming SIM typical sequence to get the device connected

Get started
#Check Module Communication
AT

#Check Functionality
AT+CFUN?

#Activate Functionality (If response to previous command indicates inactive module)
AT+CFUN=1   (mobile full functionality with power saving disabled)

#Check SIM PIN (check if the SIM is ready)
AT+CPIN?

#Check ICCID
AT+CCID
Discover what networks are available
#PLMN Query
#(Query all Public Land Mobile Networks that can be received at the given location. Note this scan for operators can take some time to respond. In the returned result, all available network operators are listed with the long, short and numeric identifiers.)
#THIS COMMAND CAN BE VERY SLOW! Like takes 5 minutes to get a response slow...!
AT+COPS=?

An example response to AT+COPS=?

AT+COPS=?\r\n
\r\n
+COPS: (1,"vodafone UK","voda UK","23415",0),(1,"O2 - UK","O2 - UK","23410",0),(1,"vodafone UK","voda UK","23415",8),(1,"EE","EE","23430",9),(1,"O2 - UK","O2 - UK","23410",8),(1,"O2 - UK","O2 - UK","23410",9),(1,"vodafone UK","voda UK","23415",9),(1,"EE","EE","23430",0),,(0-4),(0-2)\r\n
\r\n
Selecting a network
#PLMN Automatic Selection
#This sets the registration process to automatic - you would use this if your SIM has steering.
AT+COPS=0

#PLMN Manual/Automatic Selection
#Manual operator selection with a fallback to automatic - you can use this to select a specific network operator and use automatic selection as a fallback if the network can't be found. This is the one to use with a global roaming IoT SIM that doesn't have steering.
#manual/automatic mode (4) is selected and the numeric identifier setting (2) is used to set operator (26202) - this number is got from the COPS=? reponse.
AT+COPS=4,2,"26202"  #(Example network value - the correct one would be among the "AT+COPS=?" command output)

#Alternatively you can request manual only selection, however it is generally not recommended due to the missing failover in case of an outage.
AT+COPS=1,2,"26201"
Analysis of needing to manually select using an operator code

We’ve not managed to find a definitive guide on this, but obviously the COPS=? can’t be used day to day, it’s far too slow. The code for each operator found is the same for each of their networks (see example capture above) and comprises of country numeric digits followed by operator numeric digits (look in your GSM modules AT command ref for an explanation). This means that presumably this code will be the same across the whole region, which means that you simply need to look for the operator that your IoT SIM card supports the best for the region its being used in and just always use that operator code. I.e. skip the AT+COPS=? step and go straight to AT+COPS=4,2,”26202″ using your operator’s code in place of the “26202” in this example. If your SIM card ever stops supporting that network you’ll need to change this code to whoever it now supports, but that issue is kinda inherent in this use case anyway as the SIM is unable to steer the selection.

Final bits
#PLMN Connection Process
#After setting a registration process with 'AT+COPS=...', the modem will try to connect to the Public Land Mobile Network. This can take some time to respond.
#Afterwards, the connection can be checked with 'AT+COPS?' and 'AT+CREG?'.

#Check the network registration status
AT+CEREG?    (EPS Network Registration Status)
AT+CREG?    (Network Registration Status)
AT+CGREG?    (GPRS Network Registration Status)

#Set the APN
AT+CGDCONT=1,"IP","####.####.net"

Does your IoT SIM card actually work?

If you can’t get connectivity then this is a simple check to see if your IoT SIM card is fundamentally working in your location.

  • Insert the SIM card into a smartphone and configure the APN on your device for the APN your SIM provider needs used.
  • Enable data roaming and disable Wi-Fi in the settings of your mobile phone
  • Access any website – e.g., Google
  • If you see the web site then the SIM is working. If it fails, or your phone display shows “no SIM detected” then something may be wrong with the SIM card.
USEFUL?
We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.

Comments

Your email address will not be published. Required fields are marked *