GPS tracker to only store notes when outside geofence

Hi there,

I’ve been trying to set up a GPS tracker. Is there anyway to set card.location.track so that it only adds location notes to the Notecard when the Notecard is outside of the geofence? I only need new location coordinates from the device when it moves out of the geofence. Tracking coordinates within the geofence would be a waste of network data and battery usage. Battery conservation is critical in my application.

Cheers,
Nathan

Hi @NathanJC,

The scenario you describe is only possible if you’re using a host MCU in your solution and work with the card.location.mode API to see if you’re outside of a specified geofence. It’s an interesting feature request though for host-less configurations, so I’ll note it as a potential feature for the future.

Thanks,
Rob

1 Like

Hi again @NathanJC,

After speaking to some folks internally, we have some additional advice for you (my answer above is correct, but there is a little more to the story):

When a geofence is crossed, the track event is immediately synced (rather than waiting for the next scheduled outbound sync). This at least helps you identify when a geofence transition occurs. One thing you could do is set the outbound parameter of hub.set to the max value you can tolerate and don’t set sync:true in card.location.track. This way tracking events are only immediately synced when they are outside of the geofence. You’d still be tracking events inside the geofence, but they won’t be synced until the Notecard is outside the geofence.

On the power-consumption side, you should also know that we have found a GNSS fix with the built-in GNSS module consumes about 2x as much power as a sync with Notehub! (This is not unique to the Notecard’s module, GNSS is just power hungry, but we do have long term plans to help address this.)

Thanks,
Rob

Hi Rob,

Thanks for your in depth replies. I am currently running the Notecard with a MCU. I was hoping to avoid controlling the location events publishing via the MCU, as it can be asleep for an hour at a time to conserve battery. However, it appears it may be necessary.

In regards to your second reply, I could see how that would potentially work for a single-purpose GPS tracker. Unfortunately, in my application there are other sensors that can force the Notecard to sync. This would prematurely send location events to the Notehub. Also, I’d prefer not to use up the data allowance on my device publishing unnecessary data.

It’s looking like I will have to manage GPS publishing from the MCU and have Notecard tracking turned off. I have most of the code already set up. The one thing I am missing is how to get the HDOP of the current Notecard location. I know that the HDOP is given in _track.qo, but I can’t find how to access if with card.location.track turned off.

Thanks for your help,
Nathan

Hi @NathanJC,

Good question regarding accessing HDOP data. Right now it isn’t possible outside of a track request, however we will look into adding it to the response from a card.location call in a future firmware release. Stay tuned…

Rob

1 Like

Will do. Thanks once again