Skip to contentSkip to navigationSkip to topbar
On this page

Programmable Wireless: How to Set a Device’s APN


To configure your wireless IoT device to use a Programmable Wireless SIM or Narrowband SIM requires only a few small configuration settings. You will need to configure the device into which you have fitted your SIM with the identity of the server through which it will transfer data. This is the SIM's configured Access Point Name (APN).

(information)

Info

The APN for the Programmable Wireless SIM is:

wireless.twilio.com

No authentication is required for this APN — please leave any username and password entries blank.

(information)

Info

The APN for the Narrowband SIM, provided in partnership with T-Mobile US, is:

iot.nb

No authentication is required for this APN — please leave any username and password entries blank.

(warning)

Warning

The Narrowband IoT SIM will not connect outside of the US.

If you know how to configure the APN on your device, go ahead and make the change now. If not, here are some guides to help you:

  • You are using an IoT device that supports AT Commands with a Programmable Wireless SIM or a Narrowband SIM.
  • You are using an iOS device — Programmable Wireless SIM only.
  • You are using an Android device — Programmable Wireless SIM only.

That's generally all you need to do to configure your device, but depending on the device you are using, you may also need to enter TCP and UDP network timer settings.


How do I set the APN with AT Commands?

how-do-i-set-the-apn-with-at-commands page anchor

Refer to your device's user manual to learn how to use AT commands then issue the following command to your device's cellular modem:

Broadband IoT

AT+CGDCONT=1,"IP","wireless.twilio.com"

Narrowband IoT (NB-IoT)

AT+CGDCONT=1,"IP","iot.nb"

Setting the APN with AT commands via SMS

setting-the-apn-with-at-commands-via-sms page anchor

If you're using a device that allows sending AT commands via SMS, you can use our Commands API resource to send a machine-to-machine SMS to the SIM. You can use a command line tool such as curl or the Twilio CLI to transmit an API request which contains the AT command shown above.

(warning)

Warning

Many devices do not support setting the APN via SMS. Refer to your device's user manual to see if this action is permitted and how to format the message.


How do I set the APN on my iOS device?

how-do-i-set-the-apn-on-my-ios-device page anchor

The iOS UI changes in subtle ways with almost every release, so you may find the following guidance, for iOS 15, doesn't entirely match the UI on your device. However, it should help you find the setting you need.

  • If your phone's language setting is English (US/Canada), then go to Settings > Cellular > Cellular Data Network.
  • If your phone's language setting is English (UK), then go to Settings > Mobile Data > Mobile Data Network.
  • For other languages, use the appropriate menu path.
  • Tap APN and enter wireless.twilio.com under Cellular or Mobile Data, and LTE.
  • Leave the Username and Password fields blank.

How do I set the APN on my Android device?

how-do-i-set-the-apn-on-my-android-device page anchor

Depending on which version of the Android OS is running on your phone, you set the APN by doing the following:

  1. Go to Settings > More networks > Mobile networks > Access point names.
  2. Tap the menu or + icon to edit an access point.
  3. Enter wireless.twilio.com under APN.
  4. Tap your new Twilio APN to set it as your active APN.

Verify you're connected to the network

verify-youre-connected-to-the-network page anchor

You will know your APN is correctly set if you can send and receive data. Open your favorite web browser and navigate to www.twilio.com/wireless. You're all set if you can load the web page. If the page doesn't load, review the instructions above for setting the APN.

(information)

Info

For more information about using the Programmable Wireless API's Command resource, please see the API documentation.


TCP and UDP network timers

tcp-and-udp-network-timers page anchor

When configuring your device, you may be asked to enter any or all of the following timeout settings. Please use the recommended values.

Timer NameRecommended ValueDescription
Firewall TCP Timer1800 secondsFor mobile-originated communications, this is the amount of time before the network firewalls terminate Transmission Control Protocol (TCP) connections due to inactivity.
Firewall UDP Timer30 secondsFor mobile-originated communications, this is the amount of time before network firewalls terminate User Datagram Protocol (UDP) connections due to inactivity.
Firewall ICMP Timer10 secondsThis is the amount of time before network firewalls terminate Internet Control Message Protocol (ICMP) due to inactivity.
NAT TCP Timer300 secondsThis is the amount of time before the Network Address Translation (NAT) router releases the address translation for TCP packets due to inactivity.
NAT UDP Timer60 secondsThe amount of time before the NAT router releases the address translation for UDP packets due to inactivity.

The Twilio Commands phone number

the-twilio-commands-phone-number page anchor

Machine-to-machine SMS Commands sent from Twilio to your SIM will arrive from the reserved phone number 2936.

Commands sent from your SIM to Twilio must be sent to the same number.

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.