Skip to content
Steven Sokol edited this page Sep 21, 2015 · 6 revisions

Files

/etc/init.d/stratux - the initialization script that starts and stops the Stratux service on the Raspberry Pi. When invoked with the “start” option, this script calls /user/sbin/stratux.

/usr/sbin/stratux - a startup script that in turn runs the /usr/sbin/start_uat script and the dump1090 application, each in a screen session.

screen - a virtual terminal emulator for Linux. Screen allows a single user session (login) to spawn additional virtual terminal sessions which can be detached / re-attached as needed. It is, in effect, a poor-man’s background task mechanism (among many other things). In this case, screen is used to run two virtual background services - the piped combination of rtl_sdr + dump978 + gen_gdl90 (in a session named .stratux) and the dump1090 application (in a session named .dump1090).

/usr/sbin/start_uat - a bash script that launches gen_gdl90 (the main Stratux application)

/usr/bin/dump1090 - 1090ES transponder data decoder binary. Run as a separate process, data produced by this program is accessed by gen_gdl90 over a network socket. Unlike dump978, dump1090 includes its own controller for the SDR hardware, so it is not necessary to use a separate rtl_sdr instance to pipe samples in via standard input.

/usr/bin/gen_gdl90 - the primary Stratux application written in Go and compiled into a binary. gen_gdl90 uses libdump978.so to acquire raw UAT data from the SDR and the raw 1090ES messages (received over a local network socket) and formats them into GDL-90 messages which are then passed to the display application (ForeFlight, Avaire, etc.) over the wifi network.

gen_gdl90 also handles several other tasks. If an RY835AI GPS / IMU / baro chip is connected, it processes the GPS, IMU and air pressure data into messages that drive the GPS and AHRS functions in ForeFlight. It also runs a small web server which provides the configuration interface. The configuration data is stored in /etc/stratux.conf.

/usr/lib/libdump978.so - library that combines rtl_sdr (the software defined radio receiver controller) and the dump978 library (for decoding UAT messages coming from the radio). This shared library is used by gen_gdl90 to acquire the raw UAT data which it then converts into GDL-90 messages.

/etc/stratux.conf - a text configuration file that stores system settings as a blob of JSON. This file is created and managed by gen_gdl90 and should not be manually edited under normal circumstances.

/var/www/index.html - the HTML source file for the administrative interface. Other files used in the admin interface can be found in /var/www/css (style sheets), /var/www/js (java scripts) and /var/www/img (images).

Initialization Sequence

All Stratux services are run as the root user. The application stack is initiated by the operating system on boot. The /etc/init.d/stratux script is fired when the system reaches run level 2 (see symlink /etc/rc2.d/S01stratux) and is terminated on shutdown (see symlink /etc/rc6.d/K01stratux).

The /etc/init.d/stratux script creates two named screen sessions. The first runs gen_gdl90 - this is the primary application stack. The second screen session runs an instance of dump1090 which looks for a secondary SDR tuner and, if available, uses that to listen for 1090ES traffic data.

Data Flow

Data flow in the current Stratux application.

Related Services

The underlying operating system provides a number of important services. First, it runs the wifi module in access point mode using hostapd. By default it creates a wifi access point called “stratux”. This can be changed by altering the configuration in /etc/hostapd/hostapd.conf.

Clients, Sockets and Data

Stratux converts data from various sources into GDL-90 format - the format used by virtually all ADS-B display units - and delivers that data to "client" applications - things like ForeFlight, Avare, Naviator, etc. It does this by emulating a FreeFlight ADS-B receiver, one of the most popular on the market. It sends out GDL-90 data on port 4000, AHRS data on port 43211, and various other data (baro altitude?) on 49002. (49002 is the port used by the popular X-Plane flight simulator.)

Stratux currently sends a copy of each data stream to each client device connected to the access point and allocated a DHCP address. It regularly looks for new DHCP addresses and adds them to the list of recipients. If you want to debug from a computer, just connect to the AP and you will immediately see UDP traffic on the associated ports.

The Stratux web admin system runs, as you might imagine, on port 80.