/***********************************************************************
* I.MX6 wpa_cli 使用
* 说明:
* 在调试Android wifi功能之前,先要保证wpa_supplicant调试是正常才行,
* 否者都很难确定到底那一层的软件出了问题。
*
* 2016-6-28 深圳 南山平山村 曾剑锋
**********************************************************************/ 一、参考文档:
. 用wpa_cli 连接无线网络
http://blog.163.com/qk_zhu/blog/static/195076154201132081536347/
. wpa_cli 连接 wifi
http://www.cnblogs.com/lidabo/p/4660206.html 二、shell command:
. wpa_supplicant -iwlan0 -Dnl80211 -c/etc/wifi/wpa_supplicant.conf &
. wpa_cli -i wlan0 -p /data/misc/wifi/sockets 三、wpa_cli command:
. scan
. scan_results
. add_network
. set_network ssid "androidap"
. set_network key_mgmt NONE
. select_network
. enable_network 四、示例:
root@android:/ # wpa_cli -i wlan0 -p /data/misc/wifi/sockets
wpa_cli v2.-devel-4.2.2_rtw_r8680.
Copyright (c) -, Jouni Malinen <j@w1.fi> and contributors This software may be distributed under the terms of the BSD license.
See README for more details. Interactive mode > scan
OK
<>CTRL-EVENT-STATE-CHANGE id=- state= BSSID=::::: SSID=
<>CTRL-EVENT-SCAN-RESULTS
<>WPS-AP-AVAILABLE
<>CTRL-EVENT-STATE-CHANGE id=- state= BSSID=::::: SSID=
> scan_results
bssid / frequency / signal level / flags / ssid
ec::ca:e1:6b: - [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] Aplex-AP
:b0:c6:0f::b0 - [WPA2-PSK-CCMP][ESS] Aplex-AP3
8c:be:be:::d2 - [WPA2-PSK-CCMP][ESS] Aplex_C
d0:fa:1d:::7b - [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] SZSD
:b0:c6:4f:: - [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] DXYP-
:fb:b2::bb: - [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] TP-LINK-
c0:::fc::a1 - [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] ZLY-TECH
::::e8:e1 - [WPA-PSK-TKIP+CCMP][WPA2-PSK-TKIP+CCMP][ESS]SZSD
:::ce:: - [WPA2-PSK-CCMP][WPS][ESS] sjb
f0:b4:::1d:f1 - [WPA2-PSK-CCMP][ESS] Xiaomi_888
a0:f3:c1::: - [WPA2-PSK-TKIP+CCMP][ESS] TP-LINK_952236
b0:d5:9d::: - [WPA2-PSK-CCMP][ESS] huo
f8:e9::b7::8a - [WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS] laser309
::::8b: - [WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] \xe5\x85\x8d\xe8\xb4\xb9WiFi-
ec::ca::d1:f6 - [ESS] TP-LINK_D1F6
::::7d: - [ESS] androidap
> add_network > set_network ssid "androidap"
OK
> set_network key_mgmt NONE
OK
> select_network
OK
<>CTRL-EVENT-STATE-CHANGE id= state= BSSID=::::: SSID=androidap
> RTL871X: rtw_set_802_11_connect(wlan0) fw_state=0x00000008
<>CTRL-EVENT-SCAN-RESULTS
<>WPS-AP-AVAILABLE
<>Trying to associate with ::::7d: (SSID='androidap' freq= MHz)
<>CTRL-EVENT-STATE-CHANGE id= state= BSSID=::::: SSID=androidap
> RTL871X: start auth
RTL871X: auth success, start assoc
RTL871X: assoc success
<>CTRL-EVENT-STATE-CHANGE idADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
= state= BSSID=::::: SSID=androidap
<>Associated with ::::7d:
<>CTRL-EVENT-CONNECTED - Connection to ::::7d: completed (auth) [id= id_str=]
<>CTRL-EVENT-STATE-CHANGE id= state= BSSID=::::7d: SSID=androidap
> enable_entwork
Unknown command 'enable_entwork'
> enable_entworwlan0: no IPv6 routers present
> enable_network
OK
> q
root@android:/ # dhcpcd wlan0
dhcpcd[]: version 5.5. starting
dhcpcd[]: wlan0: rebinding lease of 192.168.43.34
dhcpcd[]: wlan0: acknowledged 192.168.43.34 from 192.168.43.1
dhcpcd[]: wlan0: checking for 192.168.43.34
dhcpcd[]: wlan0: leased 192.168.43.34 for seconds
dhcpcd[]: forked to background, child pid
root@android:/ # ping 14.215.177.37
PING 14.215.177.37 (14.215.177.37) () bytes of data.
bytes from 14.215.177.37: icmp_seq= ttl= time= ms
bytes from 14.215.177.37: icmp_seq= ttl= time=47.8 ms
bytes from 14.215.177.37: icmp_seq= ttl= time=91.4 ms
bytes from 14.215.177.37: icmp_seq= ttl= time=63.5 ms
^C
--- 14.215.177.37 ping statistics ---
packets transmitted, received, % packet loss, time 4007ms
rtt min/avg/max/mdev = 47.865/106.898/224.694/69.780 ms
root@android:/ #

