SWRU576 January   2021 WL1801MOD , WL1805MOD , WL1807MOD , WL1831MOD , WL1835MOD , WL1837MOD

 

  1.   Trademarks
  2. Introduction
    1. 1.1 Acronyms Used in This Document
  3. Peer to Peer (P2P) Mode
    1. 2.1 P2P Device
      1. 2.1.1 Searching Phase
      2. 2.1.2 Negotiation
      3. 2.1.3 Group Formation
    2. 2.2 PSP Client
    3. 2.3 P2P GO
    4. 2.4 P2P Commands
      1. 2.4.1 P2P Commands Detailed Information
        1. 2.4.1.1 p2p_find
        2. 2.4.1.2 p2p_connect
        3. 2.4.1.3 p2p_listen
        4. 2.4.1.4 p2p_group_add
        5. 2.4.1.5 p2p_group_remove
        6. 2.4.1.6 p2p_peer
        7. 2.4.1.7 p2p_invite
      2. 2.4.2 P2P Event Details
    5. 2.5 P2P Use Cases
      1. 2.5.1 P2P Connection in PBC (Push Button Control)
      2. 2.5.2 Create Autonomous 1:2 P2P Group (Push button Control)
        1. 2.5.2.1 Assigning IP Address in P2P Mode Using DHCP Method
        2. 2.5.2.2 Create 1:2 P2P Group - Connect With PIN Code
        3. 2.5.2.3 P2P Invitation Procedure - Create Autonomous 1:2 P2P Group, (Push button Control)
  4. Access Point (AP) and Peer-to-Peer (P2P) Multirole
    1. 3.1 Errata/Limitations
  5. Multi BSSID (mBSSID)
    1. 4.1 Setup and Configuration
    2. 4.2 User Guide and Examples
  6. Access Point (AP) Enhanced Low Power (ELP) Mode
    1. 5.1 Setup and Configuration
    2. 5.2 User Guide and Examples
    3. 5.3 Errata/Limitations
  7. WiLink8 Wake on WLAN (WoWLAN) Feature
    1. 6.1 Mode of Operation
    2. 6.2 Adding "Suspend/Resume" WoW Mode to AM335x EVM
      1. 6.2.1 Patch Description
    3. 6.3 WoWLAN (Wake on WLAN) Mode Enable Procedure
      1. 6.3.1 Commands and Expected Output
      2. 6.3.2 Rx Filter Configuration
        1. 6.3.2.1 Rx Filter Configuration Examples
    4. 6.4 WoWLAN - Magic Packet
    5. 6.5 Block Acknowledgement (BA) Filter Setting
    6. 6.6 Hardware Modification Engineering Change Order (ECO) Request for AM335x EVM
  8. WiLink8 Suspend Resume Mode
    1. 7.1 Suspend Resume Example With AM437x SDK
  9. Access Point (AP) Dynamic Frequency Selection (DFS) Master Support
    1. 8.1 Setup and Configuration
    2. 8.2 User Guide & Examples
    3. 8.3 Errata/Limitations
  10. Station Mode - Alternative Method, With iw Commands, Explained
    1. 9.1 Step 1- Check if the wlan0 Interface is Already Running
    2. 9.2 Step 2- Bringup wlan0 Interface if Not Running
    3. 9.3 Step 3 - Connect Device to Available Acces Point
  11. 10References

Assigning IP Address in P2P Mode Using DHCP Method

The following section details the IP address assignment to the clients using 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.conf

First, 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 p2p-wlan0-0 #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 of lease

After establishing the connection, run the following

  • Enable IPv4 forwarding
  • Assign IP address
  • Start udhcpd to operate the DHCP Server
  • Define the iptables to enable the Network Address Translation (NAT)

The commands to do the above, are:

root@am335x-evm:~# echo 1 > /proc/sys/net/ipv4/ip_forward
root@am335x-evm:~# ifconfig p2p-wlan0-0 192.168.0.1
root@am335x-evm:~# udhcpd /etc/udhcpd.conf
Note: The IP address assigned for 'p2p-wlan0-0' interface (ifconfig p2p-wlan0-0 192.168.0.1) should match the "router" field IP in the udhcpd.conf file that was edited above.

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

root@am335x-evm:~# udhcpc -i p2p-wlan0-0
udhcpc (v1.20.2) started
Sending discover...
Sending select for 192.168.0.20...
Lease of 192.168.0.20 obtained, lease time 864000
/etc/udhcpc.d/50default: Adding DNS 8.8.8.8
/etc/udhcpc.d/50default: Adding DNS 8.8.4.4
root@am335x-evm:~#

Table 2-9 illustrates the DHCP use case.

Table 2-9 P2P IP Address Configuration Using DHCP Procedure
Step # EVM #1 EVM #2 Comments
1 Run: p2p_start.sh Run: p2p_start.sh cd /usr/share/wl18xx/ ./p2p_start.sh
2 Run: p2p_cli.sh Run: p2p_cli.sh ./p2p_cli.sh
3 p2p_find p2p_find
4 p2p_peers p2p_peers verify p2p candidates MAC ADDRESS

5

p2p_group_add

define EVM#1 as Group Owner (GO)
6 Exit wpa_cli on EVM#1 type: quit
7 Re-enter wpa_cli using the newly created 'p2p-wlan0-0' interface wpa_cli -ip2p-wlan0-0
8 wps_pbc Work in Push Button mode
9 p2p_connect EVM#1_MAC_ADDRESS pbc join
10 Exit wpa_cli exit wpa_cli type: quit
11 echo 1 > /proc/sys/net/ipv4/ip_forward Enable IP Forwarding
12 ifconfig p2p-wlan0-0 192.168.0.1 Acquire IP for p2p-wlan0-0 on EVM#1 (Must be same as the router field in the DHCP Configuration file
13 udhcpd /etc/udhcpd.conf Start the DHCP Server