Skip to main content
GNSS HAT Library Documentation
Shop GitHub Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Geofencing

Configure multiple geofence zones and monitor their status in real time.

Source: examples/cpp/geofencing/, examples/c/geofencing/, examples/python/geofencing.py

Note
HAT Compatibility — Geofencing is available on the L1 GNSS HAT and L1/L5 RTK HAT only.

What It Does

  1. Configures 1–4 circular geofences (lat, lon, radius)
  2. Sets confidence level for Inside/Outside determination
  3. Optionally enables PIO pin output for hardware signaling
  4. Continuously prints combined and per-fence geofence status

Running

sudo examples/bin/geofencing
sudo build/examples/c/geofencing/geofencing
python3 examples/python/geofencing.py

Edit the geofence coordinates in the script/source to match your location before running.

See Geofencing Feature and Geofencing Config for full details.