Sigfox
How to connect Sigfox Backend to Datacake IoT Platform
Last updated
How to connect Sigfox Backend to Datacake IoT Platform
Last updated
In this tutorial, we will show you how to integrate your Sigfox devices into Datacake.
The Sigfox network is similar to the LoRaWAN network, but you don't need gateways because there is already a nationwide network in many countries around the world that you can use for your IoT devices.
If you want to learn more about Sigfox, check out the following link.
For the connection between the SigFox backend and the Datacake IoT platform, we use the HTTP Push function, which transmits incoming data from your sensors to Datacake via a web call.
Datacake creates a custom HTTP URL for you, which you can use for all devices of a type. You must store this URL on the Sigfox backend as a callback for your device types. In this tutorial we will show you how to set this up.
Similar to the LoRaWAN integration, Datacake provides you with so-called payload decoders, which you can use to decode the payload of your SigFox sensors and convert it into useful data (for dashboards, alerts, etc.).
To make starting with SigFox on Datacake as easy as possible, we offer you a SigFox Starting Template, which pre-decodes the structure of the SigFox backend.
If you have not yet registered on the Datacake platform, you should do so now. Registration is free, no credit card is required, and the first two devices on Datacake are also free, but come with full functionality.
To register on the Datacake platform, please use the following link.
When you first register on Datacake, you will be taken to an empty workspace. So the first thing that we need to do is to create our first device on Datacake.
Create a new device by clicking on the blue button "Add Device".
Datacake will now ask you for the device type. Here you select the "API Device" device type.
Datacake will now ask you for the product. Here you can select if you want to create a new product, select an existing product or use a template.
Products store the definition of a device. Read more about products on Datacake here. For now, though, we can just continue with the next steps.
For easy integration, Datacake has a template for the Sigfox backend. To use this template, select "Existing Template" and choose the SigFox template from the list of available templates.
You will have to scroll down in the list of available templates and probably also browse the available pages to find the Sigfox template.
Now confirm the selection. Datacake will take you to the next step.
The routing of the data from the payload decoder of the product to the respective device will take place via the serial number of your SigFox device.
So now enter the serial number of your SigFox device as you find it on the Sigfox backend. The following screenshot may help you.
You are free to choose the name of your device and can change it at any time.
Now confirm the entries via the "Add One Device" button. The device will be created for you in the background.
By creating the device, the dialog is closed, and Datacake takes you back to the device overview. In the list of available devices, you should now see your newly created device.
For further use, more steps are necessary, so please click on the device in the list. This will take you to the Device view.
The Sigfox Starting Template has also created an initial dashboard for your new device, which you can see when you open the Device view.
When we connect Datacake to the Sigfox Backend in the later step, and should your device start sending data, you will also be able to see the first data on this dashboard.
To connect your device to Datacake, we need to link the Sigfox backend to the Datacake platform.
As mentioned earlier, forwarding between Sigfox and Datacake takes place via a webhook or HTTP forward. To do this, a URL must be specified on the Sigfox backend. This URL is associated with the product of your Datacake device, which you just created.
Now navigate to the configuration view to be able to copy this URL.
Scroll down until you reach the API section. You will see the corresponding URL in a field below the HTTP Payload Decoder.
To copy the URL, just click on the Copy button, or select the URL manually and copy it.
With the URL in the clipboard, you can now switch to your Sigfox portal and switch to the callback configuration view.
In the callback configuration of your device type, two callbacks must be created for the forwarding.
Data Callback
Service Callback
On the screenshot above you can see the callbacks that need to be created. See the next steps on how to set them up correctly.
The data callback is used to transfer the user data of your Sigfox Device to Datacake.
Please enter the following parameters.
Type: DATA, UPLINK
Channel: URL
Use HTTP Method: GET
Send SNI: Yes
Headers: Not required
URL: Datacake URL + Addendum (see below)
In the URL you just copied from Datacake, you need to add some more information. Add the following to the end of the URL:
data?id={device}&data={data}
Thus, the entire URL will be as follows:
https://api.datacake.co/integrations/api/<your-url-id>/data?id={device}&data={data}
With the service callback, you transfer metadata of your device from the Sigfox backend to Datacake. This is information like location (triangulated) or other useful data about the Sigfox network.
Please set the following configuration.
Type: SERVICE
, DATA ADVANCED
Channel: URL
Use HTTP Method: POST
.
Send SNI: Yes
Headers: Not required
URL: Datacake URL + Paht (see below)
Content Type: application/json
Body: Custom Body (see below)
The following must also be added to the Datacake URL for the service callback. Add service/ to the end of the URL. This will make the URL read as follows:
https://api.datacake.co/integrations/api/<your-url-id>/service/
Copy and paste the following JSON snippet into the textbox for the body:
With these two callbacks created, you have now successfully connected the Sigfox backend to Datacake. You can now send data from your Sigfox device and should already be able to see it in Datacake.
As the Starting Template responds to the Sigfox Backend service callback, you should already be able to see the first data on the dashboard.
In the Device view on Datacake, you will find the Debug Log navigation element in the tab bar, which shows you a listing of the last 100 incoming messages. Here you can also see the incoming data from your Sigfox device.
If you have problems connecting the Sigfox backend to Datacake, please always feel free to use our live chat or send an email to support@datacake.de
The Starting Template comes with a simple Payload Decoder, which decodes the data structure of the Sigfox backend and passes it to the Datacake backend.
What the payload decoder does not do is decode the actual payload data of your sensor.
This payload data is transmitted as hexadecimal, as is typical for Sigfox, and must be decoded into payload data according to the structure of this data and forwarded to Datacake.
This is the task of the payload decoder and on Datacake you have various tools for converting hexadecimal payloads to real values.
In the following example code snippet, you can see the decoder that is included in the Datacake Sigfox starting template. Its purpose is to already decode the typical Sigfox HTTP callback data structure, but its purpose is also to show you the basic principles on how to access the real sensor data.