1. View or Change GPS State

View the current GPS status or enable or disable GPS functionality.

Commands:

gps
gps <state>

Parameters:

ParameterDescription
stateSet to on to enable GPS or off to disable it.

Default: off

Examples:

Enable GPS:

gps on

Disable GPS:

gps off

View GPS status:

gps

Output format:

  • GPS disabled: off
  • GPS enabled: on, {active|deactivated}, {fix|no fix}, {sat count} sats

The enabled status reports whether GPS is active or deactivated, whether a GPS fix is available, and the number of satellites detected.


2. Synchronise the Node's Clock with GPS Time

Synchronise the node's internal clock using GPS time.

Command:

gps sync

Note: GPS support must be compiled into the firmware, and usable GPS time must be available.


3. Set the Node's Location Using GPS Coordinates

Update the node's configured location using the coordinates obtained from GPS.

Command:

gps setloc

Note: The command uses GPS coordinates to set the node's location.


4. View or Change the GPS Advertisement Policy

View or configure how the node's location is included in its advertisements.

Commands:

gps advert
gps advert <policy>

Parameters:

PolicyDescription
noneDo not include location information in advertisements.
shareShare the GPS location provided by the SensorManager.
prefsUse the location stored in the node's latitude and longitude settings.

Default: prefs

Examples:

View the current GPS advertisement policy:

gps advert

Disable location sharing in advertisements:

gps advert none

Share the GPS location:

gps advert share

Use the location configured in the node's settings:

gps advert prefs

Important: The advertisement policy determines the source of location information, or whether location is included at all. Consider your privacy requirements before sharing GPS coordinates through mesh advertisements.


Important Notes

  • Firmware support: These commands are available only when GPS support is compiled into the firmware.
  • GPS availability: A GPS fix may take time to acquire and depends on the device's hardware and reception conditions.
  • Clock synchronisation: Use gps sync to synchronise the node's clock with GPS time.
  • Location settings: Use gps setloc to update the node's configured location from GPS coordinates.
  • Location privacy: Use gps advert none if you do not want location information included in advertisements.