Part II: Tracking device location with Sigfox Atlas

This is Part II of a two parts tutorial covering the integration of Beebotte with Sigfox IoT network.

In Part I, we presented how to connect Beebotte to Sigfox platform to collect sensor data and present it in a visual a dashboard. In this tutorial, we will show how to use Atlas, Sigfox's Geolocation service, to track the location of a device with Beebotte.

Atlas is a simple, cost effective GPS free geolocation service offered by Sigfox. It estimates the location of a device using the signal quality of received messages. This location estimation can be made available through callbacks configured on Sigfox backend.



In this tutorial, we will update the channel created in Part I by adding location resource to hold the GPS estimated coordinates of the device. We will then configure a service callback on Sigfox backend to forward geolocation data to Beebotte. Last but not least, we will add a google maps widget to the dashboard to location the device location on a map.

This tutorial assumes that you have successfully registered to Beebotte and obtained your API and Secret keys.

Update Beebotte Channel

In Part I, we have created a channel with two resources for sensor data. We will use the same channel to add a new resource: position with type set to GPS. GPS type resource in Beebotte includes the location longitude and latitude coordinates and optional location precision (also called location uncertainty) in meters. In Sigfox terminology, the geolocation precision is called radius.

In your account home page, navigate to the corresponding channel, click on channel settings crog then click on Edit Channel to add the resource.



Now your channel is ready to receive geolocation data.

Set Sigfox Service Geolocation Callback

Now let's move to Sigfox backend.

  1. Login to your Sigfox account
  2. Goto device type list
  3. Select the device type from the list
  4. Open Callbacks and click New then select Custom Callback



If your Sigfox contract includes GeoLocation, you'll see computedLocation in additional body variables of the callback. In this case, configure the callback as follows:

  1. Callback Type: select Service - Data Advanced
  2. Channel: select URL
  3. Url pattern: https://api.beebotte.com/v1/integration/sigfox/data
  4. Ue HTTP Method: select POST
  5. Headers: add X-Auth-Token header and set its value to an IAM Token with data write access. If you have only one device under the device type, you can use the Channel Token.
  6. Content type: set it to application/json
  7. Body: Set to the JSON object below. See how we are using the variables provided by Sigfox geolocation service to construct the message. Keys in resources must match those of the corresponding Beebotte channel. In this case, we will post data to newly added position resource.
  8. {
      "device": "{device}",
      "time": {time},
      "resources": {
        "position": {computedLocation}
      }
    }
    

When Sigfox calls the callback, Beebotte will automatically convert the computedLocation object to Beebotte GPS data type.




Congratulations!!! Your Sigfox account is now configured to transfer geolocation data to Beebotte whenever your device transmits a message.


Lets update the dashboard now to show the device location on a Google Maps chart.

Update Dashboard with Google Maps Chart

In your account page, goto My Dashboards, locate the dashboard you created in Part I and click Edit Dashboard. From Add Widget list, select Google Maps and indicate the channel and resource where data will be read from. Voilà.

Conclusion

In this tutorial we learned how to use Sigfox Geolocaion service to track device location with Beebotte.