Sony Spresense with LTE Extension Board Setup Guide

In this guide, we will set up and configure a cellular connection for the Sony Spresense with LTE Extension Board in order to send data to the Soracom platform.

Sony Spresense Connectivity Kit Contents

Requirements

To follow along with this guide, you will need the following:

In order for the LTE extension board to connect to a cellular network, you will need to be located in an area where LTE Cat-M1 (LTE-M) connectivity is supported by the Soracom IoT SIM card. To check network coverage, please refer to Supported Carriers page.

Important! Connecting your Spresense board to a USB Type-C port, AC adapter, or battery using a USB adapter may result in the board being supplied with a voltage that exceeds its voltage limit, which may destroy the Spresense board. Ensure that your USB port will provide no more than 5V (±0.25V) before continuing. For more information, refer to the Spresense Hardware documentation.


Hardware Setup

Insert the Soracom IoT SIM Card

  1. Carefully remove the Soracom SIM card from its packaging.

    Remove Nano SIM

    The plan01s SIM is a 3-in-1 design that allows you to conveniently break out the SIM card into standard/mini (2FF), micro (3FF), and nano (4FF) form factors. As the Spresense LTE Extension Board uses the nano (4FF) size, take care to remove the nano SIM card size when removing it from its packaging.

  2. Insert the SIM card into the SIM slot located on the rear of the Spresense LTE Extension Board, paying attention to the orientation notch.

    Insert SIM

    Insert SIM

Attach the Main and Extension Boards

The Spresense Main Board and LTE Extension Board are connected using a board-to-board connector.

  1. Attach the four spacers included with the LTE Extension Board.

    The spacers help to ensure that the board-to-board connector is aligned correctly and to prevent damage due to uneven pressure. However, please note that when using the included spacers, the main board may become difficult to remove from the extension board once attached.

    If you prefer to use standoff nuts and screws (not included) to attach the main and extension boards, please be aware that metallic hardware may interfere with the GNSS receiver located on the main board. Make sure to use non-metallic hardware (such as nylon) to avoid interference.

  2. Attach the Spresense Main Board to the LTE Extension Board by lining up the main board with the spacers.

    Connect Main and Extension Boards

    If any of the LTE Extension Board functions (such as LTE connection, micro SD card, or audio) do not work or seem to work improperly, the board-to-board connector may not be fitted correctly. Gently remove the main board from the extension board, then try reattaching the boards again.

    If you experience issues attaching the Main and Extension Boards, refer to the Spresense Hardware documentation for additional details on attaching the LTE Extension Board.

Connect the Spresense to your Computer

In order to program the Spresense Main Board, you will need to connect it to your PC.

  1. Connect a micro-USB cable to the micro-USB connector located on the Spresense Main Board.

    When using the LTE Extension Board, you can use the micro-USB connector on the extension board to power your Spresense. However, in order to program the main board, you must connect the Spresense to your computer using the micro-USB connector located on the main board.

    Connect Main Board to USB

  2. Connect the other end of the micro-USB cable to your computer. The power LED located on the main board should turn blue to indicate that the Spresense is now turned on.

Note that during operation, the LTE module on the LTE Extension Board may consume up to 1.2A of current during cellular communication. To ensure a reliable connection, make sure to use a USB port or power supply that is capable of supplying at least 1.5A. If your USB port or power supply cannot supply sufficient current, you can connect the other micro-USB connector to another USB port or power supply. For more information, refer to the Spresense Hardware documentation.


Software Setup

Install USB Serial Drivers

When using Windows or macOS, download and install the USB serial drivers that correspond to your operating system from the following links:

When using Ubuntu Linux (64-bit), installing extra drivers is not necessary.

Install Arduino IDE

Download and install the latest version of Arduino IDE from the official Arduino Software site.

Install Spresense Board Definitions

In order for Arduino IDE to compile your code, you need to install the Arduino Spresense board definitions.

  1. Start Arduino IDE.

    On Windows, you may receive a security alert when you run Arduino IDE for the first time. Ensure that you enable firewall exceptions for Arduino IDE for both private and public networks.

  2. From Arduino IDE, click File Preferences. Open Arduino IDE preferences

  3. Copy and paste the following URL to the Additional Boards Manager URLs field, then click OK:

    https://github.com/sonydevworld/spresense-arduino-compatible/releases/download/generic/package_spresense_index.json

    Add Spresense Board definition URL

  4. Next, from Arduino IDE, click Tools Boards Boards Manager....

    Manage Boards

  5. Search for Spresense Reference Board (by Spresense Community), and click Install.

    Install Spresense Board definition

  6. Once the installation is complete, click Close.

