GPS (When GPS support is compiled in) CLI Commands
Learn how to view and manage GPS settings in MeshCore using CLI commands when GPS support is compiled into the firmware. This guide covers GPS configuration and location information to help you check GPS functionality and manage location-related settings on supported devices.
Updated 29 October 2026
1. View or Change GPS State
View the current GPS status or enable or disable GPS functionality.
Commands:
gps
gps <state>
Parameters:
| Parameter | Description |
|---|---|
state | Set 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:
| Policy | Description |
|---|---|
none | Do not include location information in advertisements. |
share | Share the GPS location provided by the SensorManager. |
prefs | Use 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 syncto synchronise the node's clock with GPS time. - Location settings: Use
gps setlocto update the node's configured location from GPS coordinates. - Location privacy: Use
gps advert noneif you do not want location information included in advertisements.