/gnss-nmea-demo

Spring Boot Demo project connecting to a GNSS receiver and processing NMEA messages

Primary LanguageJavaApache License 2.0Apache-2.0

GNSS NMEA Demo

Introduction

This project demonstrates the integration of an external GNSS receiver (Global Navigation Satellite System) into a Java application via the reception and processing of NMEA (National Marine Electronics Association) messages.

This demo application should work with any GNSS devices that emit NMEA messages, e.g. devices using the u-blox ZED-F9P module. Technical documentation can be found at the u-blox ZED-F9P Interface Description guide.

This application allows you to connect to your GNSS device via one of the following options:

For development and testing, the Ardusimple simpleRTK2B standalone application board was used.

Furthermore, we use Grafana to visualize some aspects of the data. As such, we use Micrometer to collect GNSS data as metrics and provide the data to Prometheus, a monitoring system and time series database. Grafana will then be used as a dashboarding tool.

Requirements

When using Bluetooth, please make sure that your GNSS-receiver's Bluetooth device is already paired with your operating system.

  • Docker to run:
    • Grafana
    • Prometheus

In order to setup Grafana and Prometheus, we will use a docker-compose stack from https://github.com/vegasbrianc/prometheus.

Grafana Dashboard: http://localhost:3000/ Prometheus Dashboard: http://localhost:9090/graph

Running

Build the Spring Boot project using Maven:

mvn clean package

Execute the app:

java -jar target/gnss-nmea-demo-1.0.0.BUILD-SNAPSHOT.jar

Note: The application should work on MacOS Catalina (v10.15.x) as well as Windows 10.

By default (without custom configuration), the app will activate the Bluetooth support and start the discovery process of Bluetooth devices/services. If found, you can select the service via the console. The application will quit if no Bluetooth service is found.

You can bi-pass the discovery service by providing the optional argument demo.settings.bluetooth-address, e.g.:

java -jar target/gnss-nmea-demo-1.0.0.BUILD-SNAPSHOT.jar \
--demo.settings.id=btspp://98D351FDB940:1;authenticate=false;encrypt=false;master=false

Alternatively, you can activate serial (USB) support by providing the demo.settings.type=serial property.

java -jar target/gnss-nmea-demo-1.0.0.BUILD-SNAPSHOT.jar \
--demo.settings.type=serial
--demo.settings.id=/dev/tty.usbmodem1422401

Result

Once connected, NMEA messages will be received, processed and relevant GNSS information is shown in the console:

  • Longitude + Latitude
  • Altitude
  • Fix status
  • Number of GNSS satellites in view