Select the Spresense Board and Port

Next, let's tell Arduino IDE that our program should be compiled for our Spresense board, and select the port where our Spresense board is attached.

  1. From Arduino IDE, click Tools Boards Spresense.

    Select Spresense Board and Port

  2. Connect the Spresense main board to your computer.

  3. From Arduino IDE, click Tools Port, then select the port that corresponds to your Spresense.

Install the Bootloader

Last, if you are using your Spresense board for the first time, or if you have updated to a newer version of the Spresense Arduino library, we need to install a bootloader that will allow us to program the Spresense main board.

  1. From Arduino IDE, click Tools Programmer Spresense Firmware Updater.

    Spresense Firmware Updater

  2. Click Tools Burn Bootloader.

    Burn Bootloader

  3. Review and accept the End User License Agreement by following the dialog.

    Accept Bootloader EULA

Once the bootloader installation is done, you should see a message like this:

Bootloader installation complete

You are now ready to begin programming your Spresense main board.

If you encountered any errors, refer to the Spresense Getting Started Guide for additional details on setting up your Spresense.


Testing Your Spresense

To verify that your Spresense is set up correctly and can be programmed, we can compile and upload the following example Arduino sketch, which will simply blink the LEDs in a pattern.

  1. Copy and paste the following example LED test code into a new sketch:

    void setup() {
        pinMode(LED0, OUTPUT);
        pinMode(LED1, OUTPUT);
        pinMode(LED2, OUTPUT);
        pinMode(LED3, OUTPUT);
    }
    
    void loop() {
        digitalWrite(LED0, HIGH);
        delay(100);
        digitalWrite(LED1, HIGH);
        delay(100);
        digitalWrite(LED2, HIGH);
        delay(100);
        digitalWrite(LED3, HIGH);
        delay(1000);
    
        digitalWrite(LED0, LOW);
        delay(100);
        digitalWrite(LED1, LOW);
        delay(100);
        digitalWrite(LED2, LOW);
        delay(100);
        digitalWrite(LED3, LOW);
        delay(1000);
    }
  2. Build and upload the LED test sketch by clicking Upload.

Once the sketch has been uploaded, your Spresense should automatically reboot and the LEDs should start blinking sequentially, confirming that your Spresense is set up correctly and has been successfully programmed.

If the LEDs do not blink, refer to the Spresense Getting Started Guide for additional details on setting up your Spresense.


Connecting to Soracom

With your Sony Spresense with LTE Extension Board set up, you are now ready to connect to a cellular network. In this section, we will enable the Soracom Harvest Data service for our Soracom SIM which provides a simple way for us to collect data from our Spresense, then we will test sending some sample data.

Many services, including Harvest Data, are linked to groups. Groups let us manage multiple SIM cards together. When we enable Harvest Data for a particular group, all of the devices (SIMs) that belong to that group will automatically be able to use Harvest Data. That way we can easily add more devices to the group without having to enable Harvest Data for each SIM individually.

To set everything up, we will need to perform the following steps:

If you have not already done so, take a moment to follow the instructions in the SIM Registration documentation to register your Soracom IoT SIM card to your account.

Create a Group

Let’s first create a group for our SIM card.

  1. If you’re not already logged in, open https://console.soracom.io again and login using your email address and password.

  2. From the list of SIM cards in your account, click the checkbox next to your SIM card.

  3. Then click the Actions menu, and select Change group.

    https://console.soracom.io

    Change group

  4. We don’t have any groups yet, so let’s create one. Click the dropdown menu, and select Create group….

    Change group

  5. In the popup, give the group a name, such as Harvest Group, then click Create.

    Create group

  6. Our group has been created. Now let’s click Update to set our new group for our SIM card.

    Update group

Enable Soracom Harvest

Next, let’s enable Soracom Harvest for our new group.

Soracom Harvest Data is a paid service. A free tier is available which allows you to use Harvest for free with 1 SIM each month, which should be sufficient to allow you to test and verify that you can successfully configure your Spresense. Once you have completed setting up your device, we recommend turning off the Harvest service in order to avoid unwanted charges.

Please note that Harvest Data provides a free tier, sending and receiving data over the cellular network will still incur data usage fees.

