OMAP Wireless Connectivity NLCP WiFi Direct Configuration Scripts

2023-10-10 04:38

本文主要是介绍OMAP Wireless Connectivity NLCP WiFi Direct Configuration Scripts,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

本文转载至:http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_NLCP_WiFi_Direct_Configuration_Scripts

Glossary


WiFi direct P2P Group.png

  • A P2P Group is a Wi-Fi P2P network that may include two types of devices:
  • P2P Device –Wi-Fi CERTIFIED™ device that is compliant with the Wi-Fi P2P specification
  • Legacy device –Wi-Fi CERTIFIED™ device that is not compliant with the Wi-Fi P2P specification


  • P2P devices must be capable of two different roles in a P2P Group:
  • P2P Group Owner : An “AP-like” capability that controls a Wi-Fi P2P Group and enables P2P Device connectivity
  • P2P Client : A Wi-Fi P2P-compliant device that may connect to a P2P Group Owner
  • Legacy devices may only function as client in a P2P Group.


P2P commands

The basics commands: Discovery, connection etc.

CommandDescription
p2p_find [timeout (seconds)] [type <social \ progressive>]Enables discovery – start sending probe request frames
p2p_stop_findStops discovery, or whatever you are doing (listen mode, connection process etc.)
P2p_connect <device address> <PBC \ PIN> [GO_intent=<0-15> \ auth \ join]GO_intent – initiate connection to another device (using entered group intent)
Auth – WPS authorize incoming connection
Join – connect to an existing GO
No input – initiate connection using default GO intent
P2p_listen [timeout (seconds)]Enable listen mode
P2p_group_remove <interface>Remove device from group, return to device mode if acting as GO or autonomous GO
P2p_group_addBecome an autonomous GO


Managing discovered peers: Using the discovered peers list

CommandDescription
P2p_peers [discovered]Shows list of discovered peers (with ‘discovered’ – shows only fully discovered peers)
P2p_peer <address>Show detailed information about discovered peers
P2p_flushFlush p2p_state, and clears the discovered peer list


GO WPS authorizations:When devices try to connect to GOUT

CommandDescription
Wps_pbcpushbutton to accept incoming connections
Wps_pin <PIN> <UUID>Enable WPS enrollee PIN


Others

CommandDescription
p2p_prov_disc <address> <method>Request provision discovery
p2p_serv_disc_req <addr> <TLVs>Send service discovery request
p2p_serv_disc_cancel_req <id>Cancel service discovery request
p2p_serv_disc_resp <freq> <addr> <dialog token> <TLVs>Service discovery response
p2p_service_add <bonjour\upnp> <query\version> <response\service>Add a local service
p2p_service_del <bonjour\upnp> <query\version> [service]Remove a local service
p2p_invite <cmd> [address]Send invitation to device
ReconfigureWpa_supplicant will re-read configuration file
PingPing wpa_supplicant (only)




P2P usecases


WiFi Direct.png

The WPA Supplicant has a configuration file located under /etc/wpa_supplicant.conf.
This configuration file can be used to allow automatic connection once the WPA Supplicant process is running.
In order to connect a WPA2 secured network using the configuration file, we need the following steps:

Please note that from R8.2 release, we use two interfaces: one for STA ('wlan0') and one for WiFi Direct ('p2p0'). From R8.2 release, the configuration file will be: /etc/p2p_supplicant.conf

Detailed below are the steps required for both versions.

Steps prior to R8.2 release

1. Back up the original configuration file:

mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.bak

2. Create a new wpa_supplicant.conf with the following content:

ctrl_interface=/var/run/wpa_supplicant
update_config=1

optional for debug only, can be useful for monitoring, forces the wpa_supplicant to use only channel 1 rather than 1, 6 and 11.
for that add the following in the wpa_supplicant.conf file

p2p_listen_reg_class=81
p2p_listen_channel=1
p2p_oper_reg_class=81
p2p_oper_channel=1

In order to support 802.11n for GO, please also add the following line:

p2p_go_ht40=1

The editing above can be done by vi editor as follows:

  1. vi /etc/wpa_supplicant.conf
  2. The editor will be opened. Type the character 'i' to switch to editing mode.
  3. Copy and paste the above content into the editor.
  4. Hit 'esc' button to stop editing.
  5. Type the sequence ":wq" in order to save and quit.

3. Run the WPA Supplicant:

wpa_supplicant -d -Dnl80211 -c /etc/wpa_supplicant.conf -iwlan0 -B


4. config the WLAN IP address

ifconfig wlan0 192.168.3.3 netmask 255.255.255.0 up

Make sure that the WLAN got the proper IP address

root@am37x-evm:~# ifconfig
lo        Link encap:Local Loopbackinet addr:127.0.0.1  Mask:255.0.0.0UP LOOPBACK RUNNING  MTU:16436  Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)wlan0     Link encap:Ethernet  HWaddr 00:11:22:44:88:FFinet addr:192.168.3.3  Bcast:192.168.3.255  Mask:255.255.255.0UP BROADCAST MULTICAST  MTU:1500  Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Comment: Make sure that all the EVMS that participate in the WiFi Direct network has unique MAC Address, and that all has IP Address that is in the same Subnet.

5. Run WPA Supplicant CLI to get to the WiFi direct commands

wpa_cli


Steps from R8.2 release onwards

1. Create the p2p0 interface using the below command:

iw phy `ls /sys/class/ieee80211/` interface add p2p0 type managed

2. Ensure that /etc/p2p_supplicant.conf file exists with the below values(default)

ctrl_interface=/var/run/wpa_supplicant
update_config=0
device_name=TI-SITARA-P2P
device_type=1-0050F204-1
config_methods=virtual_push_button physical_display keypad
p2p_go_intent=0
country=US
driver_param=use_multi_chan_concurrent=1 use_p2p_group_interface=1
p2p_go_max_inactivity=60
p2p_go_ht40=1
p2p_multi_chan=1
disassoc_low_ack=1
concurrent_sched_scan=1

