Using External SIM Cards
You might find a need to use your Notecard with an external SIM for certain deployments, for instance, if a device needs to operate in a region that is not currently covered, or if you need to ensure network redundancy for your application. In these cases, provided you are using a Notecarrier which includes an external SIM slot or you have added one to your own board, the Notecard provides support for switching to an external SIM.
Configuring the Notecard
Identify the APN
You must know the 3rd-party carrier's Access Point Name (APN) in order to connect to their service. Several carriers will have a website dedicated to manually configuring devices, while other can be discovered using APN discovery websites like apn.how. For example, to operate a Notecard in India, you may wish to use an Airtel SIM with their "Internet" APN.
Name: Airtel
APN: airtelgprs.com
Update the APN Settings
Once you have determined the correct APN, the Notecard requires very minimal
setup to be configured to utilize an external SIM card. The APN can be
configured using the apn parameter of the
card.wireless
API.
Following on with the Airtel example:
{
"req": "card.wireless",
"apn": "airtelgprs.com"
}Update the Frequency Band
The default mode for the Notecard is auto, which is the appropriate setting
for the majority of scenarios. However, if using a Narrowband (NB) Notecard and
you want to speed up network registration, you can specify the frequency band
associated with the carrier's service.
This can be accomplished using the mode parameter of the
card.wireless
API. You can select from modes Cat-M1 (5G eMTC) (m), Cat-NB1 (5G NB-IoT)
(nb), and GSM/GPRS/EDGE (2G) (gprs).
{
"req": "card.wireless",
"mode": "m"
}Reverting to the Embedded SIM on the Notecard
If you need to revert from using an external SIM to using the embedded SIM on
the Notecard, simply remove the external SIM and the Notecard will automatically
switch to the default carrier. You can also reset the APN setting and frequency
band to their defaults by using the following card.wireless API request.
{
"req": "card.wireless",
"apn": "-",
"mode": "-"
}Refer to the
card.wireless API, for
detailed instructions.
Failing Over to a Different SIM
In scenarios where the SIM in use on the Notecard is unable to connect (whether it's due to coverage limitations or roaming restrictions), you may configure a SIM as a failover/backup connectivity option.
Configuring SIM Failover
The card.wireless API
is used to configure SIM failover via the method argument, including setting
an apn that the Notecard will use only when using the external SIM.
{
"req": "card.wireless",
"method": "dual-primary-secondary",
"apn": "airtelgprs.com"
}There are five possible values for the method argument:
"-"resets the Notecard to the default value. In this state, the Notecard uses the external SIM exclusively if it detects the presence of an external SIM, otherwise it uses the internal SIM."dual-primary-secondary"will attempt to register with the internal SIM first and switch to the external SIM upon a network registration failure."dual-secondary-primary"will attempt to register with the external SIM first and switch to the internal SIM upon a network registration failure."primary"- will exclusively use the internal SIM, even if an external SIM is present."secondary"- will exclusively use the external SIM, but only if an external SIM is present.
In the two dual-* modes, the primary/secondary SIMs are ordered by preference.
The first SIM listed is the one Notecard treats as "home" and tries to register
with first. For dual-primary-secondary, the preferred SIM is the primary
(internal). For dual-secondary-primary, the preferred SIM is the secondary
(external).
When using either dual-* method, Notecard makes two registration attempts on
the current SIM before toggling to the other SIM. Once a switch occurs,
Notecard continues using the new SIM as long as it remains registered. By
default, it does not automatically return to the preferred SIM on its own.
Returning to the Preferred SIM with the hours Argument
You can optionally use the hours argument to have Notecard periodically retry
the preferred SIM, even when the current SIM is working fine.
{
"req": "card.wireless",
"method": "dual-primary-secondary",
"apn": "airtelgprs.com",
"hours": 4
}This introduces a second, independent switching trigger:
- Registration-failure switching: after two failed registration attempts on
the current SIM, Notecard toggles to the other SIM. The
hourstimer restarts each time a failure-triggered switch occurs. - Periodic reset: every
hourshours, Notecard attempts to switch back to the preferred SIM regardless of which SIM is currently active.
Programmatically Switching Between SIMs
There is currently no API to force an immediate switch between the internal and
external SIMs from your application code. The active SIM continues to be used
as long as Notecard remains registered on a cellular network, and switches are
driven only by the two triggers described above (registration failure or the
hours periodic reset).
For example, if Notecard experiences a registration failure on the internal SIM
and then successfully registers on the external SIM, it will not re-attempt to
use the internal SIM until either it experiences a registration failure on the
external SIM, or the hours periodic reset fires for whichever SIM is
preferred.
Frequently Asked Questions
- Q: What type of external SIM does the Notecarrier support?
- A: The type of external SIM used is a Nano SIM.
- Q: Can I use an external SIM to access 2G, 3G, 4G/LTE networks?
- A: The answer is two fold. First, it's up to the 3rd party carrier/SIM provider as to whether or not 2G/3G/4G is available. Second, you must select a wideband Notecard to access 3G or 4G networks.
- Q: Can I specify the frequency band I want to connect to, when multiple frequencies are available (Cat-M1, Cat-NB1, EGPRS)?
- A: Yes. You will need to
select a narrowband Notecard, and
you can specify the network using the
modeparameter of thecard.wirelessAPI.
- Q: Does the card.wireless setting take effect immediately – or after a restart of the card?
- A: It takes effect immediately, but is used only when an external SIM is plugged in. The apn setting on card.wireless is applicable only to an external SIM. When there is no SIM, the default carrier will be used, and when there is a SIM, the provided APN (or the default for an internally-supported SIM) will be used unless failing over to a different SIM has been configured separately.
- Q: Is it possible to programmatically switch between an internal and external SIM card?
- A: The Notecard does automatically recognize and use an external SIM card when present, but programmatic switching between SIMs is not currently supported.