Skip to content
paony edited this page Jan 19, 2024 · 5 revisions

Stratux GPS basics

GPS is an essential part of stratux, it is used for

  • relating your own aircraft position to the aircrafts
  • for the AHRS (Attitude Heading Reference System)
  • for setting the raspberry pi system time

The following GPS sources can be used with stratux:
a GPS mouse connected to one of the USB-ports
plug and play
easy to use with a long wire
high refresh rate - low latency

a GPS module connected to the raspberry pi UART pins
wider choice of products
better value/price ratio
smaller - better to integrate into your custom case
pretty much plug and play
high refresh rate - low latency

GPS data from a t-beam flashed with softrf, OGN-tracker of GxAirCom
easy option if your stratux build has a t-beam anyway
lower refresh rate

U-blox GPS devices

Most of the GPS devices use a u-blox chip, they offer high quality at a very reasonable price. These ublox chips are then assembled with some other parts to a GPS-module or a GPS-mouse. These chips communicate via a serial interface - when using module the serial interface is connected directly to the raspberry pi's serial pins, when using a mouse there is an additional serial to usb converter chip - but it's always the same ublox chip that does the GPS stuff.
The following generations of ublox chips exist (they are all compatible with stratux): ublox 6,7 and older -> do not use them for new projects ublox 8: decent quality, use them if you can't get an ublox 9 or ublox 10 ublox 9: less power consumption than ublox 8, best performance, this is your 1. choice
ublox 10: slightly lower performance than ublox 9 but better than ublox 8 lowest power consumption, this should be your 2. choice.
Here are some typical specs of ublox8, ublox9 and ublox10 when assembled into a module with ceramic antenna:

chart

all those ublox chips are configured by stratux automaticly, regardless of being connected via usb or serial, the most important steps stratux does

  • raise the serial baud rate to a higher speed, default is 115200baud (this is done for USB-connected ublox devices, too)
  • raise the refresh rate to 10Hz if possible
  • configure the NMEA data that that the ublox should send to stratux

for ublox 6,7,8,9 some additional optimisations are configured as well - most of the time they do not make a big difference

GPS modules

you can find an abundance of GPS modules on chinese sites like aliexpress. However they vary in quality. A major chinese manufacturer of ublox based GPS modules is Beitian. They have a naming scheme that makes it easy to identify the ublox generation. The module identifieres start with 2 letter:
BK-XXX ublox9, best performance
BE-XXX ublox10 2. choice
BN-XXX ulox8
Their own shop has high shipping rates but beitian GPS modules can be found on all chinese shops like aliexpress

Attaching a GPS module to the raspberry pi

You will find zillions of good instructions if you google "wiring raspberry pi serial GPS". Use a bidirectional connection with 4 wires (VCC/5V, GND, TX, RX). If your module has more than 4 wires just use those 4 and leave the remaining unconnected. Remember to cross TX and RX. You have plenty of options for connecting the wires like soldering, crimping, jumper wires. Just keep in mind that any installation on an aircraft should be vibration resistant.

Auto configuration of ublox GPS

By default, stratux will try to autoconfigure your GPS device like so:
If you attach an usb GPS, the GPS type will be recognized by the udev system, for usb ublox devices the following values will be applied:

  • the ublox generation derived from the usb id, that hopefully has been set correctly by the usb-mouse manufacturer
  • a target baud rate of 115200 baud is assumed

If you attach a serial ublox GPS module:

  • ublox type is set to generic ublox (as "ublox" in manual configuration)
  • initial connect is tried with these baud rates: 115200, 38400, 9600
  • baudrate is raised to 115200 baud

Manual configuration of ublox GPS

The ublox configuration can be set manually by editing the config file, this overrides the auto configuration. To do this, you should have at least some basic linux knowledge, start by logging into your stratux (use ssh on linux and putty on windows) if you have configured a password for root, login as root if you haven't, login as pi:

ssh pi@stratux

default password for pi is raspberry

then do

sudo nano /boot/stratux.conf

scroll down to the bottom here you will find the following parameters:

...
  "GpsManualConfig": false,
  "GpsManualDevice": "/dev/ttyAMA0",
  "GpsManualChip": "ublox",
  "GpsManualTargetBaud": 115200,
...

GpsManualConfig:
Set this to true to conifgure GPS manually. When set to false, auto conifg is in use and all parameter below will be ignored. Default is false

GpsManualDevice: The device used for the serial communication with the GPS device. Defaults to "/dev/ttyAMA0" which is the raspi hardware UART.

GpsManualChip:
The chip build into your GPS-device. This info is used by stratux for configuring the GPS device at startup. Possible values are:
ublox6, ublox7, ublox8, ublox9, ublox10, ublox, other
"ublox" will work for any ublox device and is the default value. If you know your ublox generation using the specific config is prefered. If you select "other" no startup configuration will be aplied - the GPS-device is used as configured by default.

GpsManualTargetBaud Ther target baudrate for the serial connection. It is recommended to use one of the following values:
115200, 38400, 9600, 230400, 500000, 1000000, 2000000 All these values are also tried for the initial connection. Usually much higher baudrates as 115200 work well. Just try it.