Getting Started with Sigfox

This guide teaches you how to get started using Sigfox with Atmosphere. This includes creating an NXP Rapid IoT project, setting up a Sigfox click element, connecting the Sigfox Cloud to Atmosphere Cloud, and then viewing Sigfox data in Atmosphere.

This guide demonstrates a simple project that reads temperature and sends the current floating point temperature value to Atmosphere via Sigfox.

Prerequisite: You should already have an Atmosphere account.

Hardware Requirements

  • NXP Rapid IoT Kit
  • Tablet or smartphone mobile device
  • Sigfox Click Board (Sigfox 2 Click Board if in North America)
  • Optional: Sigfox Network Emulator if you aren’t within a Sigfox coverage area

For the purposes of this guide, we used the NXP Rapid IoT Kit, but any Atmosphere-supported development board that can use the Sigfox Click Board will work.

Software Requirements

  • Atmosphere IoT app. The mobile app allows you to view your registered devices and display and run the project’s interface. You can download the Atmosphere IoT app from its downloads page or through the Apple App Store or Google Play Store.
  • Atmosphere IoT Agent. The Atmosphere IoT Agent is a local application that runs in the system tray and acts as an intermediary between the computer’s connectivity protocol drivers and the browser running Atmosphere, used to assist in programming your device. You can download the Atmosphere IoT Agent from its downloads page.
  • Ensure Bluetooth is enabled on the mobile device you’ll use to interact with the NXP Rapid IoT Kit.

Step 1 of 8: Connecting Sigfox Cloud to Atmosphere Cloud

Before a Sigfox device can be used in Atmosphere, the Sigfox Cloud must be configured to forward data to Atmosphere Cloud.

  1. Get your API Key by going to the profile area in the Atmosphere IoT platform. Click on your account name in the top right and in the drop down menu select “Profile”. In your account profile you will find an area labeled “API Tokens”. If you do not already have a token generated you can do so by clicking the “Generate API Token” button. You should then have a token number displayed in the list below. This will be the token you will use to give Sigfox cloud the ability to push data into your account.

  2. Create a callback function for your Device Type

    • In the Sigfox Cloud, navigate to the Device Type page and Edit the Device Type containing your Sigfox Click
    • Click on the Callbacks tab and then click New to create a new callback. Click Custom Callback for the callback type.
    • Paste https://platform.atmosphereiot.com/user/things/protocols/sigfox/hook/null/null/null for the URL Pattern field. NOTE: Replace platform.atmosphereiot.com with the server you’re building your project on. For example, if you’re using the NXP Rapid IoT Studio, your url would be https://rapid-iot-studio.nxp.com/user/things/protocols/sigfox/hook/null/null/null.
    • Change the HTTP Method to POST
    • Add a new header with key api_auth_token and paste your API key you copied from step one into the value field
    • Set Content type to application/json
    • Set Body to
       {
       "device" : "{device}",
       "data" : "{data}",
       "time" : {time}
       }
      
    • Click Ok

    Your Callback configuration should resemble the following: Sigfox Callback Configuration

Step 2 of 8: Create a New Project

Navigate to Atmosphere Studio from the side menu. When you visit Studio for the first time in a session, you are brought to the Studio Projects screen.

  1. Click theNew Projectbutton. This displays a New Project window.
  2. Give the project a name. Then select the NXP RapidIoT project type and click Create.

This opens a new project in Studio.

This guide walks through the step-by-step process to perform actions in Studio, but doesn't cover the in-depth aspects of Studio itself. To learn more about using Studio, its areas and features, and Studio elements, visit the Atmosphere Studio section.

Step 3 of 8: Create the Project’s Embedded Firmware

