Getting Started with Super SIM and the Adafruit Feather FONA 32u4

June 03, 2020
Written by

super sim adafruit fona 32u4 header

Today, Twilio released Super SIM to public beta. Super SIM works all over the world and gives developers the ability to choose the networks that their devices connect to and monitor the data consumed by each SIM. You can order your own Super SIM through the Twilio Console and try it out.

Super SIM is versatile and works with CAT-M1, LTE, and 2G/3G networks. I tested Super SIM with a few boards I had lying around the house, including the Adafruit Feather FONA 32u4.

The Adafruit Feather 32u4 FONA pinout

The Adafruit Feather FONA 32u4 is a cellular board from Adafruit based on the Feather ecosystem that uses the Simcom SIM800H modem. (You may remember it from this tutorial on building a mailbox notifier.) It can be programmed with the Arduino IDE. Here’s how you use it with Super SIM and test that it is online with a Machine-to-Machine (M2M) command sent from the Super SIM API.

This guide requires a configured Super SIM. If you haven’t set up your Super SIM in the Twilio IoT Console, please do so now. This guide will show you how.

What you’ll need

Hardware

  • Your Twilio account. If you sign up for a new account through this link, you’ll get an extra $10 in credit when you upgrade.
  • 1x Twilio Super SIM (Activated using this tutorial)
  • 1x Adafruit Feather FONA 32u4
  • 1x Antenna
  • 1x 3.7V LiPo Battery
  • 1x USB-to-Micro-USB cable

Your materials

Firmware

Software

  • Your Twilio account
  • Your editor, terminal, and language of choice for calling the Super SIM API

Assembling your hardware

  1. Remove the Twilio Super SIM from its card. Use the 3FF Micro SIM size (middle size). Put the SIM into the card slot on the bottom of the FONA.

Super SIM and FONA
  1. Attach the antenna and battery to the FONA

Setting up your firmware

  1. Download the Arduino IDE
  2. Follow Adafruit’s instructions for setting up the Adafruit Feather FONA with the Arduino IDE
  3. Load the FONA Test sketch using Adafruit’s instructions
  4. Find the part of the sketch that talks about APNs. It should look like this:
  // Optionally configure a GPRS APN, username, and password.
  // You might need to do this to access your network's GPRS/data
  // network.  Contact your provider for the exact APN, username,
  // and password values.  Username and password are optional and
  // can be removed, but APN is required.
  //fona.setGPRSNetworkSettings(F("your APN"), F("your username"), F("your password"));

Underneath this commented-out area, add the following:

fona.setGPRSNetworkSettings(F("super"));

This line lets the FONA know to use the Twilio Super SIM APN.

  1. Connect the Adafruit Feather FONA to your computer using the USB-to-Micro-USB cable and select the correct board from Tools > Board
  2. Select the correct port from the Arduino IDE using Tools > Port
  3. Compile and upload the sketch
  4. Open the Arduino serial monitor using Tools > Serial Monitor. Set the baud rate to 115200. The FONA should boot and connect. Play with the menu. You can type i to see your signal strength, or C to read your SIM’s CCID.
  5. (Optional) Read and delete existing SMS messages by typing r to read and d to delete. Type capital R to read all messages.

Sending an SMS Command to your device

Super SIM supports a simple API for sending SMS messages to IoT devices, without the need for regional phone numbers or anything like that. We call these messages Commands to avoid confusion with Twilio’s other products.

  1. Find your SIM’s SID. It can be found in your console, or queried via the API.
  2. Either by setting up your own server or by using Twilio Functions, send an SMS Command to your device using the Command resource of the Super SIM API.
  3. Go to your Arduino serial monitor.
  4. After you send the Command, go to the serial monitor and type R to read all texts. You should have a new text from shortcode 000 containing the name of your command. Congratulations, you have just sent an SMS Command from the internet to your device!

Checking your Super SIM usage

When you send commands to your Super SIM, it takes up data. Luckily, you can monitor your data usage through the Twilio console. Here’s how:

  1. Go to Internet of Things > Super SIM > SIMs
  2. Find your Super SIM. They are listed by SID and nickname. Once you click on your SIM, you can select the Usage tab to view that SIM’s activity

Making more stuff

Keep on building! Try setting up your device for scalable MQTT commands or HTTP requests. Check out these resources to start exploring Super SIM:

Christine Sunu is the Internet of Things Developer Community Engagement Manager at Twilio. She's currently working on IoT, ambient computing, and robots that pretend to be alive. Find Christine on Twitter (@christinesunu) or Github (cmsunu28)