esp-sdr README

项目的 README,来自 github.com/ESPARGOS/esp-sdr。合并为一个 markdown 文件:README.md。

ESP-SDR firmware

ESPARGOS logo

Try it yourself: Project overview · Browser SDR viewer · Browser firmware installer

ESP-SDR turns the Wi-Fi/Bluetooth radio of an ordinary ESP32 board into a receive-only software-defined radio. The firmware captures raw I/Q samples from the chip's own receiver and sends them to your computer over USB or UART. No extra SDR hardware is needed.


ESP32 radio architecture: an undocumented debug path connects the ADC/DAC to the CPU, bypassing the fixed-function Wi-Fi modem.

The ESP32's receiver normally feeds its samples straight into the fixed-function Wi-Fi modem. With the help of LLMs, we found an undocumented debug path that lets the CPU read those samples instead. How it works explains the mechanism register by register. Parts of the firmware are AI-generated: we understand the capture mechanism well on the ESP32-C61 used in our ESPARGOS One array, but porting it to the whole ESP32 family by hand would have been too much work.

Quick start

  1. Flash the firmware from the browser installer.
  2. Open the browser viewer and connect.

For continuous streaming into Gqrx, GNU Radio and friends, use an ESP32-S31 with SoapyESPSDR, or an ESP32-S3 with esp-sdr-bridge.

Supported chips

Chip Status Native USB UART0 TX / RX Sample rates (MS/s) Notes
ESP32 ✅ — GPIO1 / GPIO3 80, 40, 16
ESP32-C2 ✅ — GPIO20 / GPIO19 80, 40, 16 26 MHz crystal; rebuild for 40 MHz
ESP32-C3 ✅ Serial/JTAG GPIO21 / GPIO20 80, 40, 16
ESP32-C5 ✅ Serial/JTAG GPIO11 / GPIO12 80 … 4 also receives 5 GHz
ESP32-C6 ✅ Serial/JTAG GPIO16 / GPIO17 80, 40, 16 continuous capture¹ (256 bins)
ESP32-C61 ✅ Serial/JTAG GPIO11 / GPIO10 80 … 4 continuous capture¹ (256 bins)
ESP32-H2 ✅ Serial/JTAG GPIO24 / GPIO23 32, 16, 10.667, 6.4 Bluetooth radio, see esp32h2.md
ESP32-H21 🚧
ESP32-H4 🚧
ESP32-P4 ❌ no radio
ESP32-S2 ✅ USB-OTG CDC GPIO43 / GPIO44 80, 40, 16 4 MB flash
ESP32-S3 ✅ Serial/JTAG GPIO43 / GPIO44 80, 40, 16 continuous capture¹ and I/Q over USB
ESP32-S31 ✅ Serial/JTAG GPIO58 / GPIO59 80 … 4 continuous capture¹; streaming firmware

✅ supported · 🚧 not yet supported · ❌ not possible

¹ Continuous capture means the chip records the signal without gaps while it computes spectra, over native USB only. It can't FFT all of it: only a small share of the signal, often a few percent or less, goes into a spectrum. The viewer shows that share as FFT coverage. This mode exists at 256 FFT bins on the C6 and C61, and at all sizes on the S3 and S31. All other spectra, including every spectrum over UART, come from separate snapshots with gaps in between; the viewer then says "Reception has gaps between snapshots".

All chips accept tuning from 100 to 6000 MHz, but the PLL only locks in a limited range around 2.4 GHz (and 5 GHz on the C5). ESP32, C2, C3, S2 and S3 reach down to about 1.85 GHz using a 5/6 LO divider, the C6 to about 1.95 GHz; see rx-controls.md.

Snapshots are bursts of up to 16,380 samples (8,190 on the C2 and 12,284 on the S2), so there are gaps between them. Gain is not calibrated in dB.

What you can do with it

Burst I/Q captures (all chips): signed 8-bit or packed 10-bit I/Q at the rates above. This is what the browser viewer uses.

On-chip spectra (all chips): the firmware computes 256–2048-bin FFTs and sends compact spectra instead of raw samples. On the C6, C61, S3 and S31 over native USB, the receiver keeps recording between FFTs (continuous capture¹), but only part of the signal is analyzed. See spectrum.md. The original S3 Turbo Mode was developed by Zoltan Doczi from Z2Labs.

Continuous I/Q on the ESP32-S3: the second core filters and decimates the 16 MS/s stream to 15.625–250 kS/s, sent gap-free over native USB. See iq-stream.md.

ESP32-S31 streaming (separate esp32s31-stream firmware, experimental): continuous 8-bit I/Q at up to 20 MS/s over high-speed USB or 40 MS/s over Gigabit Ethernet, for SoapyESPSDR. See s31-streaming.md.

Gqrx displaying an LTE signal at 2.63 GHz, continuously sampled at 40 MSa/s over Ethernet with an ESP32-S31 and SoapyESPSDR.

Talking to the firmware

The firmware speaks a simple line-based protocol over native USB or UART (2 Mbaud): INFO, FREQ 2442, CAP16 4096 0 and so on, with binary payloads protected by CRC32. The full command reference is in protocol.md.