3. Run the wpa_supplicant:

wpa_supplicant  -iwlan0 -Dnl80211 -c/etc/wpa_supplicant.conf -N -ip2p0 -Dnl80211 -c/etc/p2p_supplicant.conf &

4. Configure the WLAN IP address

ifconfig p2p0 192.168.3.3 netmask 255.255.255.0 up

Make sure that the p2p0 interface got the proper IP address

root@am335x-evm:~# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:18:31:8E:F7:A4UP BROADCAST MULTICAST  MTU:1500  Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)Interrupt:56lo        Link encap:Local Loopbackinet addr:127.0.0.1  Mask:255.0.0.0UP LOOPBACK RUNNING  MTU:65536  Metric:1RX packets:117 errors:0 dropped:0 overruns:0 frame:0TX packets:117 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:248528 (242.7 KiB)  TX bytes:248528 (242.7 KiB)p2p0      Link encap:Ethernet  HWaddr 34:B1:F7:DF:37:5Finet addr:192.168.3.3  Bcast:192.168.3.255  Mask:255.255.255.0UP BROADCAST MULTICAST  MTU:1500  Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)wlan0     Link encap:Ethernet  HWaddr 34:B1:F7:DF:37:5EUP BROADCAST MULTICAST  MTU:1500  Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

5. Run WPA Supplicant CLI to get to the WiFi direct commands

wpa_cli -ip2p0

Connect in pbc (Push button Control)

Step #EVM #1EVM #2Comments
1p2p_findp2p_find 
2p2p_peersp2p_peersverify p2p candidates MAC ADDRESS
3p2p_connect EVM#2_MAC_ADDRESS pbc go_intent=7 go_intent=7 means that there a same chance for both EVMs to become GO
go_intent= 15 means that EVM will become GO
go_intent= 0 means that EVM will become Client
4 p2p_connect EVM#1_MAC_ADDRESS pbc 


Connect in pbc (Push button Control) where EVM #1 is defined as the group owner

Step #EVM #1EVM #2Comments
1p2p_findp2p_find 
2p2p_peersp2p_peersverify p2p candidates MAC ADDRESS
3p2p_group_add Define EVM #1 as GO
4wps_pbc  
5 p2p_connect EVM#1_MAC_ADDRESS pbc join 


Connect in Pin (PIN Number) where EVM #1 is defined as the group owner

Step #EVM #1EVM #2Comments
1p2p_findp2p_find 
2p2p_peersp2p_peersverify p2p candidates MAC ADDRESS
3p2p_group_add Define EVM #1 as GO
4wps_pin any verify the EVM#1_PIN_NUMBER, will appear on the terminal
5 p2p_connect EVM#1_MAC_ADDRESS EVM#1_PIN_NUMBER join 


Connection using PIN code

Step #EVM #1EVM #2Comments
1p2p_findp2p_find 
2p2p_peersp2p_peersverify p2p candidates MAC ADDRESS
3p2p_connect EVM#2_MAC_ADDRESS pin auth That command will print EVM#1 pin code in the follwoing line
4 p2p_connect EVM#1_MAC_ADDRESS EVM#1_PIN_CODEgetting EVM#1_PIN_CODE from previous EVM#1 command



P2P Demo usecases

Following are several WiFi Direct Demos.

Note: The below steps are based on R8.1 release. The commands will vary from R8.2 release onwards.As mentioned, R8.2 + releases uses "p2p0" interface

For R8.2+ release use the below commands to start wpa_supplicant & wpa_cli.

wpa_supplicant: wpa_supplicant -iwlan0 -Dnl80211 -c/etc/wpa_supplicant.conf -N -ip2p0 -Dnl80211 -c/etc/p2p_supplicant.conf &

wpa_cli: wpa_cli -ip2p0

Create 1:2 P2P Group - Connect in pbc (Push button Control)


WiFi Direct.png
The Flow of commands in that usecase is as follows:

Step #EVM #1EVM #2Comments
1bring up WLAN and Set static IP Addressbring up WLAN and Set static IP Address 
2run WPA Supplicant and WPA CLIrun WPA Supplicant and WPA CLIR8.2 and before

wpa_supplicant -d -Dnl80211 -c /etc/wpa_supplicant.conf -iwlan0 -B

Post R8.2

wpa_supplicant -iwlan0 -Dnl80211 -c/etc/wpa_supplicant.conf -N -ip2p0 -Dnl80211 -c/etc/p2p_supplicant.conf

3p2p_findp2p_find 
4p2p_peersp2p_peersverify p2p candidates MAC ADDRESS
5p2p_connect EVM#2_MAC_ADDRESS pbc auth go_intent=7 go_intent=7 means that there a same chance for both EVMs to become GO
go_intent= 15 means that EVM will become GO
go_intent= 0 means that EVM will become Client
6 p2p_connect EVM#1_MAC_ADDRESS pbc 
7Verify connection with Ping traffic  


EVM #1

root@am37x-evm:~# ifconfig wlan0 192.168.3.3
root@am37x-evm:~#
root@am37x-evm:~#
root@am37x-evm:~# ifconfig
lo        Link encap:Local Loopbackinet addr:127.0.0.1  Mask:255.0.0.0UP LOOPBACK RUNNING  MTU:16436  Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)wlan0     Link encap:Ethernet  HWaddr 00:11:22:44:88:FFinet addr:192.168.3.3  Bcast:192.168.3.255  Mask:255.255.255.0UP BROADCAST MULTICAST  MTU:1500  Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


