【笔记2】关于Linux 802.11n csi tool的安装注意事项

本人采用的是old installation instruction的方法,将对 中的内容逐一进行说明。

首先网站中提供的是Ubuntu 10.04 server-i386版的安装,为了使用方便,我安装Ubuntu10.04 desktop-i386版,效果一样。同时利用wubi安装的方法(百度搜索wubi安装Ubuntu,很简单),安装Ubuntu。

预备:Vim工具在desktop下没有,需要使用指令sudo apt-get install vim安装。

下面开始csitool的安装:

按照流程一步步来,需要注意的有:

1.Download, configure, compile, and install our custom Linux kernel部分

这一部分下载需要很长时间,用外网就直接是下面指令;若用校园网,则要将git://…改为https://…

git clone -b csitool-stable git://github.com/dhalperi/linux-80211n-csitool.gitgit clone git://github.com/dhalperi/linux-80211n-csitool-supplementary.git

至于V1和V2选择V1即可,make menuconfig中不用再添加选项,默认配置即可,然后直接exit

sudo mkinitramfs -o /boot/initrd.img-`cat include/config/kernel.release` \`cat include/config/kernel.release`# create ramdisk used to boot

关于这一部分,先在窗口输入cat include/config/kernel.release(注意是在linux-80211n-csitool目录下)获取版本号,一般为3.5.7-csitool+。将上述指令改为:sudo mkinitramfs -o /boot/initrd.img-3.5.7-csitool+ 3.5.7-csitool+ (注意空格)即可。后续的指令中均要将‘cat include/config/kernel.release’改为3.5.7-csitool+

Linux核定制完成后重启,在开机界面会出现新增加的Linux核,以后就从该核进入。

注意,安装完毕内核以及更换驱动程序后,默认情况下wifi禁止。此时,要打开blacklist.conf文件,将iwlwifi从黑名单里去掉。以后开机就可以连接WiFi了,但仅限于无密码的WiFi。

2.Install our custom firmware部分

sudo mv /lib/firmware/iwlwifi-5000-5.ucode /lib/firmware/iwlwifi-5000-5.ucode.orig 有笔误,将iwlwifi-5000-5全改为iwlwifi-5000-2.

3.Download and compile hostap部分

git clone git://w1.fi/srv/git/hostap-07.git 只能用外网下载(git://…)的方式,用校园网下载不了。

注意cp <hostap-dotconfig> .config中<hostap-dotconfig> 是linux-80211n-csitool-supplementary/hostap-config-files/目录下的,要不然无法识别对应的文件。(下面的同理)

4.Let’s try it out!部分

测试hostap时:

sudo iwlist scanning 是扫描ap,窗口中会出现可以扫描到的无线网络。

sudo ~/hostap-07/hostapd/hostapd ~/hostap-07/hostapd/hostapd.conf 是启动hostap,此时本机电脑作为ap(相当于路由器的功能)。此时无线网络若还处于连接状态就会出错:

所以执行该命令前必须将无线网络连接断开,此时作为路由功能开启(出现结果):

using interface wlan0 with hwaddr 00:21:6a:35:4f:00 and ssid ‘csitool-test’

wlan0:STA 38:bc:1a:0d:69:9f IEEE 802.11:authenticated

wlan0:STA 38:bc:1a:0d:69:9f IEEE 802.11:associated(aid 1)

手机可以连上‘csitool-test’的网络,状态一直是正在获取ip

采集csi数据部分(关闭本机电脑作为路由的功能,保证连无线网的功能即可,用另一台电脑开启hostapd作为ap):

sudo rmmod iwlwifi mac80211 cfg80211 # remove the modules

sudo modprobe iwlwifi connector_log=0x1 #load the modules and set userspace beamforming logging

<first,associate and set up IP to an AP that will send you HT packets> #需要用另外一台电脑作为ap并设置好IP地址,当前电脑连上那个ap

cd ~/linux-80211n-csitool-supplementary/netlink

sudo ./log_to_file tmp.dat #当前电脑相当于dp(探测点),log_to_file tmp.dat可以记录csi的值

再打开另一个终端(命令行窗口)ping <AP IP address>,,ping所连ap的ip地址,ping多次过后便会有csi数据

后续是导出csi数据,用MATLAB工具的部分。参见:

穷则思变,差则思勤!没有比人更高的山没有比脚更长的路。

【笔记2】关于Linux 802.11n csi tool的安装注意事项

相关文章:

你感兴趣的文章:

标签云: