博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
802.11 tool release installation guide
阅读量:4145 次
发布时间:2019-05-25

本文共 7745 字,大约阅读时间需要 25 分钟。

原文地址 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 . Do not run the commands in the tips. 
I have extracted the neccessary steps in the following:

1.  Prerequisitessudo apt-get install gcc make linux-headers-$(uname -r) git-core2. Build and Install the Modified Wireless DriverCSITOOL_KERNEL_TAG=csitool-$(uname -r | cut -d . -f 1-2)git clone https://github.com/dhalperi/linux-80211n-csitool.gitcd linux-80211n-csitoolgit checkout ${CSITOOL_KERNEL_TAG}make -C /lib/modules/$(uname -r)/build M=$(pwd)/drivers/net/wireless/iwlwifi modulessudo make -C /lib/modules/$(uname -r)/build M=$(pwd)/drivers/net/wireless/iwlwifi INSTALL_MOD_DIR=updates modules_installsudo depmodcd ..3. Install the Modified Firmwaregit clone https://github.com/dhalperi/linux-80211n-csitool-supplementary.gitfor file in /lib/firmware/iwlwifi-5000-*.ucode; do sudo mv $file $file.orig; donesudo cp linux-80211n-csitool-supplementary/firmware/iwlwifi-5000-2.ucode.sigcomm2010 /lib/firmware/sudo ln -s iwlwifi-5000-2.ucode.sigcomm2010 /lib/firmware/iwlwifi-5000-2.ucode4. Build the Userspace Logging Toolmake -C linux-80211n-csitool-supplementary/netlink 
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 . For convenience, I have wrote a script. Run like this, “./run.sh YouWiFiName”.

#!/bin/bashsudo /etc/init.d/networking stopecho "stop networking"sleep 1sudo modprobe -r iwlwifi mac80211sleep 1sudo modprobe iwlwifi connector_log=0x1sleep 1echo "set hotspot essid $1"sudo iwconfig wlan0 essid $1sleep 1echo "connecting to the wifi, please wait"sudo dhclient wlan0echo "successfully connected to the wifi hotspot" 
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

./log_to_file csi.dat 
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:

#!/usr/bin/sudo /bin/bashb=`iwconfig | grep -i wlan0 | wc -l`echo "$b"if [ $b == '1' ]then    echo "wifi is opened"elif [ $b == '0' ]then    echo "wifi is soft blocked"    exit 0fisleep 1b=`iwconfig | grep -i Not-Associated | wc -l`echo "$b"if [ $b == '1' ]then    echo "You have not connected to the wifi ap"    exit 0elif [ $b == '0' ]then    echo "You have connected to the wifi AP"fisleep 1a=`dmesg | grep -5 -i iwlwifi | grep connector_log | wc -l`if [ a == '1' ]then     echo "driver is not OK!!! please reinstall"else    echo "driver is OK! Congratuation."fi 
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:

#!/usr/bin/sudo /bin/bashecho "start configure---------------------"modprobe -r iwlwifi mac80211 cfg80211modprobe iwlwifi debug=0x40000sleep 1ifconfig wlan0 2>/dev/null 1>/dev/nullwhile [ $? -ne 0 ]do            ifconfig wlan0 2>/dev/null 1>/dev/nulldoneecho "setting injection mode ok"sleep 1iw dev wlan0 interface add mon0 type monitorifconfig mon0 upecho "setting injection mon0"sleep 1iw mon0 set channel $1 $2echo "configuration is over-------------------------" 
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:

#!/usr/bin/sudo /bin/bashsleep 1modprobe -r iwlwifi mac80211 cfg80211modprobe iwlwifi connector_log=0x1echo "step 1---------------"# Setup monitor mode, loop until it worksiwconfig wlan0 mode monitor 2>/dev/null 1>/dev/nullwhile [ $? -ne 0 ]do    iwconfig wlan0 mode monitor 2>/dev/null 1>/dev/nulldonesleep 1echo "monitor mode successfully set"ifconfig wlan0 upsleep 1echo "open wlan0"iw wlan0 set channel $1 $2sleep 1echo "setting wlan channel parameters"echo "successfully--------------------------" 
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 .

Some other problems are addressed 

[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.

你可能感兴趣的文章
《融入动画技术的交互应用》主题博文推荐
查看>>
链睿和家乐福合作推出下一代零售业隐私保护技术
查看>>
Unifrax宣布新建SiFAB™生产线
查看>>
艾默生纪念谷轮™在空调和制冷领域的百年创新成就
查看>>
NEXO代币持有者获得20,428,359.89美元股息
查看>>
Piper Sandler为EverArc收购Perimeter Solutions提供咨询服务
查看>>
RMRK筹集600万美元,用于在Polkadot上建立先进的NFT系统标准
查看>>
JavaSE_day14 集合中的Map集合_键值映射关系
查看>>
异常 Java学习Day_15
查看>>
Mysql初始化的命令
查看>>
MySQL关键字的些许问题
查看>>
浅谈HTML
查看>>
css基础
查看>>
Servlet进阶和JSP基础
查看>>
servlet中的cookie和session
查看>>
过滤器及JSP九大隐式对象
查看>>
软件(项目)的分层
查看>>
菜单树
查看>>
【Python】学习笔记——-6.2、使用第三方模块
查看>>
【Python】学习笔记——-7.0、面向对象编程
查看>>