Knowledge Base

Everything you need to know and understand to develop V2X applications.

denm-generator.py
msg = self.generate_denm()
future = self.send_request(msg)
future.add_done_callback(self.request_completed)

GNSS Configuration

The cube:evk integrates a u-blox NEO-M8U (or M8L) receiver that provides GNSS (Global Navigation Satellite System) and IMU (Inertial Measurement Unit) data. The module combines multiple satellite constellations with the u-blox dead-reckoning sensor fusion to provide position, velocity, and timing data for V2X synchronization and vehicle motion tracking.


1. Overview

The NEO-M8U supports simultaneous reception of multiple GNSS constellations including GPS, Galileo, and GLONASS, with optional BeiDou support. It also features 3D sensor fusion through its embedded IMU, allowing continuous navigation even during temporary GNSS signal loss.

The GNSS module is automatically configured at system startup using the script:

/usr/local/bin/configure-ublox.bash

You can also execute this script manually after changing the V2X configuration or modifying any GNSS parameters.

cube:~$ sudo /usr/local/bin/configure-ublox.bash

After execution, the configuration is applied immediately. The script uses the UBX binary protocol and the ubxtool utility from the gpsd suite to send configuration messages to the receiver.

GNSS Configuration

The NEO-M8U receiver on the cube:evk provides GNSS and IMU data. Configuration is applied automatically at boot or can be re-run manually via the configure-ublox.bash script.


2. Configuration Script Breakdown

The configuration script /usr/local/bin/configure-ublox.bash applies all required settings for V2X operation. The main steps include:

  1. Setting communication parameters

    • Baud rate set to 230400 baud for high-speed serial communication.
    • Enables UBX binary mode and disables NMEA messages to reduce bandwidth.
  2. Satellite constellations

    • Enables GPS, GLONASS, and Galileo.
    • Disables BeiDou (can be re-enabled if required).
  3. Dynamic model selection

    • Adjusts the internal motion model to match the use case:
      • 0: portable
      • 2: stationary
      • 3: pedestrian
      • 4: automotive
      • 12: electric kick scooter

    Default setting: automotive (MODEL,4)

  4. Fusion and high-rate navigation

    • Enables ESF (External Sensor Fusion) and HNR (High Navigation Rate) outputs for real-time position updates.
    • Turns on relevant navigation messages (e.g., NAV-TIMEGPS, NAV-TIMELS, NAV-EELL).
  5. Timepulse configuration

    • Sets a Pulse-Per-Second (PPS) output via the CFG-TP5 command for time synchronization with the C-V2X stack.
    • Pulse width and period are configured for 1 Hz output (100 ms high, 100 ms period).

The script concludes by applying all settings to the module. It does not save configuration permanently (SAVE command commented out), so the configuration is applied on each boot for consistency.

GNSS Setup

The configuration script sets the baud rate, enables the required constellations, applies the automotive dynamic model, enables sensor fusion, and configures the PPS signal. The defaults target automotive V2X use cases.


3. UBX Protocol

The UBX protocol is u-blox's proprietary binary format for configuring and controlling GNSS receivers. It exposes finer-grained control than the NMEA text protocol.

UBX features:

  • Binary encoding for reduced overhead
  • Configuration, monitoring, and logging commands
  • Enable/disable messages, change baud rates, adjust navigation models
  • Documented in the u-blox protocol specification

For full details, see the u-blox UBX protocol document:

u-blox 8 / M8 Receiver Description and Protocol Specification (UBX-13003221)


4. IMU Orientation

The IMU (Inertial Measurement Unit) inside the u-blox NEO-M8U measures acceleration and rotation for sensor fusion and dead reckoning. The IMU's coordinate frame must match the physical orientation of the EVK for accurate results.

Default Orientation

In the standard cube:evk mounting position:

  • The IMU x-axis points forward (direction of motion).
  • The antenna connectors point left relative to the direction of travel.

This orientation aligns accelerations and angular rates with the GNSS receiver's fusion model and navigation frame.

Adjusting for Different Mounting Orientations

If the cube:evk is mounted differently (for example, rotated or installed vertically), the IMU orientation can be compensated by configuring rotation angles directly in the GNSS module. These parameters are described in detail in the u-blox 8 / M8 Receiver Description & Protocol Specification u-blox 8 / M8 Receiver Description & Protocol Specification (UBX-13003221), Chapter 28.3.1.2 User-defined IMU-mount Alignment.


5. GNSS and IMU Data Access

The GNSS and IMU data are provided through the gpsd service, which runs automatically on the cube:evk. gpsd collects binary UBX data and provides it to client applications in standardized formats over TCP port 2947.

You can access the live GNSS data locally or remotely:

Local

cube:~$ cgps -u m

Remote

host:~$ cgps -u m <evk-ip>

Viewing IMU Data

cube:~$ cgps --imu

Both commands display satellite status, position, and motion data in real-time. The -u m option selects metric units.

GPSD Version

Ensure your host system has gpsd ≥ 3.23 installed for full UBX and IMU compatibility.

Developing with cube:ubx

For deeper integration, the cube:evk provides a C++ UBX wrapper for direct communication with the u-blox NEO-M8U over the UBX binary protocol.

The wrapper handles low-level message parsing and exposes a C++ interface. It is the recommended path for custom GNSS data processing, fusion algorithms, and integration with V2X applications.

See the UBX API Documentation for details.


6. Manual Reconfiguration

If you modify /usr/local/bin/configure-ublox.bash, you can apply the new configuration without rebooting:

cube:~$ sudo /usr/local/bin/configure-ublox.bash

After execution, wait for the GNSS PPS LED (second LED) to start blinking. This indicates that the receiver is synchronized and transmitting valid data.