How to interface a GPS/GNSS module with Ouster Lidar
This article provides instructions on setting up, wiring, and synchronizing with a GPS/GNSS device (NEO-M9N) and Ouster lidar sensor.
Required Items
Hardware Needed
Ouster Sensor: OSx-[32, 64, 128] with included Interface Box (IBOX)
GPS Board: u-center compatible GPS (below are the tested ones)
SparkFun GPS Breakout - https://www.sparkfun.com/products/15712 (1) and applicable antenna
Goouuu Tech GT-U7 GPS Module and antenna
PC: Ensure the PC has 1000Base-T (Gigabit Ethernet) capability (via ethernet port on PC or separate USB-Ethernet converter).
Miscellaneous:
Required: Ethernet cable, USB-C cable, M3 torx screwdriver, jumper wires (male and female)
Optional: Breadboard (or plugblock), oscilloscope
Note: This specific SparkFun product requires an antenna (sold separately). Be sure to pick a suitable antenna with U.FL connector for this exercise.
Required Software
u-center
u-center GNSS evaluation software for Windows only [freeware]
The u-center version utilized for the creation of this article: u-center, v22.07
PyGPSClient
Compatible with MacOS, Linux, and Windows
https://github.com/semuconsulting/PyGPSClient
Installation Guide
Create Virtual Environment
python3 -m venv venv && source venv/bin/activateInstall
pip install --upgrade pygpsclientRun (a GUI window should pop up if successful)
pygpsclient
[Optional] Desktop Launcher Installation: https://github.com/semuconsulting/PyGPSClient?tab=readme-ov-file#creating-a-desktop-application-launcher
Installation Troubleshooting
$ pygpsclient --help
Traceback (most recent call last):
File "/Users/dawheeler/ouster/venv/bin/pygpsclient", line 5, in <module>
from pygpsclient.__main__ import main
File "/Users/dawheeler/ouster/venv/lib/python3.13/site-packages/pygpsclient/__main__.py", line 15, in <module>
from tkinter import Tk
File "/usr/local/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/tkinter/__init__.py", line 38, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named '_tkinter'For MacOS, I installed Tk via brew to resolve it
brew install python-tkSensor and GPS/GNSS Configuration
Ouster Sensor Configuration via Web Interface
The Ouster sensor must be configured to accept externally generated, electrical signals as ‘inputs’ for both PPS and NMEA. There are many ways to configure the sensor (e.g. via TCP/HTTP api), however the Ouster Web Interface is probably the most simple and effective method.
See our documentation on Web Interface for further details.
Tip: to access the web interface, enter one of the following arguments into a web browser url bar.
http://os-991234567890.local/where 991234567890 represents the unique serial number of your device.
This can be found on the sensor label or GET /api/v1/sensor/metadata/sensor_info
http://169.254.1.100/where 169.254.1.100 represents the set IPv4 address of the sensor
Sensor IPv4: GET /api/v1/system/network/ipv4
From the Configuration tab, ensure the following items are configured as described. All other fields can remain as the default values.
Sensor configuration via Web UI | |
|---|---|
| 1 | Timestamp Mode: |
| 2 | Multipurpose IO Mode: |
| 3 | NMEA In Polarity: |
| 4 | NMEA Baud Rate: |
| 5 | NMEA Leap Seconds: |
| 6 | Sync Pulse In Polarity: |
| 7 | Click |
| 8 | Click |
Tip: If nmea_leap_seconds is set to 0 then the reported time is Unix Epoch time.
If nmea_leap_seconds is 37 then the reported time matches the TAI standard
GPS/GNSS Configuration with u-center
NEO-M9N Configuration Settings for use with Ouster sensor
It is important to ensure you have configured the GPS/GNSS device to be compatible with the Ouster sensor. For details on initial installation of https://www.u-blox.com/en/product/u-center, connecting the GPS receiver, and other introductory features, please refer to the user guide by visiting the manufacturer site.
Getting started:
Open the
Configuration View(Ctrl+F9)
After making a configuration change, write the change to the module by using the Send button at the bottom of the window.
List of configuration topics to be changed:
Save (BBR/Flash)
NMEA Protocol
UART Out
PPS Out
NMEA Message Types
1. Save (BBR/Flash) | |
|---|---|
| 1 | Highlight |
| 2 | Select |
| 3 | Send the message to the receiver |
2. Configure NMEA Protocol | |
|---|---|
| 1 | Highlight |
| 2 | Select |
| 3 | Number used for SV’s not supported by NMEA: |
| 4 | Main Talker ID: |
| 5 | Send the message to the receiver |
3. Configure UART Out | |
|---|---|
| 1 | Highlight |
| 2 | Target: |
| 3 | Baudrate: |
| 4 | Send the message to the receiver |
| |
|---|---|
| 1 | Highlight |
| 2 | Timepulse Settings: |
| 3 | Check the radio button: |
| 4 | Frequency: |
| 5 | Length: |
| 6 | Length Locked: |
| 7 | Select |
| 8 | Send the message to the receiver |
| |
|---|---|
| 1 | Highlight |
| 2 | Timepulse Settings: |
| 3 | For each message type below, uncheck the box (OFF) for UART1 only.
|
| 4 | Ensure that UART1 checkbox is selected (ON) for the RMC message type:
|
| 5 | Send the message to the receiver after each step 3a, 3b, ….4a. |
Ouster sensors only accept NMEA sentence type: GPRMC
With NEO-M9N, there are several other NMEA sentence types enabled by default. And in this example, the interface to send these messages is over UART. Therefore, ensure that GxRMC sentences are enabled (ON) for interface UART1 and the others are disabled (OFF).
GPS/GNSS Configuration with PyGPS Client
Connect the device to your computer before launching the software
Connecting to the GPS device:
Configuring with a ubx Configuration File:
This file sets the sensor via ublox command to 1 hz message rate, disable all NMEA sentences, and enable RMC sentence
Click UBX config and a new window should appear
At the top left, click Load CFG Configuration dialog
Select the desired UBX file
Click the green arrow to send it to the GPS device
Configuring via the GUI
Click UBX config and a new window should appear
Set
Solution Interval (ms)(under CFG-RATE Navigation Solution Rate Configuration) to 1000 and click the green arrow to send it to the GPS deviceConfigure PPS
Note: I couldn’t get my oscilloscope to get a reading but my sensor was able to achieve a sync pulse lock with the default GPS (Goouuu Tech GT-U7 GPS Module) settings. This should be the equivalent of the u-center PPS instructions
Attribute | Value ------------------------ tpIdx | 0 version | 1 freqPeriod | 1 freqPeriodLock | 1 pulseLenRatio | 10000 pulseLenLock | 10000 active | 1 lockGnssFreq | 1 isFreq | 1 isLength | 1 alignToTow | 1 polarity | 1 gridUtcGnss | 0https://content.u-blox.com/sites/default/files/u-blox-F9-HPG-1.30_InterfaceDescription_UBX-21046737.pdf?utm_content=UBX-21046737
fill out the any fields not listed here with 0Click the green arrow to send it to the GPS device
Turn off all NMEA messages
At the bottom right, find Preset UBX Configuration Command
Select the appropriate ports (e.g. USB, UART-1)
Select
CFG-MSG - Turn OFF all NMEA msgsClick the green arrow to send it to the GPS device
Enable RMC messages
At the bottom left, find CFG-MSG Message Rate Configuration
Scroll to find
RMCSet the appropriate ports (e.g. USB, UART-1) value to 1
Click the green arrow to send it to the GPS device
Tip: Besides configuring the PPS, each green arrow click, you should see the device’s output changes in PyGPSClient’s main dialog
Hardware Interface and Connections
Component connections
Connect the Ouster sensor to the Interface Box (provided in the box with the sensor). The IBOX comes in a kit which includes the IBOX unit, sensor cable, Ethernet cable ,and a AC-to-DC power supply.
Plug the ethernet cable into the designated port on the IBOX. Connect the other end to your PC (or USB-Ethernet converter). Provide power to the IBOX via the DC jack.
Power the SparkFun NEO-M9N board with a USB-C cable as shown and connect the other end to your PC.
Attach the antenna with U.FL connector to the GPS board where indicated (not shown). Place the antenna module outdoors, or near a window for a sufficient view of the sky.
Component connections
NEO-M9N + IBOX connections
Remove the clear, plastic cover from the IBOX using the torx screwdriver.
Using jumper wires, connect the PPS, GND and TX/MISO pin on the GPS board to the designated pins on the IBOX as shown in the table/figure below.
GPS Board pin | IBOX Pin |
|---|---|
PPS | SYNC_PULSE_IN |
TX/MISO | MULTIPURPOSE_IO |
GND | GND |
Note: The PPS and TX/MISO pins with this SparkFUN board do not require additional pull-up resistors or a voltage increase adapter. Connect them directly to the IBOX pins as described.
This may not be the case with other GPS/GNSS modules on the market. Please review the Ouster Hardware Manual for further details.
Verification of Success
Once all prior steps are complete, follow the instructions below to check if the sensor is synchronized properly and reporting the expected values.
Note: Once you have configured your GPS, it is good practice to verify the signals using an oscilloscope. This will ensure you have the correct baud rate, polarity, voltage, and message type being output.
Query the status via Ouster API
HTTP: GET /api/v1/time/sensor
The sensor can be queried and configured using HTTP GET requests. This can be done using several different tools such as HTTPie, cURL, Advanced REST Client, etc. You can execute these queries from a command line application (e.g. Windows CMD, macOS & Linux Terminal)
Here are two examples using a curl command:
curl -i http://os-991234567890/api/v1/time/sensorwhere 991234567890 represents the unique serial number of your device. This can be found on the sensor label as a reference.
curl -i http://169.254.1.100/api/v1/time/sensorwhere 169.254.1.100 represents the set IPv4 address of the sensor
Response from API Query
From the outputted response below:
Verify the following:
The sensor is locked on to the PPS signal
"sync_pulse_in"(line 32)"locked": 1(line 38).
“sync_pulse_in” is “locked”: 0 “locked”: 1
The sensor is locked on the NMEA signal
"nmea"(line 4)"locked": 1(line 22)
“nmea” is “locked”: 0 “locked”: 1
The last read message looks like a valid GPRMC sentence
"last_read_message" (line 9)
"GPRMC,164853.00,A,4102.23151,N,08141.59407,W,0.052,,080823,,,D,V*16"
The timestamp time has updated to a reasonable GPS time
“timestamp” (line 41)
"time": 1691513333.6113698(line 43)
“timestamp_mode” is "TIME_FROM_SYNC_PULSE_IN"
“time”: Unix Epoch time [# of seconds since 00:00:00 January 1, 1970]
Tip: When Epoch time is converted to a human-readable time (using anhttps://www.epochconverter.com/#tools tool), the output should match both the date and time fields in the GPRMC sentence.
1691513333.6113698 = Tuesday, August 8, 2023 12:48:53 PM GMT-04:00 DST (16:48:53 GMT)
Related articles