Notecard tracking configuration

Not sure if I get what is the right configuration commands in order to achieve the following:

I want to track my device being battery-conscious, but I need to receive the device location every minute IF the device was moved.

So, what I basically need is:

  1. wait one minute after last check
  2. if the device didn’t move, do nothing, including NOT sending any redundant location packages to notehub
  3. if the device moved, acquire GPS location and send the new location to notehub

It seems to me that if I set “mode”: “periodic”, “seconds”: 60 I will still get redundant and unnecessary notehub syncs on step (2), which I don’t want.

Please advise

2 Likes

Hi Paulohm!

What you want to achieve is relatively simple, as the location function already takes into account if the device is moved when sampling from the GPS receiver.

The periodic location sampling is what you want, as described here: Time & Location Requests - Blues Developers
The important part here is the note at the end of the section "To preserve battery, when the Notecard is in periodic mode, GPS is only enabled if the built-in accelerometer detects movement since the last GPS enable. "

Next, you want to use the Location Tracking feature to automatically send the location to Notehub, see the documentation here: Time & Location Requests - Blues Developers

Simply for what you hav described, two commands need to be sent to the note card:

{
  "req": "card.location.mode",
  "mode": "periodic",
  "seconds": 60
}

and

{
  "req": "card.location.track",
  "start": true,
  "sync": true
}

:warning: However, with these interval times, this may not work as you expect. The GPS and Cellular radios cannot be turned on simultaneously, and with the startup time required for both, you are likely to get inconsistent data going to notehub. It would be better to not have the "sync": true argument to card.location.track but instead configure the note card to send data on a longer period (with the frequent location data being queued and sent in batches. To do this you would configure the periodic time in the hub.set command as follows (for 30 minutes to send data and 4 hours to receive data):

{
  "req": "hub.set",
  "mode": "periodic",
  "outbound": 30,
  "inbound": 240
}

If sending the GPS data to notehub every minute is required, you will need to configure an external GPS module, see Advanced Notecard Configuration - Blues Developers

Thanks for your feedback. This explains why I was having some inconsistent GPS locations, and had an issue open with your tech support regarding this.

1 Like