w1700k-sdr README

The project's README from github.com/h0m3us3r/w1700k-sdr. As one markdown file: README.md.

W1700K SDR

Turns a Gemtek W1700K Wi-Fi 7 router into a wideband software-defined receiver. The router's MediaTek MT7996 radio captures raw 14-bit IQ at up to 320 Msps, its Airoha AN7581 SoC streams it over 10 GbE, and a Linux host shows it as a live spectrum and waterfall in the browser, with the receiver's controls next to it.

The 2.4 GHz band live: spectrum and waterfall

The whole 2.4 GHz band at 320 Msps, live, with the decimation's roll-off corrected in the stream ("flatten"): a 262,144-point FFT of every sample, 100 spectra a second (this recording runs at 50 frames a second).

The MT7996 runs only our own firmware: a ROM patch, WM and WA built from this repository, with no MediaTek code. It brings the radio up from a cold power-on by itself, from MediaTek's initialisation and calibration decoded register by register against a trace of MediaTek's own firmware, and takes its commands (LO, sample rate, capture, stream, gain, filter) from the host. See docs/architecture.md and docs/roadmap.md.

What it does

Sample rates 40, 80, 160 or 320 Msps of 14-bit complex IQ on every band, independent of the LO and the filter; on band 2 also 640/2 (every other sample of 640 Msps: flat to ±155 MHz, but signals 160–320 MHz away fold in)
Bands 2.4 GHz (MT7976), 5 GHz and 6 GHz (two MT7977s); switching bands is a register write inside a running stream
Tuning No channels: the LO is any Hz a band's synthesizer locks at (unit A: 2.081–2.748, 4.647–7.509 and 4.707–7.576 GHz), on its grid of 2.98 Hz (2.4 GHz) or 11.9–14.3 Hz steps; retuned mid-stream (about 1 ms)
Front end AGC or manual LNA/baseband gain; analog filter 20–320 MHz
Transport the radio DMAs into a 1 GiB ring in SoC DRAM; the kernel sends every 8 KiB slice as one UDP datagram, zero-copy, on the 10 GbE port; at 320 Msps half the slices are packed to 28 bits per sample pair on the radio's own cores to fit the link (lossless, automatic)
Host w1700k-stream receives the export and serves the IQ stream to every consumer on the host (shared memory, complex int16, gap-tagged), with an optional correction ("flatten") of the decimation's roll-off applied to the samples themselves; w1700k-spectrum: 262,144-point FFT at 100 frames/s over every sample, browser UI, live controls; sdr-recv records the stream

Screenshots

The web UI at 2.4 GHz

2.4 GHz at 320 Msps, flattened: Wi-Fi frames and shorter hopping bursts on a floor that stays level to the band's edges. The Stream panel shows the link carrying 9.75 Gbit/s, half of the slices packed, and every sample transformed.

The web UI at 5 GHz

Two busy 80 MHz Wi-Fi channels at 5170–5330 MHz in a flattened 320 MHz view.

The two channels' edges zoomed to 24 MHz

Zoomed to 24 MHz around 5250 MHz: the two channels' edges and the guard gap between them, in 1.22 kHz bins.

Repository

