Part II: Tracking device location with Sigfox Spot'it

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 Spot'it, Sigfox's Geolocation service, to track the location of a device with Beebotte.

Spot'it 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 two resources: location to hold the GPS estimated coordinates of the device and radius location uncertainity in meters. We will then configure a Geolocation 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: location with type set to GPS. GPS type resource type in Beebotte includes the location longitude and latitude coordinates and optional location precision (also called location uncertainty) in meters. Sigfox geolocation service provides precision as radius parameter.

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



Now your channel is ready to receive geolocation data data. Copy the channel token, we will use it when configuring Sigfox to forward geolocation data to this channel.

Set Sigfox Service Geolocation Callback

Now let's move to Sigfox backend.

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



Configure the callback as follows:

  1. Callback Type: select Service - Geolocation
  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 your 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": {
          "latitude": {lat},
          "longitude": {lng},
          "precision": {radius}
        }
      }
    }
    



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.