|Author||Rick Kaseguma firstname.lastname@example.org|
|All Versions||0.4.1, 0.3.5, 0.3.4, 0.3.3, 0.3.2, 0.3.1, 0.2.3, 0.2.2, 0.2.1, 0.2.0, 0.1.7, 0.1.6, 0.1.5, 0.1.4, 0.1.3, 0.1.2, 0.1.1, 0.1.0, 0.0.2, 0.0.1|
Alternate library for AssetTracker using TinyGPS++
Device OS Version:
This table is generated from an automated build. Success only indicates that the code compiled successfully.
This content is provided by the library maintainer and has not been validated or approved.
Alternative library for the Particle AssetTracker/Electron based on TinyGPS++
I prefer the TinyGPS++ library as I find it to be more reliable, and my LIS3DH driver supports some more options including getting accelerometer data, direction sensing, and wake-on-move.
In addition to the Electron-based AssetTracker v1 and v2, it can be used with many GPS boards that use either the PA6H (PMTK protocol) or u-blox line of serial-connected GPS chipsets.
There's also an optional AssetTracker almost-drop-in replacement. I prefer to access the LIS3DH driver and TinyGPS++ directly, because they have many more features than the original AssetTracker library. But for initial testing, the replacement shim is pretty handy. Note the
preNMEA() method always return an empty string, because TinyGPS++ doesn't export a function to get that information.
There is also support for threaded mode. In threaded mode, the GPS serial port is read from a separate thread. This eliminates the need to do it from loop, and dramatically reduces the chance of lost or corrupted GPS data caused by blocking the loop long enough to overflow the 64-byte serial buffer.
Official project location: https://github.com/rickkas7/AssetTrackerRK
You can browse the full API documentation here: https://rickkas7.github.io/AssetTrackerRK.
Also note: If you are using this directly from the Particle Firmware Libraries manager it will automatically include the LIS3DH driver as well. If you are manually copying the source from here, you will also need:
By the way, I highly recommend adding an external active GPS antenna and the CR1220 coin cell battery with the AssetTracker V1. With this combination, the wake-on-move and report GPS location example can get a GPS fix in 2 to 7 seconds!
The AssetTracker V2 includes a supercapacitor that eliminates the need for the coin cell as long as you normally have power available to the GPS.
The code should be straightforward to use. The examples include:
Simple example of using the GPS to report the current location to serial and Publish to the cloud.
Like the previous example, but supports turning cellular on or off. Pressing the MODE button toggles the cellular connection.
Wakes the Electron when moved and publishes the current location from the GPS.
Prints XYZ data from the accelerometer to the debug USB serial connection.
The LIS3DH accelerometer has the ability to detect when it's stable in one of 6 orientations. This code prints the current orientation to the debug USB serial connection.
Example of using the original AssetTracker API with the this library.
This prints the raw data from the GPS, which can be useful for debugging.
This uses the threaded mode, which allows the GPS to run efficiently and without errors if you have blocking code in your loop() function. This is recommended instead of the simple method used earlier.
Version 0.2.2 and later of the library supports a u-blox GPS (tested with a MAX-M8-Q) using I2C instead of serial. This is particularly helpful on Gen 3 devices like the Boron, which does not have as many serial ports as the Electron.
The Pass-Through firmware is used primarily so you can use the u-blox u-center app with the AssetTracker V2. This Windows-based software allows you to decode the data from the GPS and issue commands using a graphical user interface.
Flash the pass-through software to your AssetTracker V2. It will boot into manual mode (breathing white). Run the u-center application and select the USB port for the Electron.
In order to remove the pass-through software you'll probably need to use DFU mode (blinking yellow) or safe mode (breathing magenta) since the cloud is deactivated by this example.
This example uses the u-blox AssistNow service to download almanac and ephemeris data over cellular and upload it to the modem, instead of waiting for it to arrive by satellite. This can greatly speed time to first fix on compatible GPS models. See AssistNow for more information.
Fixed compatibility with system firmware 0.6.1. The Arduino compatibility in that version conflicted with the Arduino compatibility built into TinyGPS++.
Added compatibility with AssetTracker v2. This is just basic compatibility with getting GPS data; more advanced options for controlling it will be added later.
- Implement all official AssetTracker methods
- Upgrade to LIS3DH 0.2.3
- Parser Unit Tests
- Additional documentation
- Support for threaded mode
- Support for u-blox GPS connected by I2C instead of serial
- Minimum supported Device OS version is now 0.9.0. Tested mostly with 1.4.4.
- Added u-blox AssistNow support (beta)
- Added u-center pass-through example
- Updated to LIS3DH 0.2.5 to fix a SOS+1 at startup when used with Device OS 1.5.0.
- Update to LIS3DH 0.2.6 to fix compiler error for ambiguous requestFrom with 1.5.0-rc.2.
- Update to LIS3DH 0.2.7 to fix compiler error for undefined conversion to SpiClass with 1.5.1-rc.1.
- Update to LIS3DH 0.2.8 to fix compiler error for undefined conversion to SpiClass with 1.5.1-rc.1. The fix in 0.2.7 didn't work right with SPI1.
- Refactor code to allow mix-and-match of features
- Bug fixes in the u-blox direct API
- Support for FeatherGPS6 hardware