A simple implementation of CSI-based collaborative sensing with two receivers. Several useful CSI data collection configuration shell scripts are also included in this repo. To collect CSI data from two devices simultaneously, you can install iTerm2 terminal emulator and use shift+cmd+i (Mac command) to allow broadcast input to all panes in all tabs.
File | Function | Device for Executing |
---|---|---|
generate_traffic.sh | Generate Ping Flow | PC/Laptop/Edge device |
csiparam_config.sh | Configure CSI Collection Parameters | CSI receiver (e.g. Pi 4B) |
csi_forward.sh | Setup CSI data forwarding rule | CSI receiver (e.g. Pi 4B) |
packetcap_pc.sh | CSI Data Collection | PC/Laptop/Edge device |
infer_model.py | Online Test | PC/Laptop/Edge device |
613_end_mos4.pth | Pretrained model pth for receiver A | PC/Laptop/Edge device |
613_head_mos4.pth | Pretrained model pth for receiver B | PC/Laptop/Edge device |
Run generate_traffic.sh to generate ping flow from router
example - generate ping flow with 1000 Hz:
. generate_traffic.sh 1000 192.168.0.1
Run csiparam_config.sh to configure CSI data collecion parameters
example - collect CSI data derived from Wi-Fi signal in 36 channel with 80 MHz bandwidth and generated by a router with MAC address aa:bb:cc:dd:ee:ff:
. csiparam_config.sh 36 80 aa:bb:cc:dd:ee:ff
Run csi_forward.sh to setup CSI data forwarding rule
example - forward CSI data from device with IP address 192.168.3.11 to device with IP address 192.168.3.12:
sudo bash csi_forward.sh 192.168.3.11 192.168.3.12
Run packetcap_pc.sh to collect CSI data from a certain device and save them into a certain folder
example - collect CSI data under 0-1 people scenarios from a device with IP address 192.168.3.11 and save them into folder name "test". Each scenario will collect 500 pcap files with each of them include 1000 packets:
. packetcap_pc.sh test 0 1 1 500 1000 192.168.3.11
Run infer_model.py to start online test using pre-trained model. Pytorch environment is needed. Note that you need to modify IP_ADDRESS and ACCESS_TOKEN parameters to your own. You may also customize NUM_FILES, and PASSENGER parameters to fit your own setting.
python infer_model.py