wpa_cli
wpa_cli v0.8.x
Copyright (c) 2004-2011, Jouni Malinen <j@w1.fi> and contributorsThis program is free software. You can distribute it and/or modify it
under the terms of the GNU General Public License version 2.Alternatively, this software may be distributed under the terms of the
BSD license. See README and COPYING for more details.Selected interface 'wlan0'Interactive mode>
>

EVM #2


root@am37x-evm:~# ifconfig wlan0 192.168.3.4 up
root@am37x-evm:~#
root@am37x-evm:~# ifconfig
lo        Link encap:Local Loopbackinet addr:127.0.0.1  Mask:255.0.0.0UP LOOPBACK RUNNING  MTU:16436  Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)wlan0     Link encap:Ethernet  HWaddr 00:12:34:56:78:90inet addr:192.168.3.4  Bcast:192.168.3.255  Mask:255.255.255.0UP BROADCAST MULTICAST  MTU:1500  Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
root@am37x-evm:~# wpa_cli
wpa_cli v0.8.x
Copyright (c) 2004-2011, Jouni Malinen <j@w1.fi> and contributorsThis program is free software. You can distribute it and/or modify it
under the terms of the GNU General Public License version 2.Alternatively, this software may be distributed under the terms of the
BSD license. See README and COPYING for more details.Selected interface 'wlan0'Interactive mode>
>


EVM #1

> p2p_find
OK
<3>P2P-DEVICE-FOUND 00:12:34:56:78:90 p2p_dev_addr=00:12:34:56:78:90 pri_dev_type=0-00000000-0 name='' config_methods=0x188 dev_capab=0x23 group_capab=0x0

EVM #2

> p2p_find
OK
<3>P2P-DEVICE-FOUND 00:11:22:44:88:ff p2p_dev_addr=00:11:22:44:88:ff pri_dev_type=0-00000000-0 name='' config_methods=0x188 dev_capab=0x23 group_capab=0x0
> p2p_peers
00:11:22:44:88:ff

EVM #1

> p2p_peers
00:12:34:56:78:90
> p2p_connect 00:12:34:56:78:90 pbc auth go_intent=7
OK


EVM #2

> p2p_connect 00:11:22:44:88:ff  pbc
OK
<3>P2P-GO-NEG-SUCCESS
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE-PBC
<3>SME: Trying to authenticate with 00:11:22:44:88:ff (SSID='DIRECT-84' freq=2412 MHz)
[ 1444.193328] wl1271: down
[ 1444.788909] wl1271: firmware booted (Rev 6.3.1.0.79_S12)
[ 1444.830566] wlan0: authenticate with 00:11:22:44:88:ff (try 1)
[ 1444.839416] wlan0: authenticated
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE-PBC
<3>SME: Trying to authenticate with 00:11:22:44:88:ff (SSID='DIRECT-84' freq=2412 MHz)
[ 1444.918395] wlan0: deauthenticating from 00:11:22:44:88:ff by local choice (reason=2)
[ 1444.926879] wl1271: ERROR invalid hlid. dropping skb 0xceed3ec0
<3>CTRL-EVENT-DISCONNECTED bssid=00:11:22:44:88:ff reason=2
[ 1444.947692] wlan0: authenticate with 00:11:22:44:88:ff (try 1)
[ 1444.956420] wlan0: authenticated
<3>Trying to associate with 00:11:22:44:88:ff (SSID='DIRECT-84' freq=2412 MHz)
[ 1444.986816] wlan0: associate with 00:11:22:44:88:ff (try 1)
[ 1444.998138] wlan0: RX AssocResp from 00:11:22:44:88:ff (capab=0x411 status=0 aid=1)
[ 1445.006256] wlan0: associated
<4>Failed to initiate AP scan
<3>Associated with 00:11:22:44:88:ff
<3>CTRL-EVENT-EAP-STARTED EAP authentication started
<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=14122 method=1
<3>CTRL-EVENT-EAP-METHOD EAP vendor 14122 method 1 (WSC) selected
<3>WPS-CRED-RECEIVED
<3>WPS-SUCCESS
<3>P2P-GROUP-FORMATION-SUCCESS
<3>CTRL-EVENT-EAP-FAILURE EAP authentication failed
[ 1448.597106] wlan0: deauthenticating from 00:11:22:44:88:ff by local choice (reason=3)
[ 1448.641387] cfg80211: Calling CRDA to update world regulatory domain
<3>CTRL-EVENT-DISCONNECTED bssid=00:00:00:00[ 1448.688751] cfg80211: World regulatory domain updated:
[ 1448.695007] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)[ 1448.705139] cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 1448.713531] cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 1448.721862] cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 1448.730194] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 1448.738525] cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
<4>Failed to initiate AP scan
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>SME: Trying to authenticate with 00:11:22:44:88:ff (SSID='DIRECT-84' freq=2412 MHz)
[ 1449.213409] wlan0: authenticate with 00:11:22:44:88:ff (try 1)
[ 1449.221588] wlan0: authenticated
<3>Trying to associate with 00:11:22:44:88:ff (SSID='DIRECT-84' freq=2412 MHz)
[ 1449.252441] wlan0: associate with 00:11:22:44:88:ff (try 1)
[ 1449.262084] wlan0: RX ReassocResp from 00:11:22:44:88:ff (capab=0x411 status=0 aid=1)
[ 1449.270355] wlan0: associated
<3>Associated with 00:11:22:44:88:ff
<3>WPA: Key negotiation completed with 00:11:22:44:88:ff [PTK=CCMP GTK=CCMP]
<3>CTRL-EVENT-CONNECTED - Connection to 00:11:22:44:88:ff completed (auth) [id=0 id_str=]
[ 1449.338287] wl1271: Association completed.
<3>P2P-GROUP-STARTED wlan0 client ssid="DIRECT-84" freq=0 psk=00fa7decc5dab9f9f92dd0e959bc74bcd1c94d423f448ff5a0ce2b284c7a2ddc go_dev_addr=00:11:22:44:88:ff

