CloudLocate getting started

Last update: September 27th, 2022

Introduction

CloudLocate enables positioning in the cloud to extend the life of energy-constrained IoT applications, with up to 10X energy savings over a standalone GNSS approach. The service uses IoT device measurements to calculate a location and deliver it to the enterprise. CloudLocate is ideally suited for IoT asset tracking applications that require large power autonomy, a few position updates per day, reasonable position accuracy, and for which location is needed in the cloud as opposed to on the device itself. 

Benefits

The service provides several benefits:

Basic principles

CloudLocate works in a pretty simple way. The GNSS, during acquisition phase, generates a raw measurement to be sent to the service endpoint. The cloud location engine takes in input this measurements and through a sophisticated algorithm estimates the position and send it directly to your cloud application. If needed, the position can be also sent back to the device.

 A raw measurement is a binary u-blox message, containing the satellites information in an optimized format.

 

Still need help?

Using CloudLocate with u-blox M8/M9 GNSS

CloudLocate sample code

If you need more help or have any questions, please send an email to support@thingstream.io.

Typical applications

CloudLocate is the most appropriate solution in all the use cases in which the priority is to extend the battery life and you need an accuracy  in the range of 10 meters, with few position updates per day. 

Typical applications are



As mentioned, CloudLocate is independent by the network connectivity of the device and it offers an incomparable advantage if your device runs in a low bandwidth network; the raw measurements generated by GNSS can easily fit in the small MTU (Maximum Transmission Unit)  typically allowed in these Wide Area Network.

Also if your device has multiple connections you can easily and dynamically switch between them without any service configuration. 

Because you do not need to download any data from the service, CloudLocate works even in unidirectional connectivity (uplink)

Prerequisites

To use the service you need

Supported hardware

To evaluate the service, you can use:

u-blox service platform sign-up

u-blox Thingstream is the service delivery platform providing a management console that you can use to enable and manage the entire suite of u-blox services , including IoT Location-as-a-Services and your Location Things (the logical representation of your location device in the Thingstream platform).

Sign-up is free, quick and easy.  Just go to the management console and register with your company information. If you already have a Thingstream domain for IoT Communication-as-a-Service (MQTT Anywhere, MQTT Here or MQTT Now),  or for IoT Security-as-a-Service you do not need to register again.

Service design

To use CloudLocate service you are requested to:

Hardware selection

CloudLocate is supported by all the latest generation of u-blox GNSS M8/M9/F9/M10 in all the available form factors. If your use case is in the typical application listed above or you are using a low bandwidth network we suggest to take advantage of the latest generation of GNSS (M10) that is consuming 70% less than the previous M8.  The next section describes all the steps to configure the service for M10.

In case you want to retrofit your u-blox M8/M9 already in the field you can still take advantage of all the benefits listed above. In such case, proceed with this guide

Raw measurement selection

To select the proper raw measurement type  you should consider the following aspects:

Regarding position accuracy, while UBX-RXM-MEASX and UBX-RXM-MEAS50 can provide in median an accuracy of 10 meters, UBX-RXM-MEAS20 accuracy is 20-30 meters and, UBX-RXM-MEAS12 is 30-40 meters. 

Step by step guide

CloudLocate configuration needs 3 simple steps:

Configure the M10 GNSS

For the complete GNSS configuration you can refer to the guide M10 firmware 5.10 interface description, independently from the form factor (section UBX-CFG-VALSET).  Here below you can find the list of the most relevant configurations:

GPS Enable: b562068a0900000100001f00311001fb80

Galileo Disable: b562068a0900000100002100311000fc89

BDS Disable: b562068a0900000100002200311000fd8e

Glonass Disable: b562068a0900000100002500311000009d

UBX-RXM-MEAS50: b562068a09000001000049069120019baa

UBX-RXM-MEAS20: b562068a09000001000044069120019691

UBX-RXM-MEASC12: b562068a0900000100003f069120019178

UBX-RXM-MEASD12: b562068a0900000100003a069120018c5f

UBX-RXM-MEASX: b562068a09000001000005029120015346

By doing this configuration, the GNSS starts sending in output the selected message (2Hz rate) that will be used by the service to estimate the position.

