README.md (20dd8379689721b763a38032ff23f00920a3e4a9) README.md (f4c9b0720a217c42bd8e0231262e0bfb307cb23f)
1<!--
2Author: Xianjun jiao, Michael Mehari, Wei Liu
3SPDX-FileCopyrightText: 2019 UGent
4SPDX-License-Identifier: AGPL-3.0-or-later
5-->
6
7# openwifi
8<img src="./openwifi-arch.jpg" width="900">
9
10**openwifi:** Linux mac80211 compatible full-stack IEEE802.11/Wi-Fi design based on SDR (Software Defined Radio).
11
1<!--
2Author: Xianjun jiao, Michael Mehari, Wei Liu
3SPDX-FileCopyrightText: 2019 UGent
4SPDX-License-Identifier: AGPL-3.0-or-later
5-->
6
7# openwifi
8<img src="./openwifi-arch.jpg" width="900">
9
10**openwifi:** Linux mac80211 compatible full-stack IEEE802.11/Wi-Fi design based on SDR (Software Defined Radio).
11
12This repository includes Linux driver and software. [openwifi-hw](https://github.com/open-sdr/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.
12This 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.
13
14[[Quick start](#Quick-start)]
15[[Project document](doc/README.md)]
16[[Application notes](doc/app_notes/README.md)]
17[[Videos](doc/videos.md)]
18[[Publications and How to Cite](doc/publications.md)]
19[[maillist](https://lists.ugent.be/wws/subscribe/openwifi)]
20

--- 57 unchanged lines hidden (view full) ---

78 - Copy **openwifi/zynqmp-common/Image** (zcu102 board) or **openwifi/zynq-common/uImage** (other boards) to the base directory of BOOT partition
79- Connect two antennas to RXA/TXA ports. Config the board to SD card boot mode (check the board manual). Insert the SD card to the board. Power on.
80- Login to the board from your PC (PC Ethernet should have IP 192.168.10.1) with password **openwifi**.
81 ```
82 ssh [email protected]
83 ```
84- On board, run openwifi AP and the on board webserver
85 ```
13
14[[Quick start](#Quick-start)]
15[[Project document](doc/README.md)]
16[[Application notes](doc/app_notes/README.md)]
17[[Videos](doc/videos.md)]
18[[Publications and How to Cite](doc/publications.md)]
19[[maillist](https://lists.ugent.be/wws/subscribe/openwifi)]
20

--- 57 unchanged lines hidden (view full) ---

78 - Copy **openwifi/zynqmp-common/Image** (zcu102 board) or **openwifi/zynq-common/uImage** (other boards) to the base directory of BOOT partition
79- Connect two antennas to RXA/TXA ports. Config the board to SD card boot mode (check the board manual). Insert the SD card to the board. Power on.
80- Login to the board from your PC (PC Ethernet should have IP 192.168.10.1) with password **openwifi**.
81 ```
82 ssh [email protected]
83 ```
84- On board, run openwifi AP and the on board webserver
85 ```
86 ~/openwifi/fosdem-11ag.sh
86 ~/openwifi/fosdem.sh
87 (Use "./fosdem.sh 1" to enable experimental AMPDU aggregation on top of 11n)
88 (Use "./fosdem-11ag.sh" to force 11a/g mode)
87 ```
88 **NOTE** adrv9361z7035 has ultra low TX power in 5GHz. Move **CLOSER** when you use that board in 5GHz!!!
89- After you see the "openwifi" SSID on your device (Phone/Laptop/etc), connect it. Browser to 192.168.13.1 on your device, you should see the webpage hosted by the webserver on board.
90 - Note 1: If your device doesn't support 5GHz (ch44), please change the **hostapd-openwifi.conf** on board and re-run fosdem.sh.
91 - Note 2: After ~2 hours, the Viterbi decoder will halt (Xilinx Evaluation License). Just 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)
92- To give the Wi-Fi client internet access, configure routing/NAT **on the PC**:
93 ```
94 sudo sysctl -w net.ipv4.ip_forward=1

--- 4 unchanged lines hidden (view full) ---

99
100 If you want, uncommenting "net.ipv4.ip_forward=1" in /etc/sysctl.conf to make IP forwarding persistent on PC.
101- To monitor **real-time CSI (Chip State Information)**, such as timestamp, frequency offset, channel state, equalizer, please refer to [[CSI notes](doc/app_notes/csi.md)].
102
103## Basic operations
104The 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.
105- Bring up the openwifi NIC sdr0:
106 ```
89 ```
90 **NOTE** adrv9361z7035 has ultra low TX power in 5GHz. Move **CLOSER** when you use that board in 5GHz!!!
91- After you see the "openwifi" SSID on your device (Phone/Laptop/etc), connect it. Browser to 192.168.13.1 on your device, you should see the webpage hosted by the webserver on board.
92 - Note 1: If your device doesn't support 5GHz (ch44), please change the **hostapd-openwifi.conf** on board and re-run fosdem.sh.
93 - Note 2: After ~2 hours, the Viterbi decoder will halt (Xilinx Evaluation License). Just 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)
94- To give the Wi-Fi client internet access, configure routing/NAT **on the PC**:
95 ```
96 sudo sysctl -w net.ipv4.ip_forward=1

--- 4 unchanged lines hidden (view full) ---

101
102 If you want, uncommenting "net.ipv4.ip_forward=1" in /etc/sysctl.conf to make IP forwarding persistent on PC.
103- To monitor **real-time CSI (Chip State Information)**, such as timestamp, frequency offset, channel state, equalizer, please refer to [[CSI notes](doc/app_notes/csi.md)].
104
105## Basic operations
106The 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.
107- Bring up the openwifi NIC sdr0:
108 ```
107 service network-manager stop
108 cd ~/openwifi && ./wgd.sh
109 cd ~/openwifi && ./wgd.sh
110 (Use "./wgd.sh 1" to enable experimental AMPDU aggregation)
109 ```
110- Use openwifi as client to connect other AP (Change wpa-connect.conf on board firstly):
111 ```
112 route del default gw 192.168.10.1
113 wpa_supplicant -i sdr0 -c wpa-connect.conf &
114 dhclient sdr0
115 ```
116- Use openwifi in ad-hoc mode: Please check **sdr-ad-hoc-up.sh** and **sdr-ad-hoc-join.sh**.

--- 24 unchanged lines hidden (view full) ---

141 cd openwifi/user_space; ./boot_bin_gen_zynqmp.sh $OPENWIFI_HW_DIR $XILINX_DIR $BOARD_NAME
142
143 cd openwifi/kernel_boot/boards/$BOARD_NAME/output_boot_bin; scp ./BOOT.BIN [email protected]:
144 ```
145- On board: Put the BOOT.BIN into the BOOT partition.
146 ```
147 mount /dev/mmcblk0p1 /mnt
148 cp ~/BOOT.BIN /mnt
111 ```
112- Use openwifi as client to connect other AP (Change wpa-connect.conf on board firstly):
113 ```
114 route del default gw 192.168.10.1
115 wpa_supplicant -i sdr0 -c wpa-connect.conf &
116 dhclient sdr0
117 ```
118- Use openwifi in ad-hoc mode: Please check **sdr-ad-hoc-up.sh** and **sdr-ad-hoc-join.sh**.

--- 24 unchanged lines hidden (view full) ---

143 cd openwifi/user_space; ./boot_bin_gen_zynqmp.sh $OPENWIFI_HW_DIR $XILINX_DIR $BOARD_NAME
144
145 cd openwifi/kernel_boot/boards/$BOARD_NAME/output_boot_bin; scp ./BOOT.BIN [email protected]:
146 ```
147- On board: Put the BOOT.BIN into the BOOT partition.
148 ```
149 mount /dev/mmcblk0p1 /mnt
150 cp ~/BOOT.BIN /mnt
151 cd /mnt
152 sync
153 cd ~
149 umount /mnt
150 ```
151 **Power cycle** the board to load new FPGA bitstream.
152
153## Update Driver
154
155Since the pre-built SD card image might not have the latest bug-fixes/updates, it is recommended to update the driver on board.
156- Prepare Analog Devices Linux kernel source code (only need to run once):

--- 34 unchanged lines hidden (view full) ---

191 ./wgd.sh remote
192 (Above command downloads driver files, and brings up sdr0)
193 ```
194- Access the board disk/rootfs like a disk:
195 - On PC: "File manager --> Connect to Server...", input: sftp://[email protected]/root
196 - Input password "openwifi"
197
198## Build openwifi Linux img from scratch
154 umount /mnt
155 ```
156 **Power cycle** the board to load new FPGA bitstream.
157
158## Update Driver
159
160Since the pre-built SD card image might not have the latest bug-fixes/updates, it is recommended to update the driver on board.
161- Prepare Analog Devices Linux kernel source code (only need to run once):

--- 34 unchanged lines hidden (view full) ---

196 ./wgd.sh remote
197 (Above command downloads driver files, and brings up sdr0)
198 ```
199- Access the board disk/rootfs like a disk:
200 - On PC: "File manager --> Connect to Server...", input: sftp://[email protected]/root
201 - Input password "openwifi"
202
203## Build openwifi Linux img from scratch
199- Download [2019_R1-2020_02_04.img.xz](https://swdownloads.analog.com/cse/2019_R1-2020_02_04.img.xz) from [Analog Devices Wiki](https://wiki.analog.com/resources/tools-software/linux-software/zynq_images). Burn it to a SD card.
204- Install the devicetree compiler -- dtc. (For Ubuntu: sudo apt install device-tree-compiler)
205- Install the mkimage tool. (For Ubuntu: sudo apt install u-boot-tools)
206- Download [2019_R1-2020_06_22.img.xz](http://swdownloads.analog.com/cse/2019_R1-2020_06_22.img.xz) from [Analog Devices Wiki](https://wiki.analog.com/resources/tools-software/linux-software/zynq_images). Burn it to a SD card.
200- Insert the SD card to your Linux PC. Find out the mount point (that has two sub directories BOOT and rootfs), and setup environment variables (use absolute path):
201 ```
202 export SDCARD_DIR=sdcard_mount_point
203 export XILINX_DIR=your_Xilinx_install_directory
204 export OPENWIFI_HW_DIR=your_openwifi-hw_directory
205 export BOARD_NAME=your_board_name
206 ```
207- Run script to update SD card:

--- 49 unchanged lines hidden ---
207- Insert the SD card to your Linux PC. Find out the mount point (that has two sub directories BOOT and rootfs), and setup environment variables (use absolute path):
208 ```
209 export SDCARD_DIR=sdcard_mount_point
210 export XILINX_DIR=your_Xilinx_install_directory
211 export OPENWIFI_HW_DIR=your_openwifi-hw_directory
212 export BOARD_NAME=your_board_name
213 ```
214- Run script to update SD card:

--- 49 unchanged lines hidden ---