EVM #1

<3>P2P-GO-NEG-SUCCESS
[ 1447.211730] wl1271: down
[ 1447.767883] wl1271: firmware booted (Rev 6.3.1.0.79_S11)
<3>CTRL-EVENT-CONNECTED - Connection to 00:11:22:44:88:ff completed (auth) [id=0 id_str=]
<3>CTRL-EVENT-CONNECTED - Connection to 00:00:00:00:00:00 completed (reauth) [id=0 id_str=]
<3>WPS-ENROLLEE-SEEN 00:12:34:56:78:90 e8f01f99-6eb1-5234-bf7b-31bad179f7e8 [ 1448.068054] NOHZ: local_softirq_pending 08
0-00000000-0 0x2388 4 1 [ ]
[ 1448.786254] NOHZ: local_softirq_pending 08
<3>WPS-ENROLLEE-SEEN 00:12:34:56:78:90 e8f01f99-6eb1-5234-bf7b-31bad179f7e8 [ 1448.811950] NOHZ: local_softirq_pending 08
0-00000000-0 0x2388 4 1 [ ]
<3>WPS-ENROLLEE-SEEN 00:12:34:56:78:90 e8f01f99-6eb1-5234-bf7b-31bad179f7e8 0-00000000-0 0x2388 4 1 [ ]
[ 1448.903167] NOHZ: local_softirq_pending 08
[ 1448.944885] NOHZ: local_softirq_pending 08
<3>CTRL-EVENT-EAP-STARTED 00[ 1448.954986] NOHZ: local_softirq_pending 08
:12:34:56:78:90
<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=14122 method=254
[ 1452.306701] NOHZ: local_softirq_pending 08
[ 1452.467498] NOHZ: local_softirq_pending 08
[ 1452.481903] NOHZ: local_softirq_pending 08
[ 1452.491973] NOHZ: local_softirq_pending 08
<3>WPS-REG-SUCCESS 00:12:34:56:78:90 e8f01f99-6eb1-5234-bf7b-31bad179f7e8
<3>P2P-GROUP-FORMATION-SUCCESS
<3>P2P-GROUP-STARTED wlan0 GO ssid="DIRECT-84" freq=2412 passphrase="H1heFTGz" go_dev_addr=00:11:22:44:88:ff
<3>CTRL-EVENT-EAP-FAILURE 00:12:34:56:78:90
<3>WPS-ENROLLEE-SEEN 00:12:34:56:78:90 e8f01f99-6eb1-5234-bf7b-31bad179f7e8 0-00000000-0 0x2388 0 0 [ ]
<3>AP-STA-CONNECTED 00:12:34:56:78:90
> ping 192.168.3.4
PONG

use ping command to verify connection. exit the wpa supplicant CLI by hitting "q"

>
> q

use ping command to verify connection

root@am37x-evm:~# ping 192.168.3.3
PING 192.168.3.3 (192.168.3.3): 56 data bytes
64 bytes from 192.168.3.3: seq=0 ttl=64 time=11.810 ms
64 bytes from 192.168.3.3: seq=1 ttl=64 time=2.137 ms
64 bytes from 192.168.3.3: seq=2 ttl=64 time=2.442 ms
64 bytes from 192.168.3.3: seq=3 ttl=64 time=2.227 ms
64 bytes from 192.168.3.3: seq=4 ttl=64 time=2.106 ms


Create Autonomous 1:2 P2P Group (Push button Control)

Autonomous P2P Group is a group were the Group Owners may be determined
WiFi Direct.png

The Flow of commands in that usecase is as follows:

Step #EVM #1EVM #2Comments
1Run WPA SupplicantRun WPA SupplicantR8.2 and before

wpa_supplicant -d -Dnl80211 -c /etc/wpa_supplicant.conf -iwlan0 -B

Post R8.2

wpa_supplicant -iwlan0 -Dnl80211 -c/etc/wpa_supplicant.conf -N -ip2p0 -Dnl80211 -c/etc/p2p_supplicant.conf

2wpa_cliwpa_cliRun WPA Supplicant CLI
3p2p_findp2p_find 
4p2p_peersp2p_peersverify p2p candidates MAC ADDRESS
5p2p_group_add define EVM#1 as Group Owner (GO)
6wps_pbc work in Push Button mode
7 p2p_connect EVM#1_MAC_ADDRESS pbc join 
9exit wpa_cliexit wpa_clitype: quit
10Acquire IP address for wlan0Acquire IP address for wlan0ifconfig wlan0 192.168.1.108
11Verify connection with ping  


In order to configure the IP address to the Group Owner (GO) and the Clients there are 2 methods:

  1. Static IP
  2. Enable the DHCP server at the GO EVM, which will provide IP address to the clients using DHCP session


DHCP method

at the Group Owver EVM Run the following:

  • Configure the udhcpd configuration file
  • Run the dhcp server
  • Define the iptables to enable the NAT (Network Address Translation)


Configuring udhcpd.confFirst, we will back up the existing udhcpd.conf file by invoking:

mv /etc/udhcpd.conf /etc/udhcpd.conf.bak

Create a new udhcpd.conf with the following content:

# Sample udhcpd configuration file (/etc/udhcpd.conf)
# The start and end of the IP lease block
start 		192.168.0.20	#default: 192.168.0.20
end		192.168.0.254	#default: 192.168.0.254
# The interface that udhcpd will use
interface   wlan0		#default: eth0
#Examles
opt	dns	8.8.8.8  8.8.4.4 # public google dns servers
option	subnet	255.255.255.0
opt	router	192.168.0.1
option	lease	864000		# 10 days of

