mirror of
https://github.com/open-sdr/openwifi.git
synced 2024-12-23 07:22:50 +00:00
Add openwifi CSI radar app note
This commit is contained in:
parent
d692cb8dcc
commit
a4eb20013d
@ -10,6 +10,7 @@ Application notes collect many small topics about using openwifi in different sc
|
||||
- [Communication between two SDR boards under AP and client mode](ap-client-two-sdr.md)
|
||||
- [Communication between two SDR boards under ad-hoc mode](ad-hoc-two-sdr.md)
|
||||
- [From CSI (Channel State Information) to CSI (Chip State Information)](csi.md)
|
||||
- [WiFi CSI radar via self CSI capturing](radar-self-csi.md)
|
||||
- [Capture IQ sample, AGC gain, RSSI with many types of trigger condition](iq.md)
|
||||
- [Capture dual antenna TX/RX IQ for multi-purpose (capture collision)](iq_2ant.md)
|
||||
- [IEEE 802.11n (Wi-Fi 4)](ieee80211n.md)
|
||||
|
BIN
doc/app_notes/csi-screen-shot-radar-matlab.jpg
Normal file
BIN
doc/app_notes/csi-screen-shot-radar-matlab.jpg
Normal file
Binary file not shown.
After (image error) Size: 201 KiB |
BIN
doc/app_notes/csi-screen-shot-radar.jpg
Normal file
BIN
doc/app_notes/csi-screen-shot-radar.jpg
Normal file
Binary file not shown.
After (image error) Size: 145 KiB |
BIN
doc/app_notes/openwifi-radar.jpg
Normal file
BIN
doc/app_notes/openwifi-radar.jpg
Normal file
Binary file not shown.
After (image error) Size: 118 KiB |
51
doc/app_notes/radar-self-csi.md
Normal file
51
doc/app_notes/radar-self-csi.md
Normal file
@ -0,0 +1,51 @@
|
||||
<!--
|
||||
Author: Xianjun jiao
|
||||
SPDX-FileCopyrightText: 2019 UGent
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-->
|
||||
|
||||
One super power of the openwifi platform is "Full Duplex" which means that openwifi baseband can receive its own TX signal. Just like a radar! This brings a unique capability of "joint radar and communication" to openwifi. For instance, put two directional antennas to openwifi TX and RX, and the CSI (Channel State Information) of the self-TX signal will refect the change of the target.
|
||||
![](./openwifi-radar.jpg)
|
||||
|
||||
## Quick start
|
||||
- Power on the SDR board.
|
||||
- Connect a computer to the SDR board via Ethernet cable. The computer should have static IP 192.168.10.1. Open a terminal on the computer, and then in the terminal:
|
||||
```
|
||||
ssh root@192.168.10.122
|
||||
(password: openwifi)
|
||||
cd openwifi
|
||||
./fosdem.sh
|
||||
(After the AP started by above command, you can connect a WiFi client to this openwifi AP)
|
||||
(Or setup other scenario according to your requirement)
|
||||
./ifconfig
|
||||
(Write down the openwifi AP MAC address. For example 66:55:44:33:22:5a)
|
||||
insmod side_ch.ko num_eq_init=0
|
||||
./side_ch_ctl wh1h4001
|
||||
./side_ch_ctl wh7h4433225a
|
||||
(Above two commands ensure receiving CSI only from XX:XX:44:33:22:5a. In this case, it is the openwifi self-TX)
|
||||
./sdrctl dev sdr0 set reg xpu 1 1
|
||||
(Above unmute the baseband self-receiving to receive openwifi own TX signal/packet)
|
||||
./side_ch_ctl g0
|
||||
```
|
||||
You should see on board outputs like:
|
||||
```
|
||||
loop 64 side info count 4
|
||||
loop 128 side info count 5
|
||||
...
|
||||
```
|
||||
If the second number (4, 5, ...) keeps increasing, that means the CSI is going to the computer smoothly.
|
||||
|
||||
- On your computer (NOT ssh onboard!), run:
|
||||
```
|
||||
cd openwifi/user_space/side_ch_ctl_src
|
||||
python3 side_info_display.py 0
|
||||
```
|
||||
The python script needs "matplotlib.pyplot" and "numpy" packages installed. Now you should see figures showing run-time **CSI** and **frequency offset**. Meanwhile the python script prints the **timestamp**.
|
||||
![](./csi-screen-shot-radar.jpg)
|
||||
|
||||
While running, all CSI data is also stored into a file **side_info.txt**. A matlab script **test_side_info_file_display.m** is offered to help you do CSI analysis offline. In this case, run test_side_info_file_display(0) in Matlab.
|
||||
![](./csi-screen-shot-radar-matlab.jpg)
|
||||
|
||||
Please learn the python and Matlab script for CSI data structure per packet according to your requirement.
|
||||
|
||||
Do read the [normal CSI app note](csi.md) to understand the basic implementation architecture.
|
@ -74,6 +74,7 @@ UDP_PORT = 4000 #Local port to listen
|
||||
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
|
||||
sock.bind((UDP_IP, UDP_PORT))
|
||||
sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 464) # for low latency. 464 is the minimum udp length in our case (CSI only)
|
||||
|
||||
# align with side_ch_control.v and all related user space, remote files
|
||||
MAX_NUM_DMA_SYMBOL = 8192
|
||||
|
@ -53,6 +53,7 @@ UDP_PORT = 4000 #Local port to listen
|
||||
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
|
||||
sock.bind((UDP_IP, UDP_PORT))
|
||||
sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 464) # for low latency. 464 is the minimum udp length in our case (CSI only)
|
||||
|
||||
# align with side_ch_control.v and all related user space, remote files
|
||||
MAX_NUM_DMA_SYMBOL = 8192
|
||||
|
@ -112,6 +112,7 @@ UDP_PORT = 4000 #Local port to listen
|
||||
|
||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
|
||||
sock.bind((UDP_IP, UDP_PORT))
|
||||
sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 464) # for low latency. 464 is the minimum udp length in our case (CSI only)
|
||||
|
||||
# align with side_ch_control.v and all related user space, remote files
|
||||
MAX_NUM_DMA_SYMBOL = 8192
|
||||
|
@ -1,11 +1,17 @@
|
||||
% Xianjun Jiao. xianjun.jiao@imec.be; putaoshu@msn.com
|
||||
|
||||
clear all;
|
||||
function test_side_info_file_display(num_eq, side_info_filename)
|
||||
close all;
|
||||
|
||||
num_eq = 8;
|
||||
if exist('num_eq', 'var')==0 || isempty(num_eq)
|
||||
num_eq = 8;
|
||||
end
|
||||
|
||||
a = load('side_info.txt');
|
||||
if exist('side_info_filename', 'var')==0 || isempty(side_info_filename)
|
||||
side_info_filename = 'side_info.txt';
|
||||
end
|
||||
|
||||
a = load(side_info_filename);
|
||||
len_a = floor(length(a)/4)*4;
|
||||
a = a(1:len_a);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user