Path
platform/ What runs on the SoC: our U-Boot, Linux 6.18 with board patches, a read-only BusyBox root
kernel/w1700k_sdr/ The MT7996 driver (firmware download, the DMA ring, the 10 GbE export, the firmware's command mailbox) and its unit-side clients
firmware/ Our MT7996 firmware: the ROM patch, the WM (radio bring-up and band set-up, streams, RF control) and the WA (packer)
host/w1700k/ Host control: firmware load, streaming, RF control as firmware commands; w1700k serve for the web UI
host/stream/ w1700k-stream, the host's one receiver of the export: the IQ stream in shared memory for every consumer, and the roll-off correction
host/spectrum/ The spectrum/waterfall web server
host/recv/ sdr-recv, the stream recorder
init/ Installation from stock, updates, recovery, return to stock
include/hw/ Register reference: every known MT7996, A-die and AN7581 register, as C headers
docs/ Architecture, roadmap

Getting started

You need a W1700K (HW 1.x) or W1700K2 (HW 2.1), a 3.3 V USB serial adapter on its console header, an Ethernet cable to its lan3 port for installation, and a 10 GbE NIC on the host cabled to its wan port (10GBASE-T; an X710 with a copper SFP+ module works) for the IQ stream. Both revisions run the same images. Most units carry a W25N04KV NAND; some W1700K2s carry a W25N04LV (ID ef 8b 23), which is supported but has never been run on a unit: init/install stops on one until you pass --i-dont-care-about-nand-corruption, and asks for a raw dump of it (init/rawdump) for the maintainers.

make                                   # everything, from public sources (~10 min plus downloads)
make check                             # the test suite

sudo init/host/link up IFACE           # 192.168.1.10/24 on the NIC cabled to lan3
sudo init/host/tftp-forward enable IFACE
init/install                           # back up the NAND, install, save the radio calibration

sudo init/host/link up IFACE10G 10.77.0.10/24 9216    # the 10 GbE stream link
host/stream/build/w1700k-stream &                      # the stream, for every consumer on this host
host/spectrum/build/w1700k-spectrum --controller "host/bin/w1700k serve" --listen 0.0.0.0:8073

Then open http://HOST:8073/ and press ▶. The first start loads the radio firmware and brings the radio up (about 2 s). Without the browser, the same operations are host/bin/w1700k load|start|band|tune|gain|filter|stop|status.

Build requirements: a C/C++ compiler, make, git, Python 3.10+, the usual Buildroot prerequisites, clang, ld.lld, llvm-objcopy and llvm-readobj (RISC-V firmware), openssl (firmware container encryption), and libfftw3-dev and zlib for the stream service and the spectrum server. No vendor firmware is downloaded or needed.

Read before use

Licence

MIT, except the Linux driver and kernel patches (GPL-2.0-only), U-Boot patches (GPL-2.0+), the driver's user-space header (GPL-2.0 WITH Linux-syscall-note) and files derived from MediaTek's mt76 driver (BSD-3-Clause-Clear). See LICENSE.

w1700k-sdr (h0m3us3r/w1700k-sdr)

Searching Database…

这是什么?W1700K SDR 把 Gemtek W1700K Wi-Fi 7 路由器变成一台宽带软件定义接收机:路由器的 MediaTek MT7996 射频芯片可以以最高 320 Msps 采集原始的 14 位 IQ 数据,它的 AN7581 SoC 通过 10 GbE 把数据流传输出去,Linux 主机则在浏览器里把它显示成实时的频谱图和瀑布图。
我需要在自己电脑上安装什么,还是说这是刷进路由器的固件?两者都有:定制固件(一个 ROM 补丁加上 WM 和 WA 两个程序,不含任何 MediaTek 代码)会替换路由器原厂的射频/SoC 固件;另外还有独立的电脑端软件(w1700k-stream、w1700k-spectrum、sdr-recv)运行在 Linux 电脑上,用来接收 IQ 数据流并显示浏览器界面。
我该怎么把它跑起来?把一个 3.3V USB 串口适配器接到 W1700K 的 console 排针,一根网线接到它的 lan3 口用于安装,主机上的一块 10 GbE 网卡接到它的 wan 口,然后用 init/install 刷入;之后只要打开网页界面,按下播放按钮,就能加载并启动射频固件。
除了路由器硬件,编译机器上还需要什么?编译需要 C/C++ 编译器、make、git、Python 3.10+、Buildroot 的常见依赖,以及 RISC-V 固件所需的 clang、ld.lld、llvm-objcopy 和 llvm-readobj;固件容器需要 openssl;数据流和频谱服务程序需要 libfftw3-dev 和 zlib。
刷机安全吗?之后还能恢复吗?这套定制固件只有接收功能(发射通路保持禁用),也从不写入 MediaTek 的永久 eFuse 位;但安装它会完全替换路由器的原厂系统。init/install 会先备份 NAND,这样 init/restore 就能把设备恢复到原厂状态;另外,访问未公开文档的寄存器可能导致 SoC 卡死,直到断电重启。
为什么不直接用 MediaTek 的原厂固件?射频芯片上运行的所有代码(ROM 补丁、WM 和 WA)都是为这个项目从零编写的,没有包含任何 MediaTek 代码。射频芯片冷启动的初始化和校准过程,是通过逐个寄存器地解析 MediaTek 自家固件的抓包记录还原出来的,所以运行时不需要下载任何厂商闭源组件。
它能采集哪些采样率和频段?它可以使用 MT7976/MT7977 射频芯片,以 40、80、160 或 320 Msps 采集 14 位复数 IQ 数据,覆盖 2.4、5 和 6 GHz 频段,另外频段 2 还有一个 640/2 Msps 的特殊模式。本振可以调到该频段锁相环能锁定的任何频率,而且可以在数据流传输过程中约 1 毫秒内完成重新调谐。
如果出了问题,我还能刷回原厂固件吗?可以。init/install 会在刷机前把 NAND 里的原始数据备份到主机上,init/restore 再把这个备份写回去,设备就能恢复到原厂的 MediaTek 固件。
实时频谱显示有多快?w1700k-spectrum 以每秒 100 次的频率对每个采样做 262,144 点 FFT,数据流中已经修正了抽取滤波的滚降(即做了“平坦化”处理),并在浏览器里接收机控制项旁边实时渲染出来。
Creator
h0m3us3r
Size
20.8 MB
Stars
849
Updated
CommitOct 13
Age
8d
Commits · 90 Days