`
- 浏览:
432671 次
-
1: run wpa_supplicant first
use the following command:
wpa_supplicant -Dwext -iwlan0 -C/data/system/wpa_supplicant -c/data/misc/wifi/wpa_supplicant.conf
2: Run the command line tool wpa_cli to connect wifi
wpa_cli -p/data/system/wpa_supplicant -iwlan0
Then , it will let you set network interactively
some common command:
>scan = to scan the neighboring AP
>scan_results = show the scan results
>status = check out the current connection information
>terminate = terminate wpa_supplicant
>quit = exit wpa_cli
>add_network = it will return a network id to you
>set_network <network id> <variable> <value> = set network variables (shows list of variables when run without arguments), success will return OK, or will return Fail
>select_network <network id> = select a network (disable others)
>disable_network <network id> = disable a network
>enable_network <network id> = enable a network
> set_network 0 priority 0
> list_network
> save_config
3: example
for AP that doesn`t have encryption
>add_network (It will display a network id for you, assume it returns 0)
>set_network 0 ssid “666”
>set_network 0 key_mgmt NONE
>enable_network 0
>quit
if normal, we have connectted to the AP “666”, now you need a IP to access internet, for example:
dhcpcd wlan0
if everything is ok, it will get an IP & can access internet
for AP that has WEP
>add_network (assume returns 1)
>set_network 1 ssid “666”
>set_network 1 key_mgmt NONE
>set_network 1 wep_key0 “your ap passwork”(if usting ASCII, it need double quotation marks, if using hex, then don`t need the double quotation marks)
>set_network 1 wep_tx_keyidx 0
>select_network 1 (optional, remember, if you are connecting with another AP, you should select it to disable the another)
>enable_network 1
and then ,get an IP to access internet
for AP that has WPA-PSK/WPA2-PSK
>add_network (assume returns 2)
>set_network 2 ssid “666”
>set_network 2 psk “your pre-shared key”
>select_network 2 (optional, remember, if you are connecting with another AP, you should select it to disable the another)
>enable_network 2
there is still some others options to be set, but wpa_supplicant will choose the default for you, the default will include all we need to set and then ,get an IP to access internet
命令执行后,wpa_cli 会输出连接的过程信息。如果一切正确,则最后后输出:
<2>CTRL-EVENT-CONNECTED - Connection to xx:xx:xx:xx:xx:xx completed (reauth) [id=0 id_str=]
获取IP地址
用 quit
命令退出wpa_cli 。然后用
dhclient wlan0
命令获取IP地址。
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
wpa_cli_wrapper 是对 wpa_cli.c 代码进行封装,即把 wpa_cli 命令的相关操作集成到c代码里,并返回操作的结果。 # 编译方法 进入 wpa_cli_wrapper/wpa_supplicant-2.6/wpa_supplicant 目录,执行 make -f ...
wpa_cli 源码实现,超简单,肥肠容易的与 wpa_supplicant 交互。实现WiFi配置或状态获取等功能
wpa_cli -i wlan0 remove_network 0 wpa_cli -i wlan0 add_network wpa_cli -i wlan0 set_network 0 ssid '"dlink"' wpa_cli -i wlan0 set_network 0 key_mgmt NONE wpa_cli -i wlan0 select_network 0
wpa_cli.rar。仿照手机WIFI程序写的
君正T31 平台移植wifi 模块rtl8188 的问题及解决方法.docx 里面设置到的文档
supplicant里面的P2P函数接口说明,附带示例程序。研究80211协议的朋友可以参考学习。WIFI DIRECT技术相关资料
wpa_supplicant-0.6.9 源码,包含wpa_supplicant,wpa_cli
gem 'wpa_cli_ruby' 然后执行: $ bundle 或者自己安装: $ gem install wpa_cli_ruby 用法 require 'wpa_cli_ruby' wpa_cli = WpaCli.new # Get a list of available Wifi access points wpa_cli.scan scan_...
首先查看网卡是否开启 $ su - // 进入 root 用户模式 ...找到即将连接的 wifi 的ESSID,创建 wpa_supplicant 的连接文件并连接: $ wpa_passphrase home [wifi password] > /etc/wpa_supplicant/home.conf $
幻影pin1.75驱动文件可以用来解决幻影wifi无法正常使用的难题。不少使用幻影pin1.75升级包的用户在使用幻影wifi的时候出现了手机中缺少驱动的错误提示!对于这个问题,小编特地提供了最新版的幻影pin驱动文件,需要...
wpa_supplicant-2.1.tar.gz wpa_supplicant-2.3.tar.gz wpa_supplicant-2.5.tar.gz wpa_supplicant-2.2.tar.gz wpa_supplicant-2.4.tar.gz wpa_supplicant-2.6.tar.gz
wpa_supplicant的实现被分成几个独立的模块。核心代码功能包括控制网络选择、连接和配置。独立模块包括WPA代码(key handshake,PMKSA 缓存,pre-授权),EAPOL状态机和EAP状态机和方法。另外,还有一些具有通用帮助...
请用有道云笔记打开
wpa_supplicant,wpa_passphrase源码
无线网管理工具源码,可以交叉编译为目标平台上的工具,使用wpa_supplicant作为服务端运行,wpa_cli作为客户端去管理。
wpa_supplicant的配置文件,使wpa_supplicant生效。
./Configure linux-elf-mips -DB_ENDIAN linux:'mipsel-linux-gcc' shared --prefix=/home/blue/linux/wpa_supplicant-0.6.9/openssl-h Ok, 然后 #[root@localhost wpa_supplicant]# cp defconfig .config 修改....
linux 环境下 交叉编译wpa_suplicant wifi 配置工具的全过程,会很简单,不会其实也很难,中间依赖两个开源库 openssl 和libnl 。 在这里 ,把关键移植详细的细节记录下来,分享给大家
wpa_supplicant
自动连接创建的wifi热点类,包含加密方式WPA2_PSK和WPA_PSK ,同时解决部分android手机自动连接热点导致被切换的问题,在我的前一个demo,android 解决部分手机连接热点wifi导致被切换(链接:...添加了包含了WPA2_PSK...