> This page is for Firmware, version 4.0 (default).
> For other versions, use one of these documentation indexes:
> - 4.0 (default): https://docs.ouster.com/sensor-docs/firmware/4.0/llms.txt
> - 3.2: https://docs.ouster.com/sensor-docs/firmware/3.2/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ouster.com/sensor-docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ouster.com/sensor-docs/_mcp/server.

# GPS/GNSS Synchronization

> Synchronize sensor timestamps to a GPS/GNSS source using PPS and NMEA inputs.

For GPS wiring instructions, see [GPS/GNSS Synchronization](/sensor-docs/hardware/rev7/gps-gnss-synchronization) in the hardware user manual.

## Configuring the Ouster Sensor

With GPS connections in place, configure the following parameters to synchronize the sensor's timestamp to the GPS signal:

| Parameter                  | Value                                                                                                                              |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `timestamp_mode`           | `TIME_FROM_SYNC_PULSE_IN`                                                                                                          |
| `multipurpose_io_mode`     | `INPUT_NMEA_UART`                                                                                                                  |
| `sync_pulse_in_polarity`   | Match the polarity of the GPS PPS signal                                                                                           |
| `multipurpose_io_polarity` | Match the polarity of the GPS NMEA UART signal                                                                                     |
| `nmea_baud_rate`           | Match the baud rate of the GPS output                                                                                              |
| `nmea_leap_seconds`        | Current TAI–UTC offset — check [leapsecond.com](http://www.leapsecond.com/java/gpsclock.htm); at time of writing the value is `37` |

## Checking for Sync

After applying the configuration above, verify synchronization using `GET /api/v1/time`:

1. **PPS lock** — the response should include:
   ```json
   "sync_pulse_in": { "locked": 1 }
   ```
   If not, recheck `sync_pulse_in_polarity`.

2. **NMEA lock** — the response should include:
   ```json
   "nmea": { "locked": 1 }
   ```
   If not, recheck `multipurpose_io_polarity` and `nmea_baud_rate`.

3. **NMEA decoding** — `last_read_message` should contain a valid GPRMC sentence:
   ```json
   "decoding": { "last_read_message": "GPRMC,024041.00,A,5107.0017737,N,11402.3291611,W,0.080,323.3,020420,0.0,E,A*20" }
   ```

4. **Timestamp** — `timestamp.mode` should be `TIME_FROM_SYNC_PULSE_IN` and `timestamp.time` should reflect valid GPS time.

## Example Response

Full example output from `GET /api/v1/time`:

```json
{
  "timestamp": {
    "time": 1585881641.96139565999999,
    "mode": "TIME_FROM_SYNC_PULSE_IN",
    "time_options": {
      "sync_pulse_in": 1585881641,
      "internal_osc": 302,
      "ptp_1588": 309
    }
  },
  "sync_pulse_in": {
    "locked": 1,
    "diagnostics": {
      "last_period_nsec": 10,
      "count_unfiltered": 832,
      "count": 832
    },
    "polarity": "ACTIVE_HIGH"
  },
  "multipurpose_io": {
    "mode": "INPUT_NMEA_UART",
    "sync_pulse_out": {
      "pulse_width_ms": 10,
      "angle_deg": 360,
      "frequency_hz": 1,
      "polarity": "ACTIVE_HIGH"
    },
    "nmea": {
      "locked": 1,
      "baud_rate": "BAUD_9600",
      "diagnostics": {
        "io_checks": {
          "bit_count": 2938457,
          "bit_count_unfilterd": 2938457,
          "start_char_count": 832,
          "char_count": 66526
        },
        "decoding": {
          "last_read_message": "GPRMC,024041.00,A,5107.0017737,N,11402.3291611,W,0.080,323.3,020420,0.0,E,A*20",
          "date_decoded_count": 832,
          "not_valid_count": 0,
          "utc_decoded_count": 832
        }
      },
      "leap_seconds": 37,
      "ignore_valid_char": 0,
      "polarity": "ACTIVE_HIGH"
    }
  }
}
```