Notes:

In case you need to disable the raw measurement, you can use the following UBX configuration message

UBX-RXM-MEAS50: b562068a09000001000049069120009aa9

UBX-RXM-MEAS20: b562068a09000001000044069120009590

UBX-RXM-MEASX: b562068a09000001000005029120005245

UBX-RXM-MEASC12: b562068a0900000100003f069120009077

UBX-RXM-MEASD12: b562068a0900000100003a069120008b5e

Note: the message configurations will only be saved in RAM. To store it in flash, refer to section UBX-CFG-VALSET 

Configure the Thingstream platform

Thingstream is the u-blox service delivery platform just described above in this guide. 

Note: when moving to production you can automate steps 2 and 3 using the Zero Touch Provisioning feature.

Test the service

Just need few additional steps to test the service.

UBX-CFG-RST: b56206040400ffff01000d5f 

Note: the just generated raw measurement shall be sent to the service within 60 seconds. If you need to store it and send to service in a later time you can leverage the not-real time option described at the end of this guide.

Note: Before sending the UBX-RXM-MEAS* message to the server, the host must remove the UBX header (8 bytes) from the message leaving just the 12-, 20- or 50-bytes payload. Also the checksum shall be removed

CloudLocate/device:xyzwe-9999-1234-5678-9abcdefg/GNSS/response 

The estimation takes few tens of milliseconds, without considering the network latency.

Note: for more information about the structure of the u-blox GNSS message containing the GNSS raw measurement, you can refer to this guide

Here below a typical response of the CloudLocate server

{

"Lat":47.2852123,

"Lon":8.5652996,

"Alt":549.473,

"Acc":13.393,

"MeasTime":"2021-05-28T17:19:37",

"Epochs":1

"LocationSource":"CloudLocate"

}

Sample code

To simplify your initial tests you can use the sample code available in the Download area of the Thingstream platform in the section IoT Location-as-a-Service > CloudLocate: Python reference Implementation for M10 in standalone configuration


Next readings

Other interfaces to access to CloudLocate

The just described way to access to CloudLocate is named Device to Service, in which the device sends the GNSS raw measurement to the CloudLocate service endpoint and the estimated position can be retrieved both by cloud application and/or by the client (device) 

There are other two ways, that are more convenient for different architectures:

Zero Touch Provisioning

If using the Device to Service access, when going in production it becomes complex to deal with MQTT credential configuration in the device as well as for  Location Things creation in the Thingstream platform, because these are all manual tasks.

To simplify and automate this activity you can refer to Zero Touch Provisioning solution.

Not real-time measurements

There are some use cases in which the device does not have connectivity all the time. Even in this case you can use CloudLocate service by storing the time and date of the snapshot and send it in the following format:

{

"body":"Base64 encoded measurement (String)",

"headers":{"UTCDateTime":"yyyy-mm-ddThh:mm:ss"}

}

Note: The Base64 encoded measurement consists in the payload of UBX-RXM-MEAS* message to the server, without the UBX frame header (8 bytes). Just take the payload of 12-, 20- or 50-bytes payload (no checksum) and encode in base64.

You can find more information about the structure of UBX-RXM-MEAS/50/20/12 GNSS messages in this guide.

Mixed mode

Mixed mode allows you maximize the power efficiency and the reliability by using CloudLocate for most of the position estimation and addressing the remaining challenging signal conditions by leveraging the device GNSS engine to estimate the position. This Mixed mode guide explains how to set up the client application.

Get the location on your cloud application 

To get the location from your cloud application you need:

Note: you can decide to get the estimated position on both side (cloud and device) or only on one side  by simply subscribing to the right topic. When getting the position on the device you cannot use the wildcard  + but only the topic that include the device ID in the path

Payload format summary

This section summarize which are the supported formats accepted by the CloudLocate service according to selected service access mode and the selected raw measurement type.

Regardless the service access mode

More information about the payload structure is available in the Compact raw measurement section

Device to Service access mode

Note: MEAS12 is not supported in Device to Service mode, but only in Service to Service access mode

Service to Service access mode (REST API)

Additional info are available in the API documentation

Premium extension (flow)