================================================================================================================================================================

一、WIFI connect测试(STA)
1.wpa_supplicant -d -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -iwlan0 -B

2.wpa_cli -p /data/misc/wifi/wlan0
ps:因为wpa_supplicant.conf中的ctrl_interface=/data/misc/wifi/wlan0。

3.连接AP
add_network (assume returns 2)
>set_network 2 ssid  ""
>set_network 2 psk  ""(AP有设密码)
>set_network 2 key_mgmt  NONE(AP没有无密码)
>select_network 2
>enable_network 2

4.设置IP与网关
1>动态获取IP
dhcpcd wlan0
2>静态设置IP
ifconfig wlan0 192.168.100.200
ifconfig eth0 192.168.120.56
ifconfig eth0 192.168.120.56 netmask 255.255.255.0
ifconfig eth0 192.168.120.56 netmask 255.255.255.0 broadcast 192.168.120.255
route add default gw 192.168.0.1
PS:
a>.获取IP的方式取一种测试即可
b>.常用的wpa_sullicant命令
-------------------------------------------------------------------------------------------------------------------------------------------------------
 Full command         Short command                    Description
  status                 stat            displays the current connection status
  disconnect             disc            prevents wpa_supplicant from connecting to any access point
  quit                   q               exits wpa_cli
  terminate              term            kills wpa_supplicant
  reconfigure            recon           reloads wpa_supplicant with the configuration file supplied (-c parameter)
  scan                   scan            scans for available access points (only scans it, doesn‘t display anything)
  scan_result            scan_r          displays the results of the last scan
  list_networks          list_n          displays a list of configured networks and their status (active or not, enabled or disabled)
  select_network         select_n        select a network among those defined to initiate a connection (ie select_network 0)
  enable_network         enable_n        makes a configured network available for selection (ie enable_network 0)
  disable_network        disable_n       makes a configured network unavailable for selection (ie disable_network 0)
  remove_network         remove_n        removes a network and its configuration from the list (ie remove_network 0)
  add_network            add_n           adds a new network to the list. Its id will be created automatically
  set_network            set_n           shows a very short list of available options to configure a network when supplied with no parameters.
                                         See next section for a list of extremely useful parameters to be used with set_network and get_network.
  get_network            get_n           displays the required parameter for the specified network. See next section for a list of parameters
  save_config            save_c          saves the configuration
-------------------------------------------------------------------------------------------------------------------------------------------------------

================================================================================================================================================================

