Every customer must set the Access Point Name (APN) that an IoT device’s cellular modem will use for Internet connectivity. If all of their devices contain Super SIMs, this is straightforward: use the APN
However, if your products contain SIMs from a variety of suppliers, including Twilio, you will first need to check which SIM a given device contains so that you can set the appropriate APN for that SIM. Typically, to detect SIM type you read back the SIM’s IMSI.
However, 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 not use an IMSI to determine whether a given device contains a Super SIM.
Instead, issue the
AT+CRSM command with the following parameters to retrieve the SIM’s Service Provider Name (SPN):
If the device’s SIM is a Super SIM, this command will return:
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:
You can shortcut this process simply 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
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.