The editing above can be done by vi editor as follows:

  1. vi /etc/udhcpd.conf
  2. The editor will be opened. Type the character 'i' to switch to editing mode.
  3. Copy and paste the above content into the editor.
  4. Hit 'esc' button to stop editing.
  5. Type the sequence ":wq" in order to save and quit.


Run the following

  • udhcpd to operate the dhcp server
  • iptables to enable the NAT (Network Address Translation)

The commands to do the above, are:

echo 1 > /proc/sys/net/ipv4/ip_forward
ifconfig wlan0 192.168.0.1
udhcpd /etc/udhcpd.conf
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

The IP address assigned for wlan0 interface (ifconfig wlan0 192.168.0.1) should match the "router" field IP in the udhcpd.conf file we edited above.

At Client side
to get IP address using DHCP procedure run the following:

udhcpc -i wlan0


Create 1:2 P2P Group - Connect with PIN code


WiFi Direct.png
The Flow of commands in that use case is as follows:
comment: in that case we call the commands with wpa_cli before, instead of entering the wpa_cli menu first.

Step #EVM #1EVM #2Comments
1run WPA Supplicant and WPA CLIrun WPA Supplicant and WPA CLIR8.2 and before

wpa_supplicant -d -Dnl80211 -c /etc/wpa_supplicant.conf -iwlan0 -B

Post R8.2

wpa_supplicant -iwlan0 -Dnl80211 -c/etc/wpa_supplicant.conf -N -ip2p0 -Dnl80211 -c/etc/p2p_supplicant.conf

2wpa_cli p2p_findwpa_cli p2p_finduse wpa_cli prefix to run wpa cli commands (instead of entering wpa_cli utility)
3wpa_cli p2p_peerswpa_cli p2p_peersverify p2p candidates MAC ADDRESS
4wpa_cli p2p_connect EVM#2_MAC_ADDRESS pin auth That command will print EVM#1 PIN-code in the follwoing line to that command
5 wpa_cli p2p_connect EVM#2_MAC_ADDRESS EVM#1_PIN_CODEgetting EVM#1_PIN_CODE from previous EVM#1 command
6Define IP AddressDefine IP Address 
7Verify connection using ping  

Run the WPA supplicant in both EVMs
EVM #1

R8.2 and before:
root@am37x-evm:~# wpa_supplicant -d -Dnl80211 -c /etc/wpa_supplicant.conf -iwlan0 -B
Post R8.2:
root@am37x-evm:~# wpa_supplicant  -iwlan0 -Dnl80211 -c/etc/wpa_supplicant.conf -N -ip2p0 -Dnl80211 -c/etc/p2p_supplicant.conf &


EVM #2

R8.2 and before:
root@am37x-evm:~# wpa_supplicant -d -Dnl80211 -c /etc/wpa_supplicant.conf -iwlan0 -B
Post R8.2:
root@am37x-evm:~# wpa_supplicant  -iwlan0 -Dnl80211 -c/etc/wpa_supplicant.conf -N -ip2p0 -Dnl80211 -c/etc/p2p_supplicant.conf &


EVM #1

root@am37x-evm:~# wpa_cli p2p_find
Selected interface 'wlan0'
OK

EVM #2

root@am37x-evm:~# wpa_cli p2p_find
Selected interface 'wlan0'
OK
root@am37x-evm:~# wpa_cli p2p_peers
Selected interface 'wlan0'
00:11:22:44:88:ff

EVM #1

root@am37x-evm:~# wpa_cli p2p_peers
Selected interface 'wlan0'
00:12:34:56:78:90


EVM#1 defines the EVM#2 MAC Address in the connection commands, and as a response to that command we get the EVM#1 Pin-Code (in that example it is 33503165)

root@am37x-evm:~# wpa_cli p2p_connect 00:12:34:56:78:90 pin auth
Selected interface 'wlan0'
33503165
root@am37x-evm:~#


EVM #2
EVM#2 attempt to connect EVM#1 with EVM#1 MAC Address and Pin-Code

root@am37x-evm:~# wpa_cli p2p_connect 00:11:22:44:88:ff 33503165
Selected interface 'wlan0'
OK
root@am37x-evm:~# [  442.177673] wl1271: down
[  442.765930] wl1271: firmware booted (Rev 6.3.1.0.79_S88)
[  442.822906] wlan0: authenticate with 00:11:22:44:88:ff (try 1)
[  442.833923] wlan0: authenticated
[  442.934112] wlan0: deauthenticating from 00:11:22:44:88:ff by local choice (reason=2)
[  442.942535] wl1271: ERROR invalid hlid. dropping skb 0xced5fb40
[  442.979156] wlan0: authenticate with 00:11:22:44:88:ff (try 1)
[  442.988433] wlan0: authenticated
[  443.033843] wlan0: associate with 00:11:22:44:88:ff (try 1)
[  443.045806] wlan0: RX AssocResp from 00:11:22:44:88:ff (capab=0x411 status=0 aid=1)
[  443.053924] wlan0: associated
[  443.745635] wlan0: deauthenticating from 00:11:22:44:88:ff by local choice (reason=3)
[  443.789825] cfg80211: Calling CRDA to update world regulatory domain
[  443.836059] cfg80211: World regulatory domain updated:
[  443.841552] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[  443.850341] cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[  443.858703] cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[  443.867034] cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[  443.875366] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[  443.883697] cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[  444.291687] wlan0: authenticate with 00:11:22:44:88:ff (try 1)
[  444.315979] wlan0: authenticated
[  444.346343] wlan0: associate with 00:11:22:44:88:ff (try 1)
[  444.383911] wlan0: RX ReassocResp from 00:11:22:44:88:ff (capab=0x411 status=0 aid=1)
[  444.392181] wlan0: associated
[  444.533752] wl1271: Association completed.

EVM #1

