Locate assets it is key in some use cases. This is why Sigfox is improving their techniques to locate assets. Sigfox brings the Atlas geolocation, which is kind of the GSM cell tower triangulation with Sigfox base stations. The Sigfox Atlas location from the new API version on the DATA ADVANCED services uses the concept of computedLocation. At thethings.iO sigfox parser on Cloud Code it is very simple to parse the Sigfox computedlocation.
How Sigfox computedLocation works
In case that you have the Sigfox Atlas location activated on your Sigfox contract, then you can introduce a DATA_ADVANCED callback. The computedLocation structure is a JSON object and it looks like this:
{
"lat":23.783814666368414,
"lng":2.1434994169512827,
"radius":8869,
"source":2,
"status":1
}
This is the structure of the computedLocation JSON:
- The lat is the latitude and the lng is the longitude.
- The radius means the distance in meters that potentially the device really is located from the latitude and longitude computed. Understand the radius as the aproximate error on the location detected.
- The source indicates the source of the location computed, if it’s Atas, WiFi or GPS. If the source is set to 0 the location is computed by legacy mode using RSSI and position of the Sigfox base station. If the source is set to 1 the location is computed using the GPS inside the data payload on the uplink. If the source is set to 2 the location is computed by Atlas Network. If the source is set to 3 the location is computed by Atlas POI and 4 by Atlas HD.
- The status is set to 1 when a position has been computed and 0 when no position has been computed.
How to visualize computedLocation on a thethings.iO map
First of all, it is important to set up a SERVICE and DATA ADVANCED callback on the Sigfox backend.
Once there introduce thethings.iO Sigfox callback URL available on your product details and paste it there as a POST callback. Usually thethings.iO Sigfox Callback URL looks like this: https://subscription.thethings.io/sgfx/[your ID]/[your hash]?id={device}&data={data}&snr={snr}&station={station}&avgSnr={avgSnr}&rssi={rssi}&seqNumber={seqNumber}
Delete some parameters and leave it like this: https://subscription.thethings.io/sgfx/[your ID]/[your hash]?id={device}
Then paste the URL on the URL pattern and go to the Body and introduce {computedLocation}. Just like the image below.