Connect to the GNSS Expansion
8 May 2025
Direct Communication
To communicate directly to the Archer 4 GNSS expansion,
-
Ensure that the user has enabled the Use U-Blox USB GPS option in Settings > Location.
An application can determine if this setting is enabled by checking the result of LocationManager.getGnssHardwareModelName(). If this value is u-blox GNSS driver, then the setting is enabled. -
Start location services.
-
Request location updates with LocationManager.requestLocationUpdates
-
Register a GNSS measurement callback with LocationManager.registerGnssMeasurementsCallback
-
-
Connect a TCP client to 127.0.0.1:42434.
The local TCP server at port 42434 will start after the location services. It is not immediate. -
Send the UBX-MON-VER command (B5-62-0A-04-00-00-0E-34) to enable communication between the client and the GNSS expansion.
The application is now directly connected to the GNSS expansion.
Disconnect
To disconnect from the Archer 4 GNSS expansion,
-
Disconnect the TCP client.
-
Stop location services.
-
Remove location updates with LocationManager.removeUpdates
-
Unregister the GNSS measurement callback with LocationManager.unregisterGnssMeasurementsCallback
-
Notes
Only one TCP client can be connected to the TCP server at a time. Ensure that applications like Archer Connect have been disconnected from the GNSS expansion.
If the OS forcefully stops location services, then the TCP server may become unstable. Ensure that the application stops location services when it is not needed. If the GNSS expansion needs to be used while the application is not visible, use a foreground service to ensure the OS does not forcefully stop location services when the application is minimized.
The GNSS Expansion uses a u-blox ZED-F9P receiver. For a complete description of each command and responses from the receiver, consult the u-blox F9 HPG 1.32 Interface description.