Connecting the SmartEverything to thethings.iO with Sigfox

In today’s post we are going to show you Step by Step how to connect the SmartEverything board to thethings.iO with SigFox technology. If you need to visualize Sigfox data through an IoT dashboard or analytics you can use thethings.iO.

During this tutorial you will need:

  • A SmartEverything board.
  • A button (optional)
Smart Everything shield

Smart Everything shield

Now, make sure you have an account at thethings.iO. If not, register quickly by clicking here.

Once you have done this, you can start with this Step by Step.

Step 1: Preparing the environment

First you need the Arduino software installed. After that, open the Arduino IDE and go to Tools > Boards Manager. On the search box, search and install the Arduino Zero core and the AMEL-Tech Boards.

Now, select the Smart Everything FOX (Native USB) board at Tools > Boards > Smart Everything FOX (Native USB).

 

Arduino-SmartEverything-Board

You will need to install 3 libraries, go to Sketch > Include Library > Manage Libraries and search and install the next libraries: SE868 (for the gps), HTS221 (for the temperature and humidity) and LSM9DS1 (for the 3d accelerometer).

If you want to use the other sensors, you can find the list of the libraries at https://github.com/ameltech.

 

Arduino-SmartEverythingLibrary

Step 2: Sending Values

Now, it is time to code the board! Go to our github example, copy the code and paste it into a new sketch.

arduino-ide

Then click on upload in order to install the code on the board.

Consider reading our previous post about connect Sigfox to the IoT platform thethings.iO before step 3-4. It contains a video showing those steps.

Step 3: Connecting Sigfox to thethings.iO

In order to receive the data from Sigfox, you’ll need to redirect all the messages using a callback from our Sigfox profile. You’ll need to configure our thethings.io profile for this:

    1. Navigate to Things Manager
    2. Create a new IoT product: Insert your product name, select the Smart Everything board and the Sigfox format.sigfox-new-product
    3. Go to the product page by clicking to the created product at the products list.
    4. At the top left, there is a details box with a Subscription URL that we will have to copy.subscription-url
    5. Navigate to the Sigfox backend webpage to activate the smarteverything board by selecting the smarteverything and the network. Next, fill out the form with the Sigfox ID and the PAC. You will find both at the back of your device. Last but not least, you will have to fill out the registration form so you will be able to access the Sigfox backend with your own email and password.
    6. Log in and go to Device. You will see a list of your devices. Select the one that you have just added, take a look at the sidebar and click on Callbacks.
    7. Click New (placed Top-Right)

sigfox-callbacks-list-thethings

  1. Choose the following configuration:
      1. Type: DATA UP-LINK.
      2. Channel: URL.
      3. Url pattern: Paste your previous subscription URL from thethings.iO.
      4. Use HTTP method: POST and click Ok.

    sigfox-callback-thethings

Step 4: Parsing data from Sigfox

Now go to thethings.iO IoT platform and you will need to specify how to parse the data that Sigfox forwards to thethings.iO, in order to display the correct values:

  1. Go to Cloud Code
  2. Navigate to Functions and Edit the parser with the name that you gave before.
  3. Parse your resources by splitting the string that Sigfox sends (An hexadecimal number containing all the sensor values, one after the other).
  4. In the preview input, copy the sigfox payload that you send from Sigfox and change “quote” to “data” to prove your function.

You can find the parser code here.

Step 5: Creating the dashboard Widgets

It’s time to create an IoT Dashboard with thethings.iO to show all the values of your sensors!

    1. Click on Add widget.
    2. Introduce a name for the widget.
    3. Select Thing Resource.
    4. Select Sigfox.
    5. Select your thing Token.

thethings-widget-sigfox

  1. Select the resource that you want to show.
  2. Select how you want to show your resource (Lines, bars, log…)

Repeat this process until you finish your awesome IoT Dashboard!

thethingsio-dashboard

 

And that’s it! Isn’t it easy? Connect Sigfox devices from now with thethings.iO and get cool customizable IoT Dashboards as the one we have shown you here.

And do not forget to follow us on Twitter in order to keep you posted about the IoT World and the latest news of thethings.iO.