How to integrate a Sigfox Device with Onesait Platform?
onesait Platform offers the tools needed to integrate remote data, sent by IoT devices with Sigfox communication technology. In this example, we will see the steps to achieve this integration, concluding with the data ready to be viewed in onesait Platform, or to be exploited depending on the business case.
Sigfox is one of the cutting-edge technologies in low-power wide-area network communications (LPWAN) and one of the most used options currently in IoT developments because of its wide coverage in a number of geographies.
To perform this integration, you need an active account in Sigfox's web backend: https://backend.sigfox.com/
In the Device tab you can see all the devices linked to your account, with metrics of recent submissions, signal quality, id, etc.
Sigfox defines groups of devices, called Device Types. By browsing this tab, you can see the different groups registered for the account. By right-clicking on a group you want to integrate, then clicking on the Edit command, you can see the menu with available operations.
Select the last part, Callbacks, then select the Custom Callback version.
In this example, we have chosen to use Sigfox's geolocation service or GEOLOC, which sends geolocation data that are based on the position of the base station detecting the device data, or GPS if available. Sigfox provides the IoT developers with variables they can include in their messages. In this case the results are seen in the Body field. This is the field we want to replicate in the onesait Platform.
To do this, you must enter the platform's control panel (for example on CloudLab instance: https://www.onesaitplatform.online/controlpanel/login) and define an ontology we will call SigFox_RA. It will include the fields that were defined in Sigfox's backend.
Once the ontology is ready to receive the data defined in Sigfox, you only need to enable the data input API. To do this, use the API Manage module to create an API that allows insertion of data in onesait Platform via POST:
After creating the API, remember to change it to a functional state, either Development or Publish if the functionality is ready for it:
At this point you already have the ontology model and the end-point for the insertion API. You only need the authentication token on the platform. To get it, go to the token section in the API Manager and get one of the tokens that are available for that user.
Having done this, you only need to go back to the Sigfox web console to fill in the empty fields in the integration with all that was created in the onesait Platform. Remember to select application/json as your Content-type,and add the custom header for the token you have just taken, with name X-OP-ApiKey. It should look like this.
After this step, all the devices in the group will be integrating data in the onesait Platform ontology. If you select one of these devices and open its message log, you can confirm that the integration is working correctly.
In the onesait Platform control panel, you can run a query on the ontology SigFox_RAW to check that data is reaching it.
Once the data is in onesait Platform, you can use all the tools in the Platform to exploit that information. For instance, in this case, it is a geo-location and we suggest representing the position in a map. Using a Datasource, you can extract the data and create a simple Map Gadget to show the locations of Sigfox devices: