How to get location metadata into Notehub's native "Location" fields when using LoRa Notecard

As seen here…

And here…

And the map…

Our new LoRa Notecard project is using an MCU with external GPS, as described in this thread.

We are successfully receiving the GPS lat/lon in the body of our upstream notefiles, however the location fields within the Device and Events pages in Notehub are not populating. We are pushing the GPS data to the notecard using the following code (and requesting it back from the notecard to verify it’s been set), however the data still isn’t making it into those fields.

// Send GPS coordinates to Notecard
J *req = NoteNewRequest("card.location.mode");
JAddStringToObject(req, "mode", "fixed");
JAddNumberToObject(req, "lat", GPS.latitudeDegrees);
JAddNumberToObject(req, "lon", GPS.longitudeDegrees);
NoteRequest(req);

// Get GPS coordinates from Notecard and print
J *req = notecard.newRequest("card.location");
J *rsp = notecard.requestAndResponse(req);
Serial.print("Latitude: "); Serial.println(JGetNumber(rsp, "lat"), 6);
Serial.print("Longitude: "); Serial.println(JGetNumber(rsp, "lon"), 6);

I assume this is happening because the templated LoRa notes are of the “compact” format and therefore discard the typical metadata that Notehub uses to populate these fields?

If that’s the case, then how do we go about getting our GPS coordinates from the body of our notefile into Notehub’s native location fields? We’d really like to be able to see/manage our device locations within the aforementioned Notehub screens.

Making some progress. I dug a little deeper and found this thread, which pointed me to these instructions for restoring the _lat and _lon metadata fields to a compact template.

So now my events are showing up in Notehub with ‘best location’ data, which is great! However the location data on the Device:Summary page and the Device:Map page is still missing. Perhaps I don’t understand how those are populated. I assumed they would display the location data from the device’s most recent event. Or is that not how those device location fields work?

Thanks!

Hi @josh77,

It looks like this may be a bug in Notehub. We’ve got a ticket filed and will share an update here when it is resolved. Thanks for the report and sorry about the confusion!

Rob

We’re looking at getting a fix out for this as soon as next week