4G APN - How do I set the APN to connect to the network?
Table of Contents
Cellular based devices need a working SIM card and a working APN to connect to the network.
Typically when using 4G technologies such as Cat-M1 and NB-IoT the network automatically sets the correct APN and no user input is required. However, this is not the case for all networks and APNs. An autoAPN list is used by the device for the networks that need specific APNs, however this list isn't exhaustive and occasionally you may be required to set the APN manually.
On 2G and 3G networks it was possible to send an SMS to set the APN, However on Cat-M1 and NB-IoT networks, the device must be already connected to the network (i.e. the correct APN needs to be set already) to receive an SMS. And not all Cat-M1 and NB-IoT networks actually support SMS. So alternate methods are required for the 4G devices.
4G CAT M1 and NB-IoT devices may need their APN and network bands setup before they can get on air.
- Use a Provisioning Tool and App (preferred - tool available from DM)
- Create a 'Config SIM'
- A Config SIM can be created by storing a special SMS on the SIM
- The special SMS format is shown below
- Then the config Sim can be inserted into devices that need configuring
- Using an Alternate SIM (that will connect automatically) to set the APN, then swapping to the desired SIM
Method 1. Use of Provisioning Tool
See instructions here. As of 2020 we have released a new tool to enable the APN and other parameters to be set on the device. It is recommended if you have a 'tricky' network and provides the most insight into device settings and connectivity issues. The other methods require the user to have an alternative SIM available that will automatically join the network. So they are not as suitable in all cases. This is not a requirement for the provisioning tool as parameters can be directly changed via a cable and app. The provisioning tool is also the only way to update the modem to fix DNS issues on certain NB-IoT networks, as described in this article.
Method 2. Creating a Config Sim
The latest versions of device FW support the creation of a 'Config SIM'. In this method, an already connected device is used to store an SMS on a SIM card. This SIM is then inserted into other devices, which then reads the stored SMS to apply the correct settings. It is important to remember that a 4G device must be on the network to receive an SMS. So SMSing a device that is not online will not change any APN details. You must SMS a currently connected device, then de-power, and transfer the SIM into the new device, to change the APN on this new unit.;
There are multiple methods for storing the SMS onto a SIM card, including:
- Using a mobile phone that is capable of saving SMS's to its SIM card.
- Using a dedicated SIM programmer
- Sending the 4GINIT SMS to a device that is online on a network supporting SMS (perhaps via a different carrier) and has firmware that supports the 4GINIT SMS. This saves the SMS to the SIM card which can then be used to set the APN on other devices.
- Requesting a SIM with your required APN from your Digital Matter representative.
APN SMS Format
The format for the SMS is: (hash Asterisk comma 4GINIT comma APN comma RAT)
#*,4GINIT,<apn name>,<RAT number>
Where RAT stands for Radio Access Technology. The RAT is set using the following key:
0 - Automatic (use Cat-M1 and NB-IoT). This is the default setting, but doesn't work in some cases.
1 - Cat-M1 only (recommended)
2 - NB-IoT only
If the APN details are omitted then the default APN and RAT will be saved to the SIM card. The default APN is a blank APN. And the default RAT is 0 (M1 and NB1)
In the Device Logs it will show the command has been received, understood and saved. You can also check your SIM portal to see if it has been saved.
Using a Config Sim to set the APN on a device
The method for setting the APN using the Config Sim card is as follows:
- Send the SMS 4GINIT command to the SIM card in the connecting device
- The LED on the device will flash at its normal rate
- Within 10 seconds the device will begin a long, slow flash signifying the APN has been read and saved. You can also check the device logs to confirm (see above)
- Power can now be removed from the device, and the SIM card transferred to the destination/non-connecting device.
- Once the Device powers on, it will read the APN and use it to connect into OEM Server/Third party server specified.
- You can check if the device has read the new APN parameters once it connects in by opening the 'Admin Parameters' of the device. The SMS used resulting in the below parameters was #*,4GINIT,telstra.internet,1
The devices will delete all SMS' stored on the SIM that are not in the APN SMS format.
Method 3: Using an Alternate SIM card
If you have a SIM card that will allow the device to connect into OEM Server already without custom APN settings you can insert this SIM into the new device, connect and then set the desired Admin parameters via OEM.
- Insert functioning SIM Card
- Navigate to Admin Parameters and set APN (Fixed APN tab) & RAT (4G Technology tab)
- Wait for next upload of device. Device will connect in and read the new parameters and then apply them and not connect in again.
- Insert new SIM card and device will connect if APN details were correct.
This method can easily end up with the device being unable to connect if you set the incorrect parameters.