m37x-evm:~# [  446.219635] wl1271: down
[  446.775390] wl1271: firmware booted (Rev 6.3.1.0.79_S88)
ifconfig wlan0 192.168.1.108 netmask 255.255.255.0 up

EVM #2

ifconfig wlan0 192.168.1.109 netmask 255.255.255.0 up

use ping command to verify connection

root@am37x-evm:~# ping 192.168.1.108
PING 192.168.1.108 (192.168.1.108): 56 data bytes
64 bytes from 192.168.1.108: seq=0 ttl=64 time=23.925 ms
64 bytes from 192.168.1.108: seq=1 ttl=64 time=2.929 ms
64 bytes from 192.168.1.108: seq=2 ttl=64 time=3.662 ms
64 bytes from 192.168.1.108: seq=3 ttl=64 time=4.242 ms
64 bytes from 192.168.1.108: seq=4 ttl=64 time=14.587 ms


P2P Invitation Procedure - Create Autonomous 1:2 P2P Group, (Push button Control)

  1. P2P Invitation Request frame is transmitted by a P2P Group Owner or a P2P Client in that P2P Group
  2. Upon receipt of the P2P Invitation Request, a P2P Device that supports the P2P Invitation Procedure signaling mechanism transmits a P2P Invitation Response frame.
  3. The decision to accept the invitation is left to the invited P2P Device


WiFi Direct.png

The Flow of commands shows a case where the EVM#1 is the GO and invites EVM#2:

Step #EVM #1EVM #2Comments
1Run WPA SupplicantRun WPA SupplicantR8.2 and before

wpa_supplicant -d -Dnl80211 -c /etc/wpa_supplicant.conf -iwlan0 -B

Post R8.2

wpa_supplicant -iwlan0 -Dnl80211 -c/etc/wpa_supplicant.conf -N -ip2p0 -Dnl80211 -c/etc/p2p_supplicant.conf

2wpa_cliwpa_cliRun WPA Supplicant CLI
3p2p_group_add freq=2412  
4wps_pbc  
5wait after the remote "p2p_find"  
6 p2p_find 
7p2p_invite group=wlan0 peer=EVM#2_MAC_ADDRESS  
8 p2p_connect EVM#1_MAC_ADDRESS pbc auth join 
9exit wpa_cliexit wpa_clitype: quit
10Acquire IP address for wlan0Acquire IP address for wlan0ifconfig wlan0 192.168.1.108
11Verify connection with ping  


Detailed information

p2p_find

Start P2P device discovery. Optional parameter can be used to specify the duration for the discovery in seconds (e.g., "P2P_FIND 5"). If the duration is not specified, discovery will be started for indefinite time, i.e., until it is terminated by P2P_STOP_FIND or P2P_CONNECT (to start group formation with a discovered peer). The default search type is to first run a full scan of all channels and then continue scanning only social channels (1, 6, 11). This behavior can be changed by specifying a different search type: social (e.g., "P2P_FIND 5 type=social") will skip the initial full scan and only search social channels; progressive (e.g., "P2P_FINDtype=progressive") starts with a full scan and then searches progressively through all channels one channel at the time with the social channel scans. Progressive device discovery can be used to find new groups (and groups that were not found during the initial scan,e.g., due to the GO being asleep) over time without adding considerable extra delay for every Search state round.

p2p_connect

Start P2P group formation with a discovered P2P peer. This includes group owner negotiation, group interface setup, provisioning, and establishing data connection.P2P_CONNECT <peer device address> <pbc|pin|PIN#> [label|display|keypad] [persistent] [join|auth] [go_intent=<0..15>] [freq=<in MHz>]Start P2P group formation with a discovered P2P peer. This includes optional group owner negotiation, group interface setup, provisioning, and establishing data connection.The <pbc|pin|PIN#> parameter specifies the WPS provisioning method. "pbc" string starts pushbutton method, "pin" string start PIN method using an automatically generated PIN (which will be returned as the command return code), PIN# means that a pre-selected PIN can be used (e.g., 12345670). [label|display|keypad] is used with PIN method to specify which PIN is used (label=PIN from local label, display=dynamically generated random PIN from local display, keypad=PIN entered from peer device label or display).
"persistent" parameter can be used to request a persistent group to be formed.
"join" indicates that this is a command to join an existing group as a client. It skips the GO Negotiation part.
"auth" indicates that the WPS parameters are authorized for the peer device without actually starting GO Negotiation (i.e., the peer is expected to initiate GO Negotiation). This is mainly for testing purposes.The optional "go_intent" parameter can be used to override the default GO Intent value.

p2p_listen

Start Listen-only state. Optional parameter can be used to specify the duration for the Listen operation in seconds. This command may not be of that much use during normal operations and is mainly designed for testing. It can also be used to keep the device discoverable without having to maintain a group.

p2p_group_add

Set up a P2P group owner manually (i.e., without group owner negotiation with a specific peer). This is also known as autonomous GO. P2P_GROUP_ADD [persistent] [freq=<in MHz>]
Optional persistent=<network id> can be used to specify restart of a persistent group.Optional freq is channel frequency in MHz for the group.

p2p_group_remove

Terminate a P2P group. If a new virtual network interface was used for the group, it will also be removed. The network interface name of the group interface is used as a parameter for this command.
P2P_GROUP_REMOVE <ifname>
<ifname> is network interface name of the group interface or "*" to remove all.

p2p_peer

Fetch information about a discovered peer. Show information about known P2P peer(s).

P2P_PEER [addr] [FIRST] [NEXT-<P2P Device Address>]
This command takes in an argument specifying which peer to select: P2P Device Address of the peer, "FIRST" to indicate the first peer in the list, or "NEXT-<P2P Device Address>" to indicate the entry following the specified peer (to allow for iterating through the list).

p2p_invite