Refer to the Pricing & Fee Schedule for more information.

  1. Click the name of the group underneath the Group column. This will open the group configuration page.

    https://console.soracom.io

    Open group

  2. Click the SORACOM Harvest Data panel to expand Harvest settings.

    https://console.soracom.io

    Group settings

  3. Click the toggle switch to turn Harvest ON, then click Save.

    Harvest settings

All done!

Send Test Data to Harvest

Now let's program our Spresense to connect to a cellular network and send some sample data to Harvest Data.

  1. Copy and paste the following example code into a new sketch:

  2. Connect your Spresense Main Board to your computer, then click the Upload button to compile and upload the sketch to your Spresense.

Once the upload is complete, open the Serial Monitor to check the output of the program. Click Tools Serial Monitor. You should be able to see your Spresense connect to a cellular network and upload sample data. If you see a 201 response from Harvest Data, then you have successfully configured your Spresense to send sensor data to the cloud using a cellular connection!

Verify the Test Data

Finally, let's head back to the User Console to check out the test data online.

  1. On the User Console, click the Menu button, and select SIM Management.

  2. Click the checkbox next to your SIM card. Then click the Actions menu, and select Harvest Data.

    https://console.soracom.io

    Device list

You should be able to see the Hello Soracom! test data stored in Harvest Data.

For additional information on using Harvest Data, refer to the Harvest: Configuration and Harvest: Viewing Data documentation.


Troubleshooting

If you have trouble sending data from your Spresense, the following troubleshooting steps may help you identify any potential issues. even you could successfully see the LED (green) blinked in Verify the setup part, please check below for further troubleshooting.

Confirm that your Spresense can be programmed

Follow the steps in the Testing Your Spresense section to confirm that your Spresense has been set up correctly and that you are able to program it with the sample LED blinking pattern.

If you are unable to program your Spresense, you may need to retry the setup instructions steps in the Software Setup section again.

Confirm that the LTE Extension Board is attached correctly

The Spresense Arduino library includes a LteTestModem sketch which you can use to check that the LTE Extension Board is attached correctly. This sketch will read the IMEI and firmware version of the LTE modem and output it to the Serial Monitor.

  1. From Arduino IDE, click File Examples Examples for Spresense LTE LteTestModem to open the example sketch.

  2. In Tools Port select the COM port of your Spresense.

  3. Build and upload the example sketch by clicking Upload.

  4. Click Tools Serial Monitor and set the baud rate to 115200 baud.

You should be able to see a message similar to the following:

Starting modem test...
modem.begin() succeeded.
IMEI: 350000012345678
VERSION: RK_03_00_00_22_13151_002
RAT: LTE-M (LTE Cat-M1)

If you cannot see the message, there might be the problem in the board-to-board connection between the Spresense Main Board and the LTE Extension Board. Carefully disconnect and reattach the boards and try again.

Confirm that the Spresense can connect to a cellular network

The Spresense Arduino library also includes a LteScanNetworks sketch which attempts to connect to a cellular network and outputs cellular network connection information, including IP address, signal strength, and network carrier name, to the Serial Monitor.

  1. From Arduino IDE, click File Examples Examples for Spresense LTE LteScanNetworks to open the example sketch.

  2. In Tools Port select the COM port of your Spresense.

  3. Build and upload the example sketch by clicking Upload.

  4. Click Tools Serial Monitor and set the baud rate to 115200 baud.

By default, the sketch does not include the necessary APN information and will ask you to enter it:

LTE networks scanner
This sketch doesn't have a APN information.
Enter Access Point Name:

Enter the following information in order to connect to a cellular network using your Soracom IoT SIM:

After a few moments, if the LTE Extension Board is able to connect to a network, you should see output similar to the following:

=========== APN information ===========
Access Point Name  : soracom.io
Authentication Type: CHAP
User Name          : sora
Password           : sora
attach succeeded.
IP address: 10.123.45.67
Current carrier: SORACOM
Signal Strength: -103 [dBm]

If you see an error that your Spresense was unable to get the PIN status, check that your Soracom IoT SIM is inserted correctly. If you continue to see errors, follow the steps below to contact Soracom Support to determine if your SIM card may have been damaged.

If you do not see any output that shows the cellular network connection information, you may need to check the following:


Additional Resources and Support

For complete information on Soracom User Console tools and capabilities, full documentation is available on the Soracom Developer Site.

If you run into any trouble, feel free to submit a support ticket:

  1. Login to your Soracom account.
  2. Click the Support menu and select Contact us. You will be taken to the Soracom Support portal.
  3. At the top of the portal, click the Submit a request link.