Skip to main content

GPS

Navio2 Plus features u-blox NEO-M9N. Specifications and resources: NEO-M9N product page, data sheet UBX-19014285 (PDF), integration manual UBX-19014286 (PDF). The GNSS receiver is connected over SPI and sends messages containing location information; it can receive messages with configuration data.

U-blox NEO example​

This example is designed to show an easy way to capture and decode UBX protocol messages. For simplicity, it only parses UBX protocol NAV-STATUS and NAV-POSLLH messages.

note

Message layouts and the full UBX protocol for this generation are documented in the NEO-M9N integration manual (UBX-19014286) and related u-blox interface descriptions linked from the product documentation.

The output of the example data is: current GPS status, current longitude and latitude, current height above Ellipsoid, current height above mean sea level, vertical and horizontal accuracy estimate and the iTOW parameter. iTOW is the current millisecond time of week.

If you have not already done that, download drivers and examples code here.

C++​

note

If you have not build the examples yet, perform the following commands:

cd C++
make

To check the GPS example, you need to run this command:

cd Build
./gps

Python​

Move to the folder with the source code and run the example:

cd Python
python GPS.py

After you run the code, you will start seeing messages with current location data. Note that it takes some time for the receiver to get its position and at first you will see zero value of latitude, longitude and height. iTOW parameter will change every second. This example starts an infinite loop, so when you are done, just stop the process with CTRL+C.

For further information, see source code.

SPI communication is defined in the SPI class, located at C++/Navio/SPIdev.h. This code uses a Ublox class, which can be found in C++/Navio/Ublox.h.Ublox class features a separate scanner and parser, to take care of the incoming Ublox data.

If you want to decode a different type of message, you can add it to the function decodeMessage() of class UBXParser. Note, that to enable a certain type of message in the receiver, you need to send a configuration message first. For advanced configuration, you can use U-center software.

note

Module summary: NEO-M9N product summary UBX-19027207 (PDF).

Information about Navio2 Plus GNSS antenna is available in ANT101 - GPSGLONASS PCB Active Antenna.