Sigfox

Introduction

If you want to build your IoT projects using SIGFOX communications technology in your devices, right now you can do it.

SIGFOX is the first company providing global cellular connectivity for the Internet of Things, fully dedicated to low-throughput communications. SIGFOX is re-inventing connectivity by radically lowering prices and energy consumption for connected devices.

The SIGFOX connectivity solution is based on an antenna and base station infrastructure that is completely independent from existing networks, such as telecommunications networks. This low-throughput only network will be rolled out in 60 countries within the next five years.

In this guide you will learn how to use a low-cost communications model with SIGFOX and integrate it with Carriots to build your IoT projects.



How to use Carriots adaption

In Carriots we have prepared a special URL to receive data from SIGFOX Cloud. Just send a POST request with some parameters.

Post

Send data to Carriots

URL: http://sigfox.carriots.com/streamforms
HTTP method: POST

Parameters:

Attribute Description
apikey (mandatory) Your Carriots apikey.
This apikey will be used to fully determine privileges and visibility for the request within Carriots platform
protocol (mandatory) Comunication protocol. Used for checksum purposes.
Example: v1
at (mandatory) Unix timestamp (UTC) or "now". When "now" is used, Carriots will fill "at" value with reception date timestamp.
Examples: 1340001190 or "now"
device (mandatory) Carriots device unique identifier.
Example: d0001@carriots
data (mandatory) Array.
Example: data[hum]=7

Response codes:

Code Description
200 OK
{"response":"ok"}
401 Error
{"response":"error message"}
404 Resource not found
503 Service unavailable.

Example:



SIGFOX Cloud

In this example we have one SIGFOX device that sends an aleatory value to SIGFOX Cloud. We have to set up a "callback" to forward the data to Carriots.

Login

Enter SIGFOX Cloud backend.

  • Log in

On the top black banner, you can access functional items of your environment. In SIGFOX we have a two-level hierarchy:
- Device: Your objects
- Device type: Your objects families

Device

We have one device named "Starter kit"

  • Device

And this is the information sent by the device

  • Messages

Callback - Introduction

SIGFOX Cloud can automatically forward some events using the "callback" system. The configuration of callbacks is done in the "Device type" page, so "callbacks" are defined by objects families.
The callbacks are triggered when a new device message is received or when a device communication loss has been detected.

Callback types

There are 3 different callback types (data, service and error). You have a set of common variables available and a set of specific variables for each type of callback. These variables are replaced by their value when a callback is called.

  • DATA

    This callback type defines the reception of a user message from a device. Specific variables:

    Variable Description
    rssi The RSSI (in dBm – Float value with two maximum fraction digits). If there is no data to be returned, then the value is null
    data data: the user data (in hexadecimal)
  • SERVICE

    This callback type defines the reception of an operational message from a device.

  • ERROR

    This callback type defines the communication loss for a device. Specific variables:

    Variable Description
    info Information on error, in case of communication loss, contains the last received message date of the device
    severity "ERROR" when it is a device problem, "WARN" when the network has experienced some issues that could cause some message loss or delay
  • Common variables

    Common variables available:

    Variable Description
    time The event timestamp (in seconds since the Unix Epoch)
    device Device identifier (in hexadecimal – 4 characters <=> 2 bytes)
    signal The signal to noise ratio (in dB – Float value with two maximum fraction digits)
    avgSignal The average signal to noise ratio computed from the last 25 messages (in dB – Float value with two maximum fraction digits) or N/A. The device must have send at least 15 messages
    station The base station identifier (in hexadecimal – 4 characters <=> 2 bytes)
    lat The latitude, rounded to the nearest integer, of the base station which received the message
    lng The longitude, rounded to the nearest integer, of the base station which received the message

If you want to send these variables, they must be enclosed in braces.
Example: {time}



Set up SIGFOX to send information to Carriots

Create a new Callback

The first step is to create a new "callback".
To do this, go to the list of device types and select one of them.

  • Device type - List

After selecting the "device type", click on menu item "Callbacks"

  • Device type - Information

In the "callbacks" window you can create a new callback or edit an existing one. In our case we will create a new callback with the following information:

  • Type: DATA
  • Channel: URL
    (Defines the way to forward the event)
  • Send duplicate: Empty
  • Url pattern:
    http://sigfox.carriots.com/streamforms?apikey=YOUR CARRIOTS APIKEY&protocol=v1&at=now&device=YOUR CARRIOTS DEVICE NAME&data[value]={data}
    (You must specify between braces the SIGFOX variables you want to send)
    You can add in data field, many fields as desired. Example: data[hum]=7&data[temp]=24&data[value]={data}
  • Use HTTP POST: Checked

Save the new Callback

  • New callback


Check SIGFOX Cloud

That's it, now we just have to send data and verify that they have received it in SIGFOX. Then the callback will be executed and the information is sent to Carriots.

Device messages

Go to "Device", select your device and click on "Messages" option

  • Device - Messages

If everything works correctly, you will see a green arrow (indicating that the callback is executed correctly) in the "Callbacks" column. When you click on it you will see the Carriots response.

  • Callback response


Check Carriots

Its time to test our Carriots control panel and check if we have new streams.

Carriots Data Streams

Log in Carriots, go to “Data → “Data streams” and you will see your data.

  • menu option
  • new data

From here on

Enjoy all the Carriots features and make your IoT project easily. Want to know more? visit What is Carriots