Openwifi
open-source IEEE 802.11 WiFi baseband FPGA (chip) design: driver, software
Install / Use
/learn @open-sdr/OpenwifiREADME
openwifi
<img src="./openwifi-arch.jpg" width="900">openwifi: Linux mac80211 compatible full-stack IEEE802.11/Wi-Fi design based on SDR (Software Defined Radio).
- We remain committed to open source, which is our foundation. To access advanced features and dedicated support, consider a SUBSCRIPTION. More info on https://openwifi.tech
[Download img and Quick start] [known issue] [Tips for Windows users]
This repository includes Linux driver and software. openwifi-hw repository has the FPGA design. It is YOUR RESPONSIBILITY to follow your LOCAL SPECTRUM REGULATION or use CABLE to avoid potential interference over the air.
[Project document] [Application notes] [Videos] [Publications and How to Cite] [maillist]
Openwifi code has dual licenses. AGPLv3 is the opensource license. For non-opensource and advanced feature license, please fill a contact form on https://openwifi.tech. Openwifi project also leverages some 3rd party modules. It is user's duty to check and follow licenses of those modules according to the purpose/usage. You can find an example explanation from Analog Devices for this compound license conditions. [How to contribute].
Features:
- 802.11a/g/n [IEEE 802.11n (Wi-Fi 4)]
- 20MHz bandwidth; 70 MHz to 6 GHz frequency range
- Mode tested: Ad-hoc; Station; AP, Monitor
- DCF (CSMA/CA) low MAC layer in FPGA (10us SIFS is achieved)
- 802.11 packet injection and fuzzing
- CSI: Channel State Information, freq offset, equalizer to computer
- CSI fuzzer: Create artificial channel response in WiFi transmitter
- CSI radar: Moving detection. Joint radar and communication
- [IQ capture]: real-time AGC, RSSI, IQ sample to computer. [Dual antenna version]
- Configurable channel access priority parameters:
- CCA threshold, receiver sensitivity, etc
- duration of RTS/CTS, CTS-to-self
- SIFS/DIFS/xIFS/slot-time/CW/etc
- Time slicing based on MAC address (time gated/scheduled FPGA queues)
- Easy to change bandwidth and frequency:
- 2MHz for 802.11ah in sub-GHz
- 10MHz for 802.11p/vehicle in 5.9GHz
- 802.11ax and more advanced features, check: https://openwifi.tech
Performance (best case: aggregation/AMPDU on):
- iperf: TCP 40~50Mbps; UDP 50Mbps
- EVM -38dB; MCS0 sensitivity -92dBm; MCS7 -73dBm. (FMCOMMS2 2.4GHz; cable and OTA test)
Supported SDR platforms:
board_name|Description|Vivado license ----------|-----------|-------------- zc706_fmcs2|Xilinx ZC706 board + FMCOMMS2/3/4|Need zed_fmcs2|Xilinx zed board + FMCOMMS2/3/4|NO need adrv9364z7020|ADRV9364-Z7020 + ADRV1CRR-BOB|NO need adrv9361z7035|ADRV9361-Z7035 + ADRV1CRR-BOB/FMC|Need zc702_fmcs2|Xilinx ZC702 board + FMCOMMS2/3/4|NO need antsdr|MicroPhase enhanced ADALM-PLUTO Notes|NO need e310v2|MicroPhase new antsdr Notes|NO need antsdr_e200|MicroPhase enhanced ADALM-PLUTO (smaller/cheaper) Notes|NO need sdrpi|HexSDR SDR in Raspberry Pi size Notes|NO need zcu102_fmcs2|Xilinx ZCU102 board + FMCOMMS2/3/4|Need neptunesdr|Low cost Zynq 7020 + AD9361 board (Unofficial!)|NO need LibreSDR|Low cost Zynq 7020 + AD9361 board (Unofficial!)|NO need
- Check Porting guide for your new board if it isn't in the list.
- board_name is used to identify FPGA design in openwifi-hw/boards/ and FPGA image in openwifi-hw-img/boards
- Don't have any boards? Or you like JTAG boot instead of SD card? Check our test bed w-iLab.t tutorial.
[Download img and Quick start] [Basic operations] [Update FPGA] [Update Driver] [Update sdrctl] [Update Misc Helpers]
[Build openwifi Linux img from scratch] [Special note for 11b] [Porting guide] [Project document] [Application notes]
Download img and Quick start
-
Download openwifi img, unzip and burn it into a SD card (>=16GB). After this operation, the SD card should have two partitions: BOOT and rootfs. To flash the SD card, SD card tool software (such as Startup Disk Creator in Ubuntu) or dd command can be used:
sudo dd bs=512 count=31116288 if=openwifi-xyz.img of=/dev/your_sdcard_dev (To have correct count value, better to check the .img file actual situation by "fdisk -l img_filename") -
Config the correct files in the BOOT partition according to the board you have by operation on your computer:
- Copy files in BOOT/openwifi/board_name to the base directory of BOOT partition.
- Delete the rootfs/root/kernel_modules directory (if exist).
- Delete the rootfs/etc/network/interfaces.new directory (if exist).
-
Insert the SD card to the board. Configure the board in SD booting mode. Connect antennas. Power on.
-
Login to the board from your PC (PC Ethernet should have IP 192.168.10.1) with password openwifi.
ssh root@192.168.10.122 -
If not successful, check known issue
-
Then, run openwifi AP and the on board webserver
raspi-config --expand-rootfs (Only needed when your SD card > 16GB. Run and reboot) ./openwifi/setup_once.sh (Reboot the board. Only need to run once for new board) cd openwifi ./wgd.sh ./fosdem.sh (Use "./wgd.sh 1" to enable experimental AMPDU aggregation on top of 11n) (Use "./fosdem-11ag.sh" to force 11a/g mode)NOTE adrv9361z7035 has ultra low TX power in 5GHz. Move CLOSER when you use that board in 5GHz!!!
-
After you see the "openwifi" SSID on your device (Phone/Laptop/etc), connect it (If not get 192.168.13.* IP automatically, check known issue). Browser to 192.168.13.1 on your device, you should see the webpage hosted by the webserver on board.
- Note 1: If your device doesn't support 5GHz (ch44), please change the hostapd-openwifi.conf on board and re-run fosdem.sh.
- Note 2: After ~2 hours, the Viterbi decoder will halt (Xilinx Evaluation License). Just reload FPGA (method) or simply power cycle the board if it happens. (If output of "./sdrctl dev sdr0 get reg rx 20" is always the same, it means the decoder halts)
-
To give the Wi-Fi client internet access, configure routing/NAT on the PC:
sudo sysctl -w net.ipv4.ip_forward=1 sudo iptables -t nat -A POSTROUTING -o NICY -j MASQUERADE sudo ip route add 192.168.13.0/24 via 192.168.10.122 dev ethXethX is the PC NIC name connecting the board ethernet. NICY is the PC NIC name connecting internet (WiFi or another ethernet).
If you want, uncommenting "net.ipv4.ip_forward=1" in /etc/sysctl.conf to make IP forwarding persistent on PC.
-
To monitor real-time CSI (Chip State Information), such as timestamp, frequency offset, channel state, equalizer, please refer to [CSI notes].
Basic operations
The board actually is an Linux/Ubuntu computer which is running hostapd to offer Wi-Fi AP functionality over the Wi-Fi Network Interface (NIC). The NIC is implemented by openwifi-hw FPGA design. We use the term "On board" to indicate that the commands should be executed after ssh login to the board. "On PC" means the commands should run on PC.
- Bring up the openwifi NIC sdr0:
cd ~