The first aspect of building this sample project is adding elements to Embedded View to create the project’s embedded firmware. This involves setting an interval to read embedded data, and to tell the interval to read the onboard Temperature sensor of the NXP RapidIoT Kit.

  1. Add the following elements to the canvas by double-clicking them in the Element Toolbox:
    • Interval ElementInterval element: The interval element sets the project to run at the time set in the element’s properties, which by default is set to once per second (1000 ms). Change the Interval property to 30000 (30 seconds). The Sigfox network is designed for infrequent, small packets of data. Sending data any more frequently than 20 seconds is not recommended and may cause malfunction.
    • AMS ENS210AMS ENS210 element: The AMS ENS210 Element reads the onboard temperature sensor.

      Note: The Interval property must be changed to 30000 (30 seconds).
  2. Import the Sigfox Click element from the Element Library
    • Sigfox Click Element Sigfox Click element: The Sigfox Click element communicates with the Sigfox Click board and sends Sigfox data over the network.
    • Default properties will be sufficient if you’re connected to the Sigfox network in the United States. If you’re connected to a Sigfox Emulator, enable the “Use Public Key” property. If you’re not in the United States, set the “Network Standard” appropriately.
    • The Sigfox click, by default, assumes that the click board is inserted into Slot 3 of the docking station. If it’s in a different slot, adjust the pin properties accordingly.
  3. Connect the interval element to the AMS ENS210 element. This creates an event between them, which can be seen in either the interval element’s properties, or by clicking the connector’sConfiguration Buttonbutton. The event added is within the Interval trigger, with the AMS ENS210 ability Read Temperature (C). This means that when the interval element is triggered (which is every second), it will read the current temperature.
  4. Connect the AMS EMS210 Element to the Sigfox Click Element. Ensure that the trigger for the AMS210 Element is “Temperature Read” and the ability to be executed on the Sigfox Click Element is “Send Payload”. This means that whenever the temperature is read from the AMS210 Element, that temperature will be sent as a payload over the Sigfox network.

That’s all for work in Embedded View. The Embedded View canvas should resemble the following image:

Sigfox Demo Canvas

Step 4 of 8: Enable the Project’s Cloud Connectivity

The third aspect of building this sample project is to enable it for cloud connectivity. When a Sigfox Click Element is dragged onto the Embedded Canvas, a coupled Sigfox Click Cloud Element is inserted into the Cloud View. This allows the user to retrieve data sent from the Sigfox Cloud and use it within the Atmosphere Cloud.

  1. Click Cloud View to move to the cloud area of the project. Notice how the Element Toolbox has changed, and that the coupled Sigfox element is displayed on the canvas.
  2. Add aCloud Storage Elementcloud storage element to the canvas, and connect the cloud storage element to the Sigfox element. This allows Atmosphere to store data sent to it from the connected Sigfox element.

That’s all for creating the project! With the added cloud connectivity, the project will send the temperature to the Sigfox Cloud every 30 seconds. The Sigfox Cloud will then send this data to the Atmosphere Cloud where it will be stored.

The final canvas for the cloud view should resemble the following:

Sigfox Demo Cloud Canvas

Step 5 of 8: Compile the Project

Once the project is finished, it needs to be compiled. Compiling readies the entire project’s source code for deployment.

  1. From any view, click theCompilebutton in the project options menu on the top-right of the screen. You’ll see a loading graphic on the screen, and will receive a notification when the project is compiled.

Step 6 of 8: Program Firmware into the Device

With the project compiled, your NXP RapidIoT Kit can be programmed with the project’s embedded firmware.

  1. Ensure the NXP RapidIoT Kit is connected to the computer via USB and in programming mode (blinking green LED). If it’s not in programming mode, hold the Top Left and Bottom Right buttons for 5 seconds, it will reboot into programming mode and show up as a USB Mass Storage device.
  2. click the Program Firmware button from the Embedded View toolbar and save the firmware .bin to the USB Mass Storage Device.

Step 7 of 8: Register the Device

With firmware installed, the device can now be recognized and connected to Atmosphere. From here, open the Atmosphere IoT app on your mobile device. We’ll use the mobile app to both register the device, and eventually view the label data on the project’s interface.

To register a device:

  1. Navigate to the Devices page, and click theRegister Devicebutton in the top-right to display the Register Devices window. When the window opens it will automatically begin scanning for available devices within range.
    • Ensure your NXP RapidIoT Kit is within range from the device you are attempting to register from, otherwise it may not appear.
  2. The list of available devices appears. Select your device you just programmed and click Register.

The device is registered to Atmosphere and displayed on your Devices page.

Step 8 of 8: View Device Data

Now that the device’s data is sent to Atmosphere, let’s view it through one of the many device dashboard widgets available. In this guide we’ll use a data table to chart the temperature reading.

  1. To add a widget to the device’s dashboard, click theConfigurationbutton on the side of the page. This displays the menu of available widgets. Select theData Tabledata table widget to add a table to the dashboard.
  2. Give the data table a name, and then select the CloudStorage for the table’s data.

This populates the data table with the values of the temperature as time progresses.