Ground station on Raspberry Pi 4
Forfield integrators
The Raspberry Pi 4 Model B is one of the two boards Sokil GS 5.8 is built on, used as much as the Pi 5, and the board the documented XT60 ground station is built around - the v0 and v1 hardware lists are both this board. Board for board it is a Pi 5: the same 85 x 56 mm outline, the same 40-pin header, the same GPIO numbers on the same pins.
So this page is the differences. Which of the two station shapes you are wiring is on the Ground station on Raspberry Pi 5 and reads the same here; the channel plan is in Channels and switches and binding in Binding.
Where you sit reads the same too. This box's own pages at http://10.1.1.30 are where you
configure it - setup, the radio, the camera bound to it. In a split kit the station streams the
decoded video and telemetry on to the pilot's own laptop running Sokil, and the pilot flies there, at
http://127.0.0.1/: a secure origin, so the browser hands the web OSD its video decoder, which
http://10.1.1.30 does not without a per-browser flag for that address. See
Sokil on the pilot's laptop.
What you need
- A Raspberry Pi 4 Model B and a microSD card with a Sokil image.
- 5V 3A from its own BEC (see Power).
- A high-power USB WiFi card for the 5.8 GHz link - the kit uses an AC180 (RTL8812AU) with two MMCX to SMA pigtails - in the upper blue USB 3.0 socket.
- Ethernet out to the pilot's laptop or the station router.
- Whatever drives the sticks: transmitter modules on USB, or a handset adapter (Handset and CRSF).
- A case fan.
This is the board of the original GS builds (GS 5.8, GS 5.8 v1.1 and GS 2.4 - the underside
silk reads R-C-P2R-RPI4B). A station built that way differs from the picture below in three ways.
It solders the card and the adapter to the USB test pads on the back of the Pi instead of
plugging them in, so the socket matters as a port path, not as a plug. It carries one ESP32 and
one transmitter module, where a current station carries two of each - the two-module build is
newer than any of them. And the radio is a module rather than a dongle: an RF4W on 5.8, a
bare BL-R8812AF1-A with its own 3.3V step-down on 2.4.
Diagram: The XT60 build: two rails, the card on its own feed, data only into the Pi - img/gs-rpi4.svg (vector: img/gs-rpi4.svg)
Wiring
Kit picture: Ground station on Raspberry Pi 4. The parts list below carries the same wiring.
Ground station on Raspberry Pi 4
- Board: Raspberry Pi 4 Model B (BCM2711)
Parts
| Part | What it is | Attaches to | Link | Note |
|---|---|---|---|---|
| AC180 (RTL8812AU) | WiFi card | on socket USB 3.0 upper | the station names a card by the socket it is in, not by the order it was plugged in. | |
| ESP32 adapter 1 | Sokil ESP32 adapter | on socket USB 2.0 upper | comes up as /dev/ttyUSB0 - named by parameter rc_crsf_serial | |
| ESP32 adapter 2 (Repeater RC) (optional - one of several fielded shapes) | Sokil ESP32 adapter | on socket USB 2.0 lower | comes up as /dev/ttyUSB1 - named by parameter rc2_crsf_serial | |
| ELRS transmitter module 1 | Transmitter module | on ESP32 adapter 1 | CRSF TX/RX pair | |
| ELRS transmitter module 2 (optional - one of several fielded shapes) | Transmitter module | on ESP32 adapter 2 (Repeater RC) | CRSF TX/RX pair | |
| Case cooling fan | Cooling fan | not attached to this box | runs off the board's own 5V feed on every sheet, together with a heatsink on the board and on the radio module - the boxes are closed and they run hot. | |
| Pilot laptop station | Pilot laptop | on connector Ethernet | reads the handset and sends the sticks here as CRSF on port 14540. |
Power feeds
| Load | Voltage | BEC output (solder pads) | Note |
|---|---|---|---|
| Raspberry Pi 4 Model B - Header 5V | 5V | Matek BEC12S Pro - 5V, nothing bridged (factory default) | |
| AC180 (RTL8812AU) | 5V | Matek BEC12S Pro - 5V, nothing bridged (factory default) | sensitive - its own BEC |
| ELRS transmitter module 1 | 8V | Matek BEC12S Pro - 8V, 8V pads bridged | electrically noisy - its own BEC |
| ELRS transmitter module 2 | 8V | Matek BEC12S Pro - 8V, 8V pads bridged | electrically noisy - its own BEC - optional - one of several fielded shapes |
Parameters the setup wizard writes for this kit
| Parameter | Value |
|---|---|
| rc_crsf_baud | 460800 |
| rc2_enabled | 1 |
| rc2_crsf_baud | 460800 |
Figure: The whole station: the AC180 in the upper blue USB 3.0 socket, the ESP32 adapter with its transmitter module on a black USB 2.0 socket, Ethernet out to the pilot's laptop, a case fan, and a BEC each for the Pi, the card and the module. The second adapter and module are the Repeater RC pair, drawn optional: the original builds carry one radio, and a two-pilot station adds them and a fourth BEC.
The 40-pin header is not part of that picture on most builds. When yours needs it, these are the UARTs the Sokil image enables:
Board picture: Raspberry Pi 4 Model B. The tables below carry the same pins, sockets and power inputs.
Raspberry Pi 4 Model B (BCM2711)
- Reported by the device as dev_board: rpi4
- Board size: 85 x 56 mm
- Highlighted on the picture: UART2 (/dev/ttyAMA2), UART3 (/dev/ttyAMA3), UART4 (/dev/ttyAMA4), UART5 (/dev/ttyAMA5).
- Nothing is fed from the board's own rails: the board takes a Matek BEC12S Pro, wired to its preferred power input - Header 5V (5V), pads set to 5V, nothing bridged (factory default). Loads at the same voltage may share that BEC; WiFi cards, ELRS transmitters and other high-powered or noisy devices get their own.
Connectors and sockets
| Connector | Kind | Edge | USB port path | Note |
|---|---|---|---|---|
| BCM2711 | chip | |||
| RAM | chip | |||
| PoE | other | |||
| Ethernet | eth | right | ||
| USB 3.0 upper | usb-a | right | 1-1.1, 2-1 | |
| USB 3.0 lower | usb-a | right | 1-1.2, 2-2 | |
| USB 2.0 upper | usb-a | right | 1-1.3, 2-3 | |
| USB 2.0 lower | usb-a | right | 1-1.4, 2-4 | |
| USB-C 5V | usb-c | bottom | ||
| HDMI0 | hdmi | bottom | ||
| HDMI1 | hdmi | bottom | ||
| CAM | csi | bottom | ||
| A/V | other | bottom | ||
| DISP | dsi | left | ||
| microSD | sd | left | on the back of the board |
Header pins: GPIO
| Pin | Label | Type | Function here |
|---|---|---|---|
| 1 | 3V3 | 3v3 | |
| 2 | 5V | 5v | Header 5V |
| 3 | GPIO2 | i2c | UART2 CTS |
| 4 | 5V | 5v | |
| 5 | GPIO3 | i2c | UART2 RTS |
| 6 | GND | gnd | mini-UART (pins 8/10) Ground; UART0 PL011 (pins 8/10, needs disable-bt) Ground; Header 5V Ground |
| 7 | GPIO4 | uart | UART3 TX |
| 8 | GPIO14 | uart | mini-UART (pins 8/10) TX; UART5 CTS; UART0 PL011 (pins 8/10, needs disable-bt) TX |
| 9 | GND | gnd | mini-UART (pins 8/10) Ground; UART3 Ground; UART0 PL011 (pins 8/10, needs disable-bt) Ground |
| 10 | GPIO15 | uart | mini-UART (pins 8/10) RX; UART5 RTS; UART0 PL011 (pins 8/10, needs disable-bt) RX |
| 11 | GPIO17 | gpio | mini-UART (pins 8/10) RTS |
| 12 | GPIO18 | pwm | PCM_CLK / PWM0 |
| 13 | GPIO27 | gpio | |
| 14 | GND | gnd | |
| 15 | GPIO22 | gpio | |
| 16 | GPIO23 | gpio | |
| 17 | 3V3 | 3v3 | |
| 18 | GPIO24 | gpio | |
| 19 | GPIO10 | spi | UART4 CTS |
| 20 | GND | gnd | UART4 Ground |
| 21 | GPIO9 | uart | UART4 RX |
| 22 | GPIO25 | gpio | |
| 23 | GPIO11 | spi | UART4 RTS |
| 24 | GPIO8 | uart | UART4 TX |
| 25 | GND | gnd | UART2 Ground; UART4 Ground |
| 26 | GPIO7 | spi | UART3 RTS |
| 27 | GPIO0 | uart | UART2 TX |
| 28 | GPIO1 | uart | UART2 RX |
| 29 | GPIO5 | uart | UART3 RX |
| 30 | GND | gnd | UART2 Ground; UART3 Ground; UART5 Ground |
| 31 | GPIO6 | gpio | UART3 CTS |
| 32 | GPIO12 | uart | UART5 TX |
| 33 | GPIO13 | uart | UART5 RX |
| 34 | GND | gnd | UART5 Ground |
| 35 | GPIO19 | gpio | PCM_FS |
| 36 | GPIO16 | gpio | mini-UART (pins 8/10) CTS |
| 37 | GPIO26 | gpio | |
| 38 | GPIO20 | gpio | PCM_DIN |
| 39 | GND | gnd | |
| 40 | GPIO21 | gpio | PCM_DOUT |
Serial ports (UARTs)
| UART | Device node | TX | RX | Ground | Note |
|---|---|---|---|---|---|
| mini-UART (pins 8/10) (uart1) | /dev/ttyS0 | Pin 8 (GPIO) | Pin 10 (GPIO) | Pin 6 (GPIO), Pin 9 (GPIO) | the system console - a getty is already talking on it - The default header UART (mini-UART); its baud follows the core clock unless the clock is fixed. |
| UART2 | /dev/ttyAMA2 | Pin 27 (GPIO) | Pin 28 (GPIO) | Pin 25 (GPIO), Pin 30 (GPIO) | Enabled by a dtoverlay=uartN line in config.txt - absent from the list until then. |
| UART3 | /dev/ttyAMA3 | Pin 7 (GPIO) | Pin 29 (GPIO) | Pin 9 (GPIO), Pin 30 (GPIO) | Enabled by a dtoverlay=uartN line in config.txt - absent from the list until then. |
| UART4 | /dev/ttyAMA4 | Pin 24 (GPIO) | Pin 21 (GPIO) | Pin 20 (GPIO), Pin 25 (GPIO) | Enabled by a dtoverlay=uartN line in config.txt - absent from the list until then. |
| UART5 | /dev/ttyAMA5 | Pin 32 (GPIO) | Pin 33 (GPIO) | Pin 30 (GPIO), Pin 34 (GPIO) | Enabled by a dtoverlay=uartN line in config.txt - absent from the list until then. |
| UART0 PL011 (pins 8/10, needs disable-bt) | /dev/ttyAMA0 | Pin 8 (GPIO) | Pin 10 (GPIO) | Pin 6 (GPIO), Pin 9 (GPIO) | shares pins with another UART; only one exists at a time - The PL011 UART0 is wired to Bluetooth by default; dtoverlay=disable-bt moves it to pins 8/10 as ttyAMA0. |
Power inputs
| Input | Voltage | Current | Where | Note |
|---|---|---|---|---|
| Header 5V | 5V | 3A | Pin 2 (GPIO), Ground Pin 6 (GPIO) | the feed a Sokil install uses - 5V/3A. The BEC's + goes to pin 2 or 4, its ground to pin 6 (or any GND pin); USB-C is the alternative when a 3A supply with a plug is at hand. |
| USB-C | 5V | 3A | USB-C 5V |
Notes
- Pin 1 (3V3) is the square pad at the microSD end, on the row further from the board edge. Odd pins inside, even pins along the edge.
- wfb0 / wfb1 are the names the station gives a WiFi card by the socket it is in - the same card is wfb0 in one socket and wfb1 in another. Sockets marked ? have not been measured on a real board.
Figure: The four header UARTs the Sokil image enables, with the BEC on header pin 2. Pins 8 and 10 stay dimmed: that pair is the mini-UART, and it is the board's console.
| UART | Port | TX pin | RX pin | GND | Notes |
|---|---|---|---|---|---|
| mini-UART | /dev/ttyS0 |
8 | 10 | 6 or 9 | the console - enable_uart=1 brings it up, and its baud follows the core clock |
| UART2 | /dev/ttyAMA2 |
27 | 28 | 25 or 30 | CTS 3, RTS 5 |
| UART3 | /dev/ttyAMA3 |
7 | 29 | 9 or 30 | CTS 31, RTS 26 |
| UART4 | /dev/ttyAMA4 |
24 | 21 | 20 or 25 | CTS 19, RTS 23 |
| UART5 | /dev/ttyAMA5 |
32 | 33 | 30 or 34 | its CTS / RTS land on pins 8 and 10 |
| UART0 (PL011) | /dev/ttyAMA0 |
8 | 10 | 6 or 9 | only with dtoverlay=disable-bt, on the mini-UART's pins |
Two things about that table:
- The pins are a Pi 5's, the names are shifted by one.
/dev/ttyAMA2here is pins 27 / 28, which on a Pi 5 is/dev/ttyAMA1; the whole run slides the same way, and the Pi 5's/dev/ttyAMA0is this board's mini-UART. Copy the wiring from a Pi 5 and the wires are right while the port name in the settings is wrong. - A UART exists only when its overlay is on. The installer appends a
sokil-uartsblock to/boot/firmware/config.txt-enable_uart=1plusdtoverlay=uart2throughdtoverlay=uart5- and it takes a reboot. The bench Pi 4 then reports exactlyttyS0andttyAMA2..5.
Each of those four has a CTS / RTS pair as well as TX and RX, and the pair is nowhere near the data pins - UART5's lands on pins 8 and 10, which are the mini-UART's own. Read the whole row before you pick a pin.
Core has to be recent to list them at all: they hang off the kernel's amba bus, which core only
started reading on 2026-08-19, so older firmware draws ttyAMA2..5 as "not detected right now"
while the device paths exist.
USB sockets
| Socket | Port path | A Realtek card here is | In the documented build |
|---|---|---|---|
| USB 3.0 upper (blue) | 1-1.1 / 2-1 |
wfb0 | the AC180 |
| USB 3.0 lower (blue) | 1-1.2 / 2-2 |
wfb1 | empty - the v0 build has one card |
| USB 2.0 upper (black) | 1-1.3 / 2-3 |
wfb0 | 2.4 GHz transmitter module |
| USB 2.0 lower (black) | 1-1.4 / 2-4 |
wfb0 | 900 MHz transmitter module |
All four hang off one VL805 hub. Two of them were measured on the bench Pi 4 - a USB3 card in the
upper blue socket, a camera in the upper black - and the other two follow from the hub's port
order, which is why no socket on this board is drawn with a ?. The row worth reading twice is the
second: only the lower blue socket names a card wfb1. One card belongs in the upper blue socket,
which is what the WiFi reception card (parameter vrx_wifi_wlan) defaults to; two cards need both blue sockets, because either black
socket also gives wfb0 and collides.
That VL805 is the board's own hub, and the port paths above already run through it. An external hub is another matter: USB hubs are to be avoided, and the card never goes behind one. Its frames would queue behind the adapters' on the hub's single upstream link; if the card is powered through the hub, transmit bursts can make the hub's 5V supply sag, causing the card to re-enumerate and often come back transmit-only; and its port path stops being the one in the table. Four sockets is enough for a card and two adapters; if a build of yours needs more, the hub goes on a black socket and carries adapters only.
The build takes the card's current straight off the 5V rail and runs only the twisted D+ / D- pair
into the upper blue socket - the socket carries data, the battery carries current. If the card drops
out under load,
turn USB autosuspend off: echo -1 > /sys/module/usbcore/parameters/autosuspend.
The adapters belong in the black USB 2.0 pair, and which of the two sockets each takes does
not matter. Which becomes /dev/ttyUSB0 and which /dev/ttyUSB1 is still plain enumeration order,
so with two identical adapters plug the primary one in first and read the ports off the Hardware
page.
A transmitter module above 500 mW gets a patch antenna, 20 cm or more from this box. A module of that power (ELRS 2 W, SineLink 2 W, Skyline and the like) on a dipole closer than 20 cm to the WiFi card, its USB cable or the board knocks the card off USB, at random or for good, and can kill it. Fit the module a patch antenna at least 20 cm from the Sokil hardware and not aimed at it - the antenna rule and the symptoms.
Power
5V 3A into header pin 2 or 4, ground on pin 6, from the board's own BEC. The USB-C socket is the
alternative, and is what the documented build uses through a breakout off its 5V DC-DC. The Pi 5's
PSU_MAX_CURRENT caveat has no twin here: it is an EEPROM setting on that board, and the Power
card carries the note only there.
That build runs two rails off one XT60 - 5V for the board and the card, 12V for the transmitter modules - and feeds the Pi and the card from the same 5V converter. That predates the current rule: one feed per box, from its own BEC, is what Power and the BEC says now, and it is what to build.
A BEC has one output, so count the loads before you order: the board, the WiFi card and each transmitter module get a BEC each - three on a plain station, four on this build with its two modules. An ELRS transmitter is noisy and must never share a BEC with the WiFi card.
What setup asks and writes
Run Setup (on the station) on the station. The normal station sequence is Start, Role, Link, Link settings, Control, Switches, Hardware, Review. If the selected role needs activation, Activation appears after Role; a Board step follows when the device reports multiple board layouts. The Camera step appears only on a box that captures video. The planned settings are written when you press Apply on Review. Activation, file imports, binding and software updates take effect separately and can change the device before Apply.
A Pi 4 is set up exactly like a Pi 5. Setup recognizes the Board (parameter dev_board), and core's
defaults for rpi4 and rpi5 are identical line for line. Any Pi is the radio-head end of the control link, so
Control opens with "This board is the radio head: it receives the sticks from the pilot's station
and drives the transmitter modules. Pick the port each module is on."
For a station on the WiFi link, setup's own writes are:
| Setting | Value | Why |
|---|---|---|
Link transport Radio in UFEC mode (parameter vrx_ufec_wifi) (VRX settings > Connection) |
UFEC | receive video, MAVLink and the tunnel over UFEC WiFi |
MAVLink FEC / Second MAVLink FEC (parameters vrx_ufec3_fec, vrx_ufec4_fec) |
4:2 |
parity on both MAVLink streams this station sends up - RC and telemetry |
MAVLink and Second MAVLink Mode (parameters vrx_ufec3_mode, vrx_ufec4_mode) |
1 (low latency) |
how those streams are sent |
Serve older WFB drones (parameter vrx_wfb_fallback) |
on | drop back to classic WFB when an older drone shows up |
WiFi power (parameter vrx_wifi_power) (VRX settings > Channels) |
2 |
the station card's own transmit power - the telemetry and RC uplink - at level 2 of 0-5 |
VRX WiFi channels, one per position (parameter rc_act_vrx_channels) |
40|52|64|100|120|140|157|177 |
the eight channels the switch steps through |
Repeater RC (parameter rc2_enabled) |
on | Repeater RC, the second handset's own input |
its CRSF adapter row's Output Serial (UART) on Serial port (parameter rc2_crsf_serial) |
/dev/ttyUSB1 |
the second transmitter module |
that row's Baudrate (parameter rc2_crsf_baud) |
460800 |
its serial rate |
Main video camera (parameter vtx_presets_streamer) |
(none) | a station has no camera of its own to announce |
Apply returns the RC target - RC outputs Send to (parameter rc_ip) - to its default; pick your camera in the camera switcher afterwards.
It also switches every capture and command streamer off - Sokil Eye, Sokil Eye 2, Sokil Eye 3, CMD
Streamer and CMD Streamer 2 (parameters vtx_eye_enabled, vtx_eye2_enabled, vtx_eye3_enabled, vtx_cmd_enabled, vtx_cmd2_enabled) -
for the same reason. The first radio stays on core's default /dev/ttyUSB0 at 460800 and the card
stays on wfb0; where each stream arrives is core's too, a CRSF (ELRS)
Input (parameter rc_crsf_in_addr) of Receive RC over UDP - it listens on 0.0.0.0:14540 - beside the
Repeater RC adapter row's Input (parameter rc2_crsf_in_addr) in the same mode on 0.0.0.0:14541.
Those two addresses are what the mode means, so neither row shows an address to read; an address row
appears only under UDP manual.
Everything else comes
from the baseline read off the board at the start of the run - except the keys that carry your way
in to the box. The Ethernet card's IP address, Gateway and their
neighbors (parameters eth_ip, eth_gateway, eth_dhcp, eth_never_default, eth_conn) keep whatever the device already has,
so a run cannot cut the link you are talking over.
The handset side
The primary radio is on the CRSF (ELRS) Serial port (parameter rc_crsf_serial) of Control > RC Wiring,
always at 460800; the second is Repeater RC on its CRSF adapter's
Serial port (parameter rc2_crsf_serial), the separate input the pilot of a repeater aircraft flies on. Both end on a wire:
the handset adapter if the pilot's radio is read here, the transmitter module if this box is the mast
end.
⚠ Repeater RC is written on every ground station, and it stays silent until a repeater is
connected. A head with one module has no /dev/ttyUSB1 to open, and nothing complains: this
input's findings, its overlay alert and its missing-port mark all wait for a repeater to be on the
air - the Repeater RC card then says A repeater is connected (parameter rc2_in_use). The Control step has no switch to decline it - the plan decides, like every other
card there - so leave it armed; the Repeater RC card on the Control settings page carries the
switch after setup.
Core's default for the CRSF (ELRS) Serial port (parameter rc_crsf_serial) on a Pi is /dev/ttyUSB0, the USB adapter, not a header UART;
/dev/ttyS0 on this board is the console mini-UART on pins 8 / 10 and is never the answer.
First checks after Apply
- Hardware (on the station) draws a Raspberry Pi 4, with
ttyAMA2..5present and the card on the upper blue socket named wfb0. A port that is on but silent is amber, and the byte counters under each row (parameterdev_tty_stats) say whether anything ever moved. - Channel and power come up on VRX settings (on the station). Core's default on this board is
already the AC180 2W ladder -
1|10|15|20|25|28dBm across the six switch positions, where a generic card is1|20|30|50|55|58- and the other AC180 variants differ again. Pick the card in the Card model row there instead of typing numbers. - Diagnostics (on the station) lists whatever the station found wrong about itself.
- Then bind the camera and work through After Apply.
Four cores on a Broadcom BCM2711 make this the slowest of the bench stations, and the bench uses it as exactly that - the slow-GS floor. The rule that goes with it: if something is fast enough here, it is fast enough everywhere.
Related guides
- Ground station on Raspberry Pi 5 - the common half of this page.
- Sokil on the pilot's laptop - the seat you fly from, at
http://127.0.0.1/. - Handset and CRSF - the adapter, its firmware, and the transmitter modules.
- Channels and switches - the hop plans and the switch roster.
- Binding - pairing the camera this station will fly.
- After Apply - the checks to run before the first flight.
- Choose a board - the two Pis against everything else.
- How setup works - the diff, the version lock, what it never writes.
- Power and the BEC - one BEC per feed, and the jumper table.