原文地址 http://blog.csdn.net/caichao08/article/details/53894510
感谢原文作者,特转载来收藏学习!
Installation Guide
Many people said they did not successfully get the logged CSI data. Here I summarize some common problems and provide tested solutions.
prerequisite:
Hardware:
- (1)Intel 5300 WiFi NIC card.
- (2)Intel PC with PCIe socket.
- (3)WiFi hostspots with no password
Software:
- ubuntu 14.04 with kernel version 3.13 or 3.16.
I have test the above hardware and software and successfully obtain CSI data. Some scholars said they successfully retrieved CSI on 2.6.36 ![][1] and 3.5.7 ![][2]. I didn’t verify it yet. Some people may trying to implement this CSI tool on other platform like raspberry pi. Well, I have to say this will not work. This CSI tool can only expose CSI on PCIe bus. Raspberry pi or other embedded systems that do not has PCIe bus will not run this code successfully. While boards like hammingboard or HT83, which has PCIe bus, can run this tool. Some scholars have verify it on hammngboard ![][3].
step 1: Install the modified driver
After you install the ubuntu, please “sudo update”. Then follow the instruction here. Do not run the commands in the tips.
I have extracted the neccessary steps in the following:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
step 2: Test the driver
Following the instruction here. For convenience, I have wrote a script. Run like this, “./run.sh YouWiFiName”.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
Noted that the first command “sudo /etc/init.d/networking stop” may not work on 3.13 if you have “sudo update”. It will output “Job failed …”. Ignore this output.
step 3: log the CSI data
run the following code
- 1
- 1
Problem 1: Can not connect to the AP
You can check it by running the iwconfig. Normally, you can see wlan0 in the output. But sometimes, by some uncertain reason, wlan0 is gone. This is because the wlan0 may be software blocked. Check it by running “rfkill list” and unblock the wifi by running “rfkill unblock wifi”.
Problem 2: CSI.dat is empty when ping
The cause for this one is that you driver is corrupt, you have to reinstall.
I think two clues can help you to check whether the driver is successfully installed.
- In the second step in step 1, “2. Build and Install the Modified Wireless Driver”. When you run the last command, you should see “can’t access private key”. This can indicate that the driver is successfully installed.
- After you run my “run.sh” bash scripte. Run the command “dmesg | grep -5 -i iwlwifi | grep connector_log”. Search the output to see whether there is one line that says “unknown parameter “connector_log=0x1” is ignored”. If there is no such line, then it will be ok, otherwise, the driver is corrupted. Reinstall the driver.
I have write a check script:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
##Problem 3: Could not setup monitor or inject mode
The default script to setup monitor or inject mode is not ok. If you run it on, the console may output “Device or resource busy”. I have altered the sequence of some commands and successfully get the csi data.
For the transmitter:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
For the receiver:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
Remember to install the driver for this follow the instruction here.
Some other problems are addressed here
[1]: J. Liu, Y. Wang, Y. Chen, J. Yang, X. Chen, and J. Cheng. Tracking vital signs during sleep leveraging off-the-shelf wifi. In Proceedings of the 16th ACM International Symposium on Mobile Ad Hoc Networking and Computing (MobiHoc), 2015.
[2]: S. Kumar, S. Gil, D. Katabi, and D. Rus. Accurate indoor localization with zero start-up cost. In Proceedings of the 20th Annual International Conference on Mobile Computing and Networking (MobiCom), 2014.
[3]: BodyScan: Enabling Radio-based Sensing on Wearable Devices for Contactless Activity and Vital Sign Monitoring. Mobisys 2016.