|All Versions||0.0.7, 0.0.6, 0.0.5, 0.0.4, 0.0.3, 0.0.2|
Library for using Google Maps Device Locator Integration
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.
Library for using the Google Maps Device Locator Integration
You normally create an locator object as a global variable in your program:
There are three modes of operation:
If you want to only publish the location once when the device starts up, use withLocateOnce from your setup function.
To publish every n seconds while connected to the cloud, use withLocatePeriodic. The value is in seconds.
To manually connect, specify neither option and call publishLocation when you want to publish the location
With periodic and locate once modes, you must call
from your loop. It doesn't hurt to always call it, even in manual location mode. It gives the library time to process the data.
The default event name is deviceLocator. You can change that in setup using:
This also must be updated in the integration, since the eventName is what triggers the webhook.
You can also have the library tell your firmware code what location was found. Use the withSubscribe option with a callback function.
This goes in setup() for example:
The callback function looks like this:
void locationCallback(float lat, float lon, float accuracy)
One possibility is that you could display this information on a small OLED display, for example.
The library uses the logging feature of system firmware 0.6.0 or later when building for 0.6.0 or later. Adding this line to the top of your .ino file will enable debugging messages to the serial port.
For LTE devices, it's strongly recommended to use this library with Device OS 1.2.1 or later only.
The Boron LTE and B Series B402 SoM both require 1.2.1 to use the device locator and will not work with older versions of Device OS.
If you must use a version of Device OS older than 1.2.1:
- The Boron LTE cannot use the device locator with Device OS older than 1.2.1
- The E Series LTE and Electron LTE require the use of the
withOperator()method to manually set the MCC, MNC, and operator if not
withOperator(const char *oper, int mcc, int mnc) method of the locator object allows you to pass in this information. The default is "AT&T", 310, 410.
Note that because
withOperator() is no longer needed with Device OS 1.2.1 and later, it will eventually be removed.
- Fix compiler warning with 2.0.0.
- Added support for the Boron LTE and B Series B402 SoM when using Device OS 1.2.1 and later.
withOperator()function is no longer needed for LTE when using Device OS 1.2.1 and later.
- Added support for LTE in the United States, upgrade to CellularHelper 0.0.7