二、softAP测试(链接:http://blog.sina.com.cn/s/blog_a000da9d01014m5e.html)
1.config softAP
hostapd -B /data/misc/wifi/hostapd.conf
ps:
a>.hostapd.conf配置文件得自己编写
b>.调试softAP功能前,需要先将hostapd可执行文件编译出来
c>.如果STA与AP功能的firmwire不为同一个时,在调试STA前需要重新载入wifi模块,并且指定AP firmwire的路径

2.config ip address
ifconfig wlan0 192.168.43.1  netmask 255.255.255.0
 
3.config iptables
echo 1 > /proc/sys/net/ipv4/ip_forward
cat /proc/sys/net/ipv4/ip_forward
 
4.create share net chain
iptables -A FORWARD -i eth0 -o wlan0 -m state --state ESTABLI================================================================================================================================================================

一、WIFI connect测试(STA)
1.wpa_supplicant -d -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -iwlan0 -B

2.wpa_cli -p /data/misc/wifi/wlan0
ps:因为wpa_supplicant.conf中的ctrl_interface=/data/misc/wifi/wlan0。

3.连接AP
add_network (assume returns 2)
>set_network 2 ssid  ""
>set_network 2 psk  ""(AP有设密码)
>set_network 2 key_mgmt  NONE(AP没有无密码)
>select_network 2
>enable_network 2

4.设置IP与网关
1>动态获取IP
dhcpcd wlan0
2>静态设置IP
ifconfig wlan0 192.168.100.200
ifconfig eth0 192.168.120.56
ifconfig eth0 192.168.120.56 netmask 255.255.255.0
ifconfig eth0 192.168.120.56 netmask 255.255.255.0 broadcast 192.168.120.255
route add default gw 192.168.0.1
PS:
a>.获取IP的方式取一种测试即可
b>.常用的wpa_sullicant命令
-------------------------------------------------------------------------------------------------------------------------------------------------------
 Full command         Short command                    Description
  status                 stat            displays the current connection status
  disconnect             disc            prevents wpa_supplicant from connecting to any access point
  quit                   q               exits wpa_cli
  terminate              term            kills wpa_supplicant
  reconfigure            recon           reloads wpa_supplicant with the configuration file supplied (-c parameter)
  scan                   scan            scans for available access points (only scans it, doesn‘t display anything)
  scan_result            scan_r          displays the results of the last scan
  list_networks          list_n          displays a list of configured networks and their status (active or not, enabled or disabled)
  select_network         select_n        select a network among those defined to initiate a connection (ie select_network 0)
  enable_network         enable_n        makes a configured network available for selection (ie enable_network 0)
  disable_network        disable_n       makes a configured network unavailable for selection (ie disable_network 0)
  remove_network         remove_n        removes a network and its configuration from the list (ie remove_network 0)
  add_network            add_n           adds a new network to the list. Its id will be created automatically
  set_network            set_n           shows a very short list of available options to configure a network when supplied with no parameters.
                                         See next section for a list of extremely useful parameters to be used with set_network and get_network.
  get_network            get_n           displays the required parameter for the specified network. See next section for a list of parameters
  save_config            save_c          saves the configuration
-------------------------------------------------------------------------------------------------------------------------------------------------------

================================================================================================================================================================

二、softAP测试(链接:http://blog.sina.com.cn/s/blog_a000da9d01014m5e.html)
1.config softAP
hostapd -B /data/misc/wifi/hostapd.conf
ps:
a>.hostapd.conf配置文件得自己编写
b>.调试softAP功能前,需要先将hostapd可执行文件编译出来
c>.如果STA与AP功能的firmwire不为同一个时,在调试STA前需要重新载入wifi模块,并且指定AP firmwire的路径

2.config ip address
ifconfig wlan0 192.168.43.1  netmask 255.255.255.0
 
3.config iptables
echo 1 > /proc/sys/net/ipv4/ip_forward
cat /proc/sys/net/ipv4/ip_forward
 
4.create share net chain
iptables -A FORWARD -i eth0 -o wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
 
5.config dnsmasq
dnsmasq --no-daemon --no-resolv --no-poll --dhcp-range=192.168.43.100,192.168.43.200,100h

================================================================================================================================================================

三、P2P测试
iw phy `ls /sys/class/ieee80211/` interface add p2p0 type managed

ifconfig p2p0 192.168.43.3 netmask 255.255.255.0 up

wpa_supplicant  -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf &

wpa_cli -p /data/misc/wifi/p2p0

p2p_connect 8a:e3:ab:cb:4e:a4  pbc

1.type it  p2p_connect  9a:0c:82:4d:3d:d8  pbc  on our platform

2. connect our network on mobile

3.dhcpcd p2p-p2p0-0 SHED,RELATED -j ACCEPT
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
 
5.config dnsmasq
dnsmasq --no-daemon --no-resolv --no-poll --dhcp-range=192.168.43.100,192.168.43.200,100h

================================================================================================================================================================

三、P2P测试
iw phy `ls /sys/class/ieee80211/` interface add p2p0 type managed

ifconfig p2p0 192.168.43.3 netmask 255.255.255.0 up

wpa_supplicant  -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf &

wpa_cli -p /data/misc/wifi/p2p0

p2p_connect 8a:e3:ab:cb:4e:a4  pbc

1.type it  p2p_connect  9a:0c:82:4d:3d:d8  pbc  on our platform

2. connect our network on mobile

3.dhcpcd p2p-p2p0-0

wifi debug command的更多相关文章

  1. Cisco IOS debug command reference Command A through D

    debug aaa accounting through debug auto-config debug aaa accounting : to display information on acco ...

  2. Keil debug command SAVE 命令保存文件的解析

    简介 使用 Keil debug 很方便,把内存中的一段区域 dump 出来也很方便,例如使用命令 SAVE filepath startAddr, endAddr, typeCode .但是要查看 ...

  3. Cisco IOS Debug Command Reference I through L

    debug iapp through debug ip ftp debug iapp : to begin debugging of IAPP operations(in privileged EXE ...

  4. Cisco IOS Debug Command Reference Command E through H

    debug eap through debug he-module subslot periodic debug eap : to display information about Extensib ...

  5. struts2 CVE-2012-0392 S2-008 Strict DMI does not work correctly allows remote command execution and arbitrary file overwrite

    catalog . Description . Effected Scope . Exploit Analysis . Principle Of Vulnerability . Patch Fix 1 ...

  6. How to increase TX Power Signal Strength of WiFi

    转自:https://www.blackmoreops.com/2013/10/27/how-to-increase-tx-power-signal-strength-of-wifi/ This gu ...

  7. perl debug

    1. 进入debug模式 # perl -d ./perl_debugger.pl it prompts, DB<1>   2. 查看从第10行开始的代码. 查看函数get_pattern ...

  8. STLink download/debug interface for Linux.

    http://arm-utilities.googlecode.com/svn-history/r47/trunk/stlink-download/stlink-download.c /* STLin ...

  9. Using an open debug interconnect model to simplify embedded systems design

    Using an open debug interconnect model to simplify embedded systems design Tom Cunningham, Freescale ...

随机推荐

  1. asp.net怎样解决高并发问题

    队列+多线程+couchbase缓存 ,解决高并发问题. using System; using System.Collections.Generic; using System.Linq; usin ...

  2. Android 控件架构与自定义控件详解

    架构: PhoneWindow 将一个 DecorView 设置为整个应用窗口的根 View,这里面所有 View 的监听事件,都通过 WindowManagerService 来接收.DecorVi ...

  3. vs2012搭建OpenGL环境

    1. 下载glut库 glut库地址为:http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip glut全称为:OpenGL ...

  4. Web支持可暂停的超大文件上传

    代码镇顶:https://github.com/dna2github/petalJS/blob/master/upload 前些天遇到用户须要上传10GB大小以上的文件的需求,查查网上的库.都不好用. ...

  5. IntelliJ IDEA创建文件时自动填入作者时间 定制格式

    IntelliJ IDEA创建文件时自动填入作者时间 定制格式 学习了:https://blog.csdn.net/Hi_Boy_/article/details/78205483 学习了:http: ...

  6. 微信小程序 - 非Form数据怎么发送到后端?

    通过设置异步缓存,就可以做到 wx.setStorageSync('imgs',imglist); 最后的提交信息:

  7. jmeter 压测工具

    Apache jmeter 压力测试 java 环境安装 https://www.cnblogs.com/smyhvae/p/3788534.html 下载地址和文档 http://itopic.or ...

  8. int a; int* a; int** a; int (*a)[]; int (*a)(int)

    a) int a;表示一个内存空间,这个空间用来存放一个整数(int):b) int* a;表示一个内存空间,这个空间用来存放一个指针,这个指针指向一个存放整数的空间,即a)中提到的空间:c) int ...

  9. linux 内核(系统)、函数的理解、宏的程序调试

    1.操作系统 1.1.Linux 内核(系统)的组成的部分: 内核主要有:进程调度.内存管理.虚拟文件系统.网络接口和进程通信五个部分组成. (1)进程调度 进程调度是CPU对多个进程对CPU访问的调 ...

  10. js玩转数字----取整,四舍五入,数字字符串转换

    取整: 向下取整Math.floor(),向上取整Math.ceil(),四舍五入Math.round()),保留有效数位n.toFixed(),产生大于等于0小于1的随机数Math.random() ...