An RWR (radar warning receiver) repeater for the F/A-18C in DCS World. A small round display on your cockpit panel shows the same picture as the Hornet's own RWR.
DCS gives scripts no RWR contacts for the Hornet. Instead its RWR display is drawn into a hidden corner of the DCS window, captured with ffmpeg, and streamed to the board as video. While no video arrives, the board shows a status screen.
dcs/Install-RwrViewport.ps1adds two lines that tell the Hornet to also draw its RWR into a viewport namedF18_RWR. This is the same way the AMPCD gets exported.receiver/rwr_stream.batuses ffmpeg to capture that area of the DCS window and sends it to the board as JPEG video.F18_RWR.inoshows the frames and adds the rings and tick marks from the real instrument's face. It also makes the picture brighter, filters out JPEG noise and colours it green. The buzzer is held off.- Nothing reads
Export.luaor callsLoGet*. DCS does not give the Hornet's RWR contacts to scripts anyway. - The board can only show the pixels DCS already drew on the cockpit RWR. That means no emitter IDs, no exact bearings and no signal strength values.
- The firmware does not analyse the image. It does not track symbols, raise its own alerts or keep a history.
The only benefit is not having to look down into the cockpit, which is the same as any physical home-cockpit RWR.
This is not a monitor-setup change only. It also edits a file inside the game folder:
Mods\aircraft\FA-18C\Cockpit\Scripts\TEWS\indicator\BAKE\RWR_ALR67_bake_init.lua.
- On multiplayer servers that enforce the integrity check, a changed cockpit script can fail it. You may get kicked, or the server may not let you into the Hornet.
- This is about file integrity, not cheating. No server admin would see an advantage in this setup, but the check cannot tell a harmless change from a harmful one, so it will still flag it.
- If a server you play on rejects the file, restore the
.origcopy before joining (see Undoing it), or run a DCS repair.
- Waveshare ESP32-S3-LCD-2.8C: 480×480 round ST7701 panel, 16 MB flash, OPI PSRAM, buzzer.
- A USB-C data cable (not a charge-only one) to flash the board.
- A Windows 10 (version 1903 or later) or Windows 11 PC running DCS, on the same Wi-Fi network as the board. Wi-Fi must be 2.4 GHz (the ESP32 cannot join 5 GHz), and the router must not isolate clients from each other.
- ffmpeg 8 or later on the PATH (the
gfxcapturefilter is needed), driven byreceiver\rwr_stream.bat. - To build: Python 3.11, about 8 GB of free disk space (the toolchain and ESP-IDF in
.piocoretake 7.3 GB) and an internet connection for the first build.pio.ps1installs PlatformIO itself.
| Path | What it is |
|---|---|
F18_RWR/ |
The board firmware source. See F18_RWR/README.md for its options. |
platformio.ini |
Build settings: board, libraries, COM port and the custom sdkconfig. |
pio.ps1 |
Runs the project's own PlatformIO (installs it into .piocore on first use). |
dcs/Install-RwrViewport.ps1 |
Makes the Hornet draw its RWR into the capture area. |
receiver/rwr_stream.bat |
Streams the Hornet RWR to the board with ffmpeg. |
receiver/rwr_test.bat |
Streams a test pattern to the board, for checking it without DCS. |
Do this once, in order. Commands are for PowerShell; winget ships with current Windows 10/11.
- Install the tools:
Open a new PowerShell window afterwards so the new programs are on the PATH.
winget install --id Git.Git -e winget install --id Python.Python.3.11 -e winget install --id Gyan.FFmpeg -e- Python 3.11 runs PlatformIO.
pio.ps1finds it through thepylauncher that this installer adds. Typingpythonalone may open the Microsoft Store; that stub is not used. - ffmpeg must be version 8 or later. Check it with
ffmpeg -filters | findstr gfxcapture: it must print agfxcaptureline. If it prints nothing, the ffmpeg is too old (checkffmpeg -version).
- Python 3.11 runs PlatformIO.
- USB driver. The board's USB-serial chip is a WCH CH343. Windows 11 usually installs it by itself. If the board shows in Device Manager under Other devices or with a warning icon, install the driver from wch-ic.com and replug the board.
- Get the project. Clone it, or download the ZIP from the repository and unzip it:
Keep the path short and without spaces, such as
git clone <repository-url> C:\Projects\F18-RWR cd C:\Projects\F18-RWRC:\Projects\F18-RWR. The ESP-IDF build creates deep folder paths and can fail under long ones. - PowerShell scripts. PowerShell blocks scripts by default. Allow local scripts once for your user:
Or run each command as
Set-ExecutionPolicy -Scope CurrentUser RemoteSignedpowershell -ExecutionPolicy Bypass -File .\pio.ps1 .... - Firewall. The first time ffmpeg runs, Windows asks to allow it on the private network. Allow it.
- DCS World must already be installed. Note its folder (the default for the install script is
G:\DCS World; Steam installs live under...\steamapps\common\DCSWorld). Start DCS once soSaved Games\DCSexists.
Then continue with sections 1 to 3.
-
Wi-Fi. Copy
F18_RWR\wifi_config.example.htoF18_RWR\wifi_config.hand put in your network name and password. The file is git-ignored. (The SARI'swifi_config.hhas the same format and can be copied as it is.) -
COM port. Plug in the board and find its port in Device Manager under Ports (a CH343 "USB-Enhanced-SERIAL" device), or with
.\pio.ps1 device listonce step 3 has run. Setupload_portandmonitor_portinplatformio.inito it. They are set to the placeholderCOM3in the repository. -
Build and flash:
.\pio.ps1 run -t uploadThe first run is slow: it creates
.piocore\venv, installs PlatformIO, downloads the pioarduino platform, toolchain and ESP-IDF into.piocore\core, then rebuilds the Arduino libraries with the custom sdkconfig. Allow from 15 to 30 minutes or more. Later builds take under a minute.If the upload cannot connect, hold the board's BOOT button while plugging it in, then try again.
-
The board shows
JOINING WIFI, thenNO VIDEOwith its IP address. Reserve that address in your router, because the batch files send to it.
Other commands:
| Command | Does |
|---|---|
.\pio.ps1 run |
Build only. |
.\pio.ps1 run -t upload |
Build and flash to the port in platformio.ini. |
.\pio.ps1 run -t upload --upload-port COM5 |
Flash to another port this once. |
.\pio.ps1 device list |
List serial ports. |
.\pio.ps1 run -t clean |
Delete the build output, so the next build starts over. |
PlatformIO here is project-local: pio.ps1 installs it into the project's .piocore folder, pinned to
PlatformIO Core 6.2.0 and pioarduino 55.03.312-1. It does not use or change a PlatformIO that VS Code may have
installed, and VS Code is not needed.
The Arduino IDE links the ESP-IDF libraries that come precompiled with the board package. Those run the display's
refresh interrupt from flash, so a flash or PSRAM stall starves it, and the picture jumps, doubles or shows lines.
PlatformIO (with the pioarduino platform) rebuilds those libraries with the settings in platformio.ini under
custom_sdkconfig:
| Setting | Effect |
|---|---|
CONFIG_LCD_RGB_ISR_IRAM_SAFE |
The panel refresh interrupt runs from internal RAM. |
CONFIG_GDMA_CTRL_FUNC_IN_IRAM, CONFIG_GDMA_ISR_IRAM_SAFE |
So does the DMA that feeds it. |
CONFIG_SPIRAM_XIP_FROM_PSRAM |
Program code runs from PSRAM, so flash access no longer stalls the cache. |
CONFIG_ESP32S3_DATA_CACHE_LINE_64B |
Larger cache lines for faster PSRAM reads. |
With these, the board runs the stream at 12 frames a second with no glitches.
- Edit
BOARDat the top ofreceiver\rwr_test.batto the board's address. - Run
receiver\rwr_test.bat. Green symbols should move around the board's screen. Press Ctrl+C to stop.
The board takes one stream at a time. If receiver\rwr_stream.bat is running, close it first, or the test
waits behind it.
Or send ffmpeg's test pattern directly:
ffmpeg -re -f lavfi -i testsrc2=size=480x480:rate=12 -t 15 -c:v mjpeg -q:v 5 -pix_fmt yuvj420p -huffman default -f mjpeg tcp://<board-ip>:7791
Red should be on the left and the checkerboard at the bottom right.
One-time setup:
- Install the viewport patch. Run in PowerShell (add
-DcsDirif DCS is not inG:\DCS World):It appends two lines to the Hornet'spowershell -ExecutionPolicy Bypass -File dcs\Install-RwrViewport.ps1Mods\aircraft\FA-18C\Cockpit\Scripts\TEWS\indicator\BAKE\RWR_ALR67_bake_init.lua(the original is kept as.orig). DCS updates and repairs restore the original file, so run it again after one. - Add the viewport to your monitor setup. In the MonitorSetup file you use
(
Saved Games\DCS\Config\MonitorSetup\, selected in DCS under Options > System), add a 480×480 area that lies inside the DCS window but that no monitor shows, and name itF18_RWR:The numbers above are for this PC: a 5488×1536 DCS window, with the area right of the main screen and below the left DDI. Choose coordinates that fit your own layout. Then restart DCS fully, because it reads the monitor setup only at startup.rwr = { x = 3712; y = 912; width = 480; height = 480; } F18_RWR = rwr
- ffmpeg 8 or later must be installed (section 0, step 1).
- DCS window size. The capture crops the viewport out of the DCS window, so the window must be the full size of the
monitor setup, including the hidden area. If DCS runs in a smaller window than the setup (for example a 3440×1440
screen when the setup is 5488×1536), the viewport lies outside the window and ffmpeg fails with
Picture size ... is invalid. - Set up the batch file. Edit the settings at the top of
receiver\rwr_stream.bat:BOARDis the board's address from section 1, andRWR_X,RWR_Y,WIN_WandWIN_Hmust match your viewport and DCS window.
Every session: run receiver\rwr_stream.bat and leave it open. It waits for DCS and the board, and reconnects
when either restarts. The board takes one stream at a time, so stop the test batch file before starting it.
Get into the Hornet with the RWR on. Radar emitters then appear on the board. The board's buzzer stays off.
| Screen | Meaning |
|---|---|
JOINING WIFI |
Connecting to the network. |
NO VIDEO + IP address |
No video frame for 1.5 s. This is the address the stream goes to. |
| Video of the cockpit RWR with rings and ticks | The stream is live. |
| Port | Used for |
|---|---|
| TCP 7791 (board) | JPEG video stream from ffmpeg. |
The Windows firewall must allow ffmpeg to connect out, and the PC and board must be on the same network.
Open the board's port at 115200 baud. This board's USB chip can show nothing in some serial monitors; reading the port from PowerShell works:
$p = New-Object System.IO.Ports.SerialPort COM3,115200; $p.Open(); Start-Sleep 10; $p.ReadExisting(); $p.Close()
The log shows the Wi-Fi join, each video connection, every 100th frame, and every 5 s while the picture changes the number of frames drawn, the draw time and the free heap.
The source is in F18_RWR\; platformio.ini points PlatformIO there with src_dir = F18_RWR. The constants at the
top of F18_RWR.ino are described in F18_RWR/README.md. Build and flash again with
.\pio.ps1 run -t upload.
Changing anything under custom_sdkconfig makes the next build rebuild the Arduino libraries again (slow, once).
| Symptom | Check |
|---|---|
| Batch file keeps printing "stopped ... retrying" | Either ffmpeg cannot find the DCS window or cannot reach the board. DCS must be running, ffmpeg must be version 8 or later with gfxcapture, and BOARD must be the address the board shows. |
| Stream runs but the board stays black | DCS is not drawing into the viewport. Check the patch is applied (rerun the script after a DCS update), the F18_RWR entry is in the monitor setup you actually use, DCS was restarted, and you are in the cockpit with the RWR on. |
| Capture is cropped wrong | The viewport must lie inside the DCS window, and WIN_W/WIN_H must match the real window size. |
Picture size ... is invalid from ffmpeg |
The DCS window is smaller than the monitor setup, so the viewport is outside it. See section 3, step 4. |
Python 3.11 not found from pio.ps1 |
Install it with winget install --id Python.Python.3.11 -e and open a new PowerShell window. |
pio.ps1 cannot be loaded because running scripts is disabled |
Set the execution policy (section 0, step 4), or use powershell -ExecutionPolicy Bypass -File .\pio.ps1 .... |
| First build fails while downloading | Run it again; it continues where it stopped. If it keeps failing, delete .piocore and start over. |
Build fails with a missing .ino.cpp or similar file |
Run the build again. If it persists, run .\pio.ps1 run -t clean first. |
| Build fails with path or file-name errors | Move the project to a short path without spaces. |
Could not open COM3 |
Wrong port, or another program (a serial monitor) has it open. |
| Upload fails or the COM port is missing | Use a data cable, install the CH343 driver, and hold BOOT while plugging in. |
To start the build completely fresh, delete .pio (build output) and .piocore (PlatformIO and its toolchains);
the next .\pio.ps1 run installs everything again.
RWR_ALR67_bake_init.lua.origbeside the patched Hornet file is its original. A DCS repair also restores it.Saved Games\DCS\Config\MonitorSetup\<name>.lua.bak-before-rwris the monitor setup from before the viewport was added.- To use the board for something else, flash that project's firmware to its port.
- DCS gives export scripts no RWR contacts for the Hornet, so the video route is the only way to get its RWR. (discussion)
- The exported picture has the symbols only. The rings and ticks are drawn by the board, sized from DCS's own ring radii
(set
DRAW_RINGStofalseinF18_RWR.inoif your display has physical rings over it). - Some multiplayer servers may reject modified cockpit files.
- The Hornet file patch has to be redone after every DCS update or repair.
This project is licensed under a Custom Non-Commercial License. You can use and modify it for personal and educational purposes only. For commercial use, please contact me for permission.