Invite a peer to join a group or to (re)start a persistent group.P2P_INVITE <cmd> [peer=addr]
<cmd> format is:<persistent=id> [peer=addr] to restart persistent group where id is a unique network identifier<group= > <peer=addr> [go_dev_addr=addr] to invite peer to join an active group

P2P EVENTS

Following events can be received from wpa_supplicant via control interface.The events are specified in hostap/src/common/wpa_ctrl.h

P2P_EVENT_DEVICE_FOUND

Indication of a discovered P2P device with information about that device.For example:
P2P-DEVICE-FOUND 02:b5:64:63:30:63 p2p_dev_addr=02:b5:64:63:30:63pri_dev_type=1-0050f204-1 name='Wireless Client' config_methods=0x84dev_capab=0x21 group_capab=0x0

P2P_EVENT_GO_NEG_REQUEST

A P2P device requested GO negotiation, but we were not ready to start the negotiation.For example:
P2P-GO-NEG-REQUEST 02:40:61:c2:f3:b7 dev_passwd_id=4

P2P_EVENT_GO_NEG_SUCCESS

Indication of successfully complete group owner negotiation.P2P-GO-NEG-SUCCESS

P2P_EVENT_GO_NEG_FAILURE

Indication of failed group owner negotiation. Additional parameter is status.
P2P-GO-NEG-FAILURE status=1

P2P_EVENT_GROUP_FORMATION_SUCCESS

Indication that P2P group formation has been completed successfully.
P2P-GROUP-FORMATION-SUCCESS

P2P_EVENT_GROUP_FORMATION_FAILURE

Indication that P2P group formation failed (e.g., due to provisioning failure or timeout).
P2P-GROUP-FORMATION-FAILURE

P2P_EVENT_GROUP_STARTED =

Indication of a new P2P group having been started. Additional parameters: network interface name for the group, role (GO/client), SSID, frequency. The passphrase used in the group is also indicated here if known (on GO) or PSK (on client). If the group is a persistent one, a flag indicating that is included.For example:
P2P-GROUP-STARTED wlan0-p2p-0 GO ssid="DIRECT-3F Testing" freq=2412passphrase="12345678" go_dev_addr=02:40:61:c2:f3:b7 [PERSISTENT]

P2P_EVENT_GROUP_REMOVED

Indication of a P2P group having been removed. Additional parameters: network interface name for the group, role (GO/client).For example:
P2P-GROUP-REMOVED wlan0-p2p-0 GO

P2P_EVENT_CROSS_CONNECT_ENABLE

Indication of allowing of P2P cross connection with uplink network interface. Additional parameters: network interface name for the group, cross connect uplink network interface name.For example:
P2P-CROSS-CONNECT-ENABLE wlan0-p2p-0 wan0

P2P_EVENT_CROSS_CONNECT_DISABLE

Indication of disabling of P2P cross-connection with uplink network interface. Additional parameters: network interface name for the group, cross connect uplink network interface name.For example:
P2P-CROSS-CONNECT- DISABLE wlan0-p2p-0 wan0

P2P_EVENT_PROV_DISC_SHOW_PIN

Request from the peer for local p2p device to display a PIN that will be entered on the peer. The following parameters are included after the event prefix: peer_address, PIN. The PIN is a random PIN generated for this connection. P2P_CONNECT command can be used to accept the request with the same PIN configured for the connection.For example:
P2P-PROV-DISC-SHOW-PIN 02:40:61:c2:f3:b7 12345670 p2p_dev_addr=02:40:61:c2:f3:b7 pri_dev_type=1-0050F204-1 name='Test' config_methods=0x188 dev_capab=0x21 group_capab=0x0

P2P_EVENT_PROV_DISC_ENTER_PIN

Request from the peer for local p2p device to enter a PIN displayed on the peer. The following parameter is included after the event prefix: peer address, device type, name and capabilities.For example:
P2P-PROV-DISC-ENTER-PIN 02:40:61:c2:f3:b7 p2p_dev_addr=02:40:61:c2:f3:b7pri_dev_type=1-0050F204-1 name='Test' config_methods=0x188 dev_capab=0x21 group_capab=0x0

P2P_EVENT_PROV_DISC_PBC_REQ

Request from the peer for local p2p device to connect using PBC. The following parameters are included after the event prefix: peer_address, device type, name and capabilities. P2P_CONNECT command can be used to accept the request.
For example:
P2P-PROV-DISC-PBC-REQ 02:40:61:c2:f3:b7 p2p_dev_addr=02:40:61:c2:f3:b7pri_dev_type=1-0050F204-1 name='Test' config_methods=0x188 dev_capab=0x21 group_capab=0x0

P2P_EVENT_PROV_DISC_PBC_RESP

The peer accepted our provision discovery request to connect using PBC. The following parameters are included after the event prefix: peer_address. P2P_CONNECT command can be used to start GO Negotiation after this.For example:
P2P-PROV-DISC-PBC-RESP 02:40:61:c2:f3:b7

P2P_EVENT_SERV_DISC_REQ

Indicate reception of a P2P service discovery request. The following parameters are included after the event prefix: frequency in MHz, source address, dialog token, service update indicator, Service Query TLV(s) as hexdump.For example:
P2P-SERV-DISC-REQ 2412 02:40:61:c2:f3:b7 0 0 02000001

P2P_EVENT_SERV_DISC_RESP

Indicate reception of a P2P service discovery response. The following parameters are included after the event prefix: source address, dialog token, service update indicator, Service Responce TLV(s) as hexdump.For example:
P2P-SERV-DISC-RESP 02:40:61:c2:f3:b7 0 0 0300000101

P2P_EVENT_INVITATION_RECEIVED

Indicate reception of a P2P Invitation Request. For persistent groups, the parameter after the event prefix indicates which network block includes the persistent group data.For example:
P2P-INVITATION-RECEIVED sa=02:40:61:c2:f3:b7 persistent=0