I.MX6 wpa_cli 使用的更多相关文章

  1. I.MX6 AW-NB177NF wifi HAL 调试修改

    /************************************************************************* * I.MX6 AW-NB177NF wifi H ...

  2. 【转】wpa_supplicant与wpa_cli之间通信过程

    [转]wpa_supplicant与wpa_cli之间通信过程 转自:http://blog.chinaunix.net/uid-26585427-id-4051479.html wpa_suppli ...

  3. I.MX6 initramfs.cpio.gz.uboot unpack

    /********************************************************************************* * I.MX6 initramfs ...

  4. I.MX6 eMMC 添加分区

    /********************************************************************************* * I.MX6 eMMC 添加分区 ...

  5. I.MX6 WIFI wireless_tools 移植

    /******************************************************************************** * I.MX6 WIFI wirel ...

  6. I.MX6 KEY_ROW4 can't as GPIO pin

    /********************************************************************** * I.MX6 KEY_ROW4 can't as GP ...

  7. I.MX6 console 跳过 login

    /*************************************************************************** * I.MX6 console 跳过 logi ...

  8. I.MX6 Android 5.1 快速合成系统

    /**************************************************************************** * I.MX6 Android 5.1 快速 ...

  9. I.MX6 ubuntu-core-14.04 Apache php mysql Qt5

    /*************************************************************************** * I.MX6 ubuntu-core-14. ...

随机推荐

  1. XV6陷入,中断和驱动程序

    陷入,中断和驱动程序 运行进程时,cpu 一直处于一个大循环中:取指,更新 PC,执行,取指…….但有些情况下用户程序需要进入内核,而不是执行下一条用户指令.这些情况包括设备信号的发出.用户程序的非法 ...

  2. HDU 3264 区间内的最大最小之差

    题目链接:http://poj.org/problem?id=3264 题目大意:在给定一堆牛的数量以及其高度的时候,每次给定一段区间,求这个区间内最高的牛和最矮的牛的高度之差为多少. 可以直接利用R ...

  3. 【带权并查集】HDU 3047 Zjnu Stadium

    http://acm.hdu.edu.cn/showproblem.php?pid=3047 [题意] http://blog.csdn.net/hj1107402232/article/detail ...

  4. 【2018 Multi-University Training Contest 1】

    01:https://www.cnblogs.com/myx12345/p/9362221.html 02:https://www.cnblogs.com/myx12345/p/9382267.htm ...

  5. 转 蓝桥杯 历届试题 波动数列 [ dp ]

    传送门   历届试题 波动数列   时间限制:1.0s   内存限制:256.0MB     锦囊1   锦囊2   锦囊3   问题描述 观察这个数列: 1 3 0 2 -1 1 -2 ... 这个 ...

  6. poj1470 Closest Common Ancestors [ 离线LCA tarjan ]

    传送门 Closest Common Ancestors Time Limit: 2000MS   Memory Limit: 10000K Total Submissions: 14915   Ac ...

  7. xhprof安装&&使用[转载]

    编译安装 wget http://pecl.php.net/get/xhprof-0.9.2.tgz tar zxf xhprof-0.9.2.tgz cd xhprof-0.9.2/extensio ...

  8. php 翻转字符串

    //方法一 function strrev_charset($string,$charset='utf-8'){ if(!is_string($string) || !mb_check_encodin ...

  9. hdu 1496 hash

    hash?判重,是否一样?相等?等式!没有想到,这次题做玩后,学到了HASH这一功能!当数据量在数组允许大小范围内时候即可!判断等式俩边是否相等,从而获得解的个数!从复杂度,n*m*k****,降到 ...

  10. 如何判断一个app是原生app还是 webapp,或者是混合app

    1.(快速)滚动起来是否比较卡2.图片加载失败的图标 断网检查不是绝对的,web app并不一定是在远程服务器上的, 也能pack在程序里,load本地的资源也能算是web app.     web ...