Sigfox is a relatively new low-cost wireless network technology that requires low power to connect, and that is implemented by lost cost hardware modules. Although they are limited in terms of the size of messages (12 bytes maximum) and the frequency that the devices can send out data (140 times a day), several new applications can be achieved with Sigfox. More information about how Sigfox works can be found here.

TagoIO is ready to receive data from and send data to Sigfox devices. There are three types of interface methods used between Tago and Sigfox services. Uplink is the process to send data from the modules to Tago. The Downlink is used to send data back to the module every time it checks in – the data to be sent down should be ready prior to the check-in. And the last method is the Error, that informs when there is a communication loss for any Sigfox module.

Adding your own Sigfox module to TagoIO is very easy to be accomplished; just follow the steps described below to setup the configurations at the Sigfox Backend and TagoIO.

Uplink

You need to prepare the uplink in order to send data from you Sigfox module to Tago. The uplink configuration will be separated into two parts: TagoIO configuration, and Sigfox configuration using the Sigfox Backend Portal.

TagoIO setup

In your account, you need to create a Device, and a Device-Token to receive data from the Sigfox portal. By selecting the device type: Sigfox and entering the information below, the device-token will be automatically created.

Sign in your account at TagoIO, and follow these steps:

1. Click on Device button;
2. Click on "Add Device" button;
3. Look for "Sigfox" and select it;
4a. In the field "Device Name", add any name to your device;
4b. In the field "Sigfox Device ID", add your Sigfox Device ID;
4c. [Optional] In the Verification-code field enter any secret text. You should type be the same you will enter in the Sigfox callback header field.
5. Click on the Create Device button.

The Verification Code field is not required, but it adds security to your integration. If you add here, you need to use the same text in the Verification code field inside your Sigfox callback function.

Sigfox Setup

On the Sigfox Backend Portal, you need to create a callback type uplink.

Sign in your Sigfox account, and follow these steps

1. Click on Device Type;
2. After clicking the Device type, the list of your devices will appear, choose one;
3. Click in the Callback button;
4. Click the New button;
5. Select the option Custom callback;
6. Configure the uplink.

CALLBACK CONFIGURATION

- Type:  DATA & UPLINK
- Channel: URL
- URL pattern: https://sigfox.middleware.tago.io/uplink
- Use HTTP Method: POST
- Send SNI: Check the box "Send SNI".
- Headers: Add two rows in the Headers section inside the header and value fields:

 header value
 device 
 {device}
 Required. Enter text exactly as showed.
 verification-code
your_secret_code_here

For example, it can be your company name or any other word.
[Optional] Use the same text input during the device creation at TagoIO.

- Content-type: application/json
- Body: Copy and paste the JSON text below into the body field. This JSON will take care of the parse to prepare the data coming from your Sigfox module to TagoIO.

[{
    "variable": "device",
    "value": "{device}",
    "serie": "{time}"
},{
    "variable": "duplicate",
    "value": "{duplicate}",
    "serie": "{time}"
},{
    "variable": "snr",
    "value": "{snr}",
    "serie": "{time}"
},{
    "variable": "rssi",
    "value": "{rssi}",
    "serie": "{time}"
},{
    "variable": "avgSnr",
    "value": "{avgSnr}",
    "serie":"{time}"
},{
    "variable": "station",
    "value": "{station}",
    "serie": "{time}"
},{
    "variable": "data",
    "value": "{data}",
    "serie": "{time}"
},{
    "variable": "seqNumber",
    "value": "{seqNumber}",
    "serie": "{time}"
},{
    "variable": "location",
    "serie": "{time}"
}]

You uplink setup screen will look like the image below:
https://cdn.elev.io/file/uploads/PEfBOej3wR4slKcXFF0VfOndFuEYx_C9vFdA35csXyc/nKpyCuHkPQHRNcjTVAQf2Z9Mp7fPcyy5pGukHtYhSME/imageedit_1_7773996159-Y1U.png

Downlink Setup

The downlink serves to send responses from Tago to Sigfox, ensuring that the data transition is working correctly. The downlink configuration will be separated into two parts: (1) TagoIO configuration, and (2) Sigfox configuration using the Sigfox Portal.

TagoIO setup

1. Find your device that  you just created by clicking on the Device (left menu), go to it, and click on the tab "Configuration parameters";
2. Create a parameter for your device;
A. In Key of the parameter, you should type downlinkData
B. The message that you want to send to your Sigfox device goes in the Value, and must contain up to 8 bytes;
C. Click on Save button.

You  setup screen will look like the image below:
https://cdn.elev.io/file/uploads/PEfBOej3wR4slKcXFF0VfOndFuEYx_C9vFdA35csXyc/7ThxlrKR8sRQAD1Nzy4O7J4C_NqBl4eD1yAEk4Ye50k/downlink_tago_create_param-Ckk.png

Sigfox setup

Go to the sigfox portal and perform the following steps:

1. Click on Device Type;
2. After clicking Device type, the list of your devices will appear in Sigfox, choose one;
3. Click in the Callback button;
4. Click the New button;
5. Select the option Custom callback;
6. Configure the downlink.

https://cdn.elev.io/file/uploads/PEfBOej3wR4slKcXFF0VfOndFuEYx_C9vFdA35csXyc/-q7QR1gt0O-VYZX8JlXRSkGUPjADheJeTMXYFg5wSv8/imageedit_2_3407061163-1dU.png

CALLBACK CONFIGURATION

- Type:  DATA & UPLINK
- Channel: URL
- URL pattern:
 https://sigfox.middleware.tago.io/downlink
- Use HTTP Method: POST
- Send SNI: Check the box "Send SNI".
- Headers: Add two rows in the Headers section inside the header and value fields:

 header value
 device 
 {device}
 Required. Enter text exactly as shown.
 verification-code
 your_secret_code_here

For example, it can be your company name or any other word.
 [Optional] Use the same text input during the device creation at TagoIO.

- Content-type: application/json
- Body: Copy and paste the JSON text below into the body field. This JSON will take care of the parse to prepare the data coming from your Sigfox module to TagoIO.

[{
    "variable": "device",
    "value": "{device}",
    "serie": "{time}"
},{
    "variable": "duplicate",
    "value": "{duplicate}",
    "serie": "{time}"
},{
    "variable": "snr",
    "value": "{snr}",
    "serie": "{time}"
},{
    "variable": "rssi",
    "value": "{rssi}",
    "serie": "{time}"
},{
    "variable": "avgSnr",
    "value": "{avgSnr}",
    "serie":"{time}"
},{
    "variable": "station",
    "value": "{station}",
    "serie": "{time}"
},{
    "variable": "data",
    "value": "{data}",
    "serie": "{time}"
},{
    "variable": "seqNumber",
    "value": "{seqNumber}",
    "serie": "{time}"
},{
    "variable": "location",
    "serie": "{time}"
}]

Your integration is completed. 

You may need to code a script to parse the payload that your device sends to TagoIO in order to extract the measured variables. To know more click here.