P2P_EVENT_INVITATION_RESULT

Indicate result of a P2P invitation that was requested with P2P_INVITE command. The parameter status=<value> shows the status code returned by the peer (or -1 on local failure or timeout).For example:
P2P-INVITATION-RESULT status=1 


这篇关于OMAP Wireless Connectivity NLCP WiFi Direct Configuration Scripts的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/178001

相关文章

企业安全之WiFi篇

很多的公司都没有安全团队,只有运维来负责整个公司的安全,从而安全问题也大打折扣。我最近一直在给各个公司做安全检测,就把自己的心得写下来,有什么不足之处还望补充。 0×01  无线安全 很多的公司都有不怎么注重公司的无线电安全,有钱的公司买设备,没钱的公司搞人力。但是人的技术在好,没有设备的辅助,人力在牛逼也没有个卵用。一个好的路由器、交换机、IDS就像你装备了 无尽、狂徒、杀人书一

[环境配置]ubuntu20.04安装后wifi有图标但是搜不到热点解决方法

最近刚入手一台主机,暗影精灵8plus电竞主机,安装ubuntu后wifi怎么都搜不到热点,前后重装系统6次才算解决问题。这个心酸历程只有搞技术人才明白。下面介绍我解决过程。 首先主机到手后是个windows10系统,我用无线网连接了一下,可以正常上网,说明主机有无限网卡且正常。然后我就直接开始安装Ubuntu20.04了,安装成功后发现wifi有图标但是搜不到热点,我想是不是无线网卡驱动有没有

4G模块、WIFI模块、NBIOT模块通过AT指令连接华为云物联网服务器(MQTT协议)

MQTT协议概述 MQTT(Message Queuing Telemetry Transport)是一种轻量级的消息传输协议,它被设计用来提供一对多的消息分发和应用之间的通讯,尤其适用于远程位置的设备和高延迟或低带宽的网络。MQTT协议基于客户端-服务器架构,客户端可以订阅任意数量的主题,并可以发布消息到这些主题。服务器(通常称为MQTT Broker)则负责接受来自客户端的连接请求,并转发消

龙芯小本debian无线(wifi)连接设置

本人有一台龙芯8089b小本,已被我重装了debian系统。由于学习nodeJs,所以想用它当node服务器; 正准备下载node等时发现命令模式下不能自动连接无线,于是网上找来一篇debian连接wifi的文章, 来源参考http://blog.163.com/wangpeng922@126/blog/static/64133083201211131100539/ 查看网卡信息:#

多款式随身WiFi如何挑选,USB随身WiFi、无线电池随身WiFi、充电宝随身WiFi哪个好?优缺点分析!

市面上的随身WiFi款式多样琳琅满目,最具代表性的就是USB插电款、无线款和充电宝款。今天就来用一篇文章分析一下这三种款式的优缺点。 USB插电款 优点:便宜,无需充电,在有电源的地方可以随时随地插电使用,比如中兴的USB随身WiFi。 缺点:无电源的情况下,无法带出门使用,部分品牌考虑到这个问题,会配备一个充电仓,这个充电仓相对来说就有点累赘了。网速上也不太稳定,波动比较大。

How can I load the openai api configuration through js in html?

题意:怎样在HTML中通过JavaScript加载OpenAI API配置 问题背景: I am trying to send a request through js in my html so that openai analyzes it and sends a response, but if in the js I put the following: 我正在尝试通过HTM

基于WiFi的智能照明控制系统的设计与实现(论文+源码)

1系统方案设计 本设计智能照明控制系统,结合STM32F103单片机、光照检测模块、显示模块、按键模块、太阳能板、LED灯模块、WIFI模块等器件构成整个系统,在功能上可以实现光照强度检测,并且在自动模式下可以自动调节照明亮度,在手动模式下,用户可以手动调节亮度,并且借助ESP8266 WiFi他模块,用户可以通过手机APP切换模式和调节亮度,并通过OLED液晶显示相关信息,同时加入了太阳能板给

物联网之ESP32控制舵机、通过网页设置舵机角度、Web服务、舵机原理、接线、Arduino、WiFi、Http

MENU 前言原理硬件电路设计软件程序设计LEDC输出PWM信号使用第三方库控制舵机网页控制舵机 前言 舵机在电子产品中非常常见,比如四足机器人、固定翼航模等都有应用,因此学习舵机对电子制作非常有意义。本文章使用Arguino的PWM对SG90舵机旋转角度控制。 原理 舵机是一种位置(角度)伺服的驱动器,适用于那些需要角度不断变化并可以保持的控制系统。舵机只

WIFI贴项目到底是不是“骗局”呢?由我来揭秘!

各位亲爱的朋友们,大家好!我是你们的老朋友鲸天科技千千,一直在这片互联网的热土上耕耘。相信你们对我都不会陌生,因为我常常分享一些互联网上的新奇项目和实用技巧。如果你对我的内容感兴趣,别忘了点个关注哦! 首先很多人交了几千几万的学费入局,我想说你真的被割韭菜了,这个项目本身没什么技术性,都是赚广告收益,收加盟代理费就是在割韭菜,共享经济本身互利互惠,推广员在赚的同时公司也在其中谋利。 共享WiF

华为手机找不到wifi调试?不急,没有wifi调试一样可以进行局域网模式调试

最近小黄在使用uniapp启动无线调试的时候突然发现华为的手机突然找不到wifi调试了,那么我们怎么进行无线调试呢? 其实他只是找不到开关而已,正常使用就行。 1.使用数据线连接手机。 打开cmd命令行执行:adb tcpip 5555 2.再执行adb connect ip:5555 ip为手机的真实ip 这样就可以无线调试了