Looking for a way to get GPS telemetry from Particle Tracker to Particle cloud

Hello.

Looks like all kinds of data can be collected and published. GPIOs, LTE, WiFi, BLE control functions and API. All documented well enough in the docs. What surprises me is that GNSS is not that obviously controlled, nor mentioned in the docs contents. We are looking for a definite way to access GPS data, just like the vitals. TinyGPS, I presume is written for Photon and such devices which hooks up to the GNSS serial and communicates with it. Would it work with Tracker’s OS and not get in conflict controlling the serial? Aren’t there any standard ways to say, Particle.publish(Particle.gps); or something to get around with GPS?

1 Like

Have you seen these infos?

Are you basing your firmware off the Tracker Edge reference firmware (recommended), or writing something completely from scratch and not using any of the cloud-based configuration built into the console?

Assuming you are basing your firmware Tracker Edge, you should not attempt to use a second GPS library, as it will likely conflict.

However, there is already a GPS library in Tracker Edge that breaks out the same fields as TinyGPS++, just in a slightly different way. There’s an example that shows how to add speed from the GPS data into the location publishes. The same technique can be used to add any data.

However, you’ll eventually run out of space in the location event, so you may just want to use the GPS API to get the fields and publish them separately from the location event for the extra information.

Well the cloud says the device is on v16, 3.1.0. I presume that is the Tracker edge. (we are using the T524MKIT). However implementing the tutorials from the given links about Tracker Edge in Visual Studio Particle workbench yields “fatal error: tracker_config.h: No such file or directory 9 | #include
tracker_config.h” . I do believe I chose the correct target device. I must be missing something.

Which tutorial? I’d start with this one.

And did you download the zip file directly from the docs page?

Or follow the git clone instructions? If you use the git clone method you absolutely need to do the command line commands to get the submodules. You cannot download the zip file from Github, because it will not include the submodules.

1 Like

I am sorry, I meant the docs Particle Introduction . All was done via command line as instructed. The firmware works, sort of. But what I am struggling with understanding is how to publish location along with any data we would like to append on demand, just like Particle.publish(location) or something like that, not as the Tracker Firmware loop pleases. The location event comes up one time once the device comes online after restart, but nothing more. The tutorial written about the Tracker instance vaguely explains how does this thing work. Another thing I noticed, is “Asset Tracker Settings” in cloud interface do not save well, only telling:
“Configuration updates failed some sections: {“temp_trig”:-19} These sections were successful: location,imu_trig,rgb,sleep,tracker”,
And keeps default parameters whatsoever.

The frequency of publish is determined by the settings in the console settings described here. It’s possible to manually trigger publishes from device code, but the first place to check is your configuration settings.

Once you have it publishing at the right rate, you add stuff to the location event by using the location callback.

I found what I was looking for it goes something like this:
outside of functions:
LocationPoint location_point;

inside a thread:
Tracker::instance().locationService.getLocation(location_point);
Particle.publish(“gps_data”, String(double(location_point.latitude)));
Particle.publish(“gps_data”, String(double(location_point.longitude)));

1 Like

Summing up this thread. To get the location data needed for further processing, first one must install the Tracker Firmware. Tracker Edge as mentioned earlier in this thread. Then use commands written below.

outside of functions:
LocationPoint location_point;

inside a thread:

Tracker::instance().locationService.getLocation(location_point);
Particle.publish(“gps_data”, String(double(location_point.latitude)));
Particle.publish(“gps_data”, String(double(location_point.longitude)));

The location_point also contains useful data:

struct LocationPoint {
    LocationType type;              /**< Type of location point */
    Vector<LocationSource> sources; /**< List of location sources sorted by highest accuracy */
    int locked;                     /**< Indication of GNSS locked status */
    unsigned int lockedDuration;    /**< Duration of the current GNSS lock (if applicable) */
    bool stable;                    /**< Indication if GNNS lock is stable (if applicable) */
    time_t epochTime;               /**< Epoch time from device sources */
    LocationTimescale timeScale;    /**< Epoch timescale */
    float latitude;                 /**< Point latitude in degrees */
    float longitude;                /**< Point longitude in degrees */
    float altitude;                 /**< Point altitude in meters */
    float speed;                    /**< Point speed in meters per second */
    float heading;                  /**< Point heading in degrees */
    float horizontalAccuracy;       /**< Point horizontal accuracy in meters */
    float horizontalDop;            /**< Point horizontal dilution of precision */
    float verticalAccuracy;         /**< Point vertical accuracy in meters */
    float verticalDop;              /**< Point vertical dilution of precision */
};

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.