You need to set the Access Point Name (APN) that an IoT device's cellular modem will use for Internet connectivity. If all of your devices contain Super SIMs, this is straightforward: use the default APN super
, or, to reduce latency in certain geographies, one of the distributed breakout APNs.
However, if your products contain SIMs from a variety of suppliers, including Twilio, your code will first need to check which SIM its host device contains so that it can set the appropriate APN for that SIM. Typically, to detect SIM type you might read back the SIM's IMSI.
One the key advantages of Super SIM is that it includes multiple IMSIs to enable switching between different local networks in the territory in which the host device is operating.
This means that you should never use the current IMSI to determine whether a device contains a Super SIM. The IMSI reported by a Super SIM at any given time can and very likely will change. Instead, use the methods outlined below. The first is the recommended one, but the second may also be used.
For more detailed guidance on setting the APN, particularly for devices with integrated modules, please see our APN configuration page.
Every Super SIM, like all SIMs, incorporates an Integrated Circuit Card Identifier (ICCID). Super SIM ICCIDs all begin with the digits 8988307
or 8988323
so this fact can be used to determine whether a given SIM card or chip is a Super SIM.
Interrogate your module for the installed SIM's ICCID. Modules generally use this command:
AT+CCID
Its response will be:
+CCID: <SIM_ICCID>
Some modules offer alternative commands for displaying the SIM's ICCID. For example, the Quectel modules use AT+QCCID
; this yields the response +QCCID: <SIM_ICCID>
.
However you retrieve the SIM's ICCID, match its first seven digits against 8988307
and 8988323
to determine if it is a Super SIM.
Issue the AT+CRSM
command with the following parameters to retrieve the SIM's Service Provider Name (SPN):
AT+CRSM=176,28486,0,0,17
If the device's SIM is a Super SIM, this command will return:
+CRSM: 144,0,"005477696C696FFFFFFFFFFFFFFFFFFFFF"
The third, textual field provides the SPN. Each pair of characters is a hexadecimal character code. To extract the SPN, ignore the first pair of characters (00
) and read up to the first FF
. Now convert each hex pair to an Ascii character:
Hex | Ascii |
---|---|
54 | T |
77 | w |
69 | i |
6C | l |
69 | i |
6F | o |
You can shortcut this process by comparing the third field to 005477696C696FFFFFFFFFFFFFFFFFFFFF
. If the strings match, your code knows it is using a Super SIM and can issue the APN super
.
If you'd like to learn more about the fields included in the initial AT+CSRM
command and how the response is formatted, check out section 4.2.12 of the ETSI UMTS Specification. For example, the 176
in the command indicates a binary read command; the 28486
indicates that we want to receive the SPN.