A few practical notes:

Build and flash

firmware-targets.json lists every firmware variant and the ESP-IDF commit it is pinned to. Check out that commit, run install.sh <target> and source export.sh. Then build each chip in its own build directory:

idf.py -B build-s3 -DIDF_TARGET=esp32s3 \
  -DSDKCONFIG=build-s3/sdkconfig \
  -DSDKCONFIG_DEFAULTS=sdkconfig.defaults.esp32s3 build
idf.py -B build-s3 -p /dev/ttyACM0 flash

The S31 needs idf.py --preview. tools/build_firmware.py --profile <id> builds a release image the same way CI does. Host-side tests run with python3 -m unittest discover -s tests. On real hardware, tools/check_spectrum.py checks every spectrum profile of a connected board.

Chip-specific notes: ESP32-C2, ESP32-H2.

Source layout

Contributors

Florian Euchner
Florian Euchner
Zoltan Doczi
Zoltan Doczi
14sea
14sea

Thanks to h0m3us3r for eSpDR, whose 5/6 LO investigation informed our lower-frequency tuning.

License

ESP-SDR is licensed under the GNU General Public License, version 3 or later (GPL-3.0-or-later); see LICENSE. We chose the GPL because we want improvements to flow back to the community: if you distribute a modified version, you must make its source available under the GPL. Contributing upstream is welcome but not required.

The capture mechanism itself is not covered by copyright, only this code is. You are free to implement it independently under any license.

Third-party code keeps its own license, including the Apache-2.0 ESP-IDF code in platform/esp32s2/esp_usb_cdc_rom_console/, the ESP-DSP component, and the FFT kernels derived from it in main/targets/esp32s3/s3_fft_rnd.S and main/targets/esp32s31/burst/s31_fft_rnd.S.

esp-sdr (ESPARGOS/esp-sdr)

正在搜索数据库…

这是什么?ESP-SDR 是一套固件,它利用一条未写入文档的调试路径,直接从内置 Wi-Fi 接收器中取出原始 I/Q 采样,把 ESP32 Wi-Fi 芯片变成低占空比的软件定义无线电,让你无需任何额外的 SDR 硬件就能查看频谱、研究普通 Wi-Fi 数据包之外的信号。
这是刷进芯片的固件,还是桌面应用?它是你用 ESP-IDF 构建并刷入 ESP32 开发板的固件;另有一个配套的基于浏览器的 SDR 查看器和固件安装器在你的电脑上运行,用于配置设备和显示采集结果。
怎么构建和烧录?在 firmware-targets.json 中找到为你的芯片固定的 ESP-IDF SDK 提交,检出该 SDK,初始化其子模块,运行 install.sh 并 source export.sh,然后针对每个目标从单独的构建目录用 idf.py 构建(S31 需要 idf.py --preview)。
它实际能在哪些 ESP32 芯片上工作?支持 ESP32、C3、C5、C6、C61、S2、S3 和 S31;C2、H2、H21 和 H4 目前不受支持,P4 则永远无法工作,因为它没有集成射频单元。
采集结果有多可靠?采集存在缺口,因为标称的采样率超出了串行链路能承受的范围;增益和功率读数未经校准;在经过验证的 2400-2483.5 MHz(C5 上还有 5 GHz)频段之外调谐只是未经测试的软件尝试,无法保证 PLL 锁定。
GPL 许可证对使用它意味着什么?ESP-SDR 采用 GPL-3.0-or-later 许可:如果你分发修改后的固件,必须以 GPL 提供对应的源代码,但不要求向上游贡献;底层的采集方法本身不受版权保护,可以自由重新实现。
实际上怎么向无线电发送命令并获取采样?通过原生 USB 或 3.3V 的 USB 转 UART 适配器连接,发送以换行符结尾的 ASCII 命令,如 FREQ、BANDWIDTH、GAIN、CAP16 或 CAP20,并用 CRC32 校验每条回复的二进制 I/Q 负载。
它能调谐到什么频率范围?所有受支持的芯片都可以尝试以 1 MHz 步进在 100-6000 MHz 内调谐,但只有 2400-2483.5 MHz 的 Wi-Fi 频段(C5 上还有 5150-5895 MHz)经过硬件验证;更宽的调谐可能无法实现 PLL 锁定。
它能在设备上直接计算频谱,而不是传输原始采样吗?可以,一些芯片支持片上 FFT:有的通过原生 USB 持续输出频谱,有的则计算 256-2048 个频点的快照 FFT,以牺牲连续接收换取更大的频谱。
既然 ESP32 没有公开文档记载的 SDR 模式,这个项目为什么能存在?作者在 LLM 的帮助下发现了一条未写入文档的调试路径,可以绕过 ESP32 功能固定的 Wi-Fi 调制解调器,暴露出原始 I/Q 采样,让廉价的 Wi-Fi 芯片无需额外硬件就能充当基础的 SDR。
作者
ESPARGOS
大小
4.7 MB
星标
1.3K
更新
提交Nov 16
时长
2个月
提交 · 90 天