NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
WiLink8 WLAN Demo: Linux
Contents
Overview[edit]
NOTE: This page is under construction.
This wiki page will cover the basic demos available with the WiLink8 device. The page is divided into sections discussing how to set up Station Mode, AP Mode, MultiRole Mode, P2P, and Suspend Resume. All demos assume that the EVM is running Linux using TI Linux SDK with the WiLink 8 software integration completed.
Configuring the Target[edit]
To begin, we will need to configure the target using a pre-made setup script. The script will ask hardware dependent questions which will be used to correctly configure the target for use with the WiLink 8 device. This script uses 'wlconf' utility to create WiLink8 configuration binary file - '/lib/firmware/ti-connectivity/wl18xx-conf.bin'. For more details on 'wlconf' utility and how to modify this configuration file pls consult : http://www.ti.com/lit/an/swra489/swra489.pdf
- Establish a serial connection with the target device and log in as root. Terminal software such as minicom or PuTTy can be used.
- Navigate to the location of the script /usr/sbin/wlconf
cd /usr/sbin/wlconf
NOTE: If this directory doesn't exist, it is located elsewhere in the file system. You will need to copy the contents in order for the script to work. Use the following commands instead:
mkdir /usr/sbin/wlconf cp -r /usr/bin/wlconf/* /usr/sbin/wlconf
- Run the configure-device.sh script as follows:
./configure-device.sh
- The script will take you through a series of hardware-dependent questions, and configure wlconf for your system. This script can be used for WiLink8 TI modules, non-TI modules or chip on board designs. Examples below:
- WiLink8 TI Module configuration
- WiLink8 chip on board or non-TI Module configuration
Example: root@am335x-evm:/usr/sbin/wlconf# ./configure-device.sh Please provide the following information. Are you using a TI module? [y/n] : y What is the chip flavor? [1801/1805/1807/1831/1835/1837 or 0 for unknown] : 1837 Should Japanese standards be applied? [y/n] : n How many 2.4GHz antennas are fitted? [1/2] : 2 How many 5GHz antennas are fitted (using 2 antennas requires a proper switch)? [0/1/2] : 2
In this case , configure script will pick INI file /usr/sbin/wlconf/official_inis/WL8_COB_INI.ini. TI provides template of this file. Customers will need to modify RF parameters in this file as per their design or use the values from respective module vendor.
Example: root@am335x-evm:/usr/sbin/wlconf# ./configure-device.sh Please provide the following information. Are you using a TI module? [y/n] : n What is the chip flavor? [1801/1805/1807/1831/1835/1837 or 0 for unknown] : 1837 How many 2.4GHz antennas are fitted? [1/2] : 2 How many 5GHz antennas are fitted (using 2 antennas requires a proper switch)? [0/1/2] : 2
The following demos will guide you through the basic Wi-Fi examples using a set of pre-made scripts. These scripts, made for ease-of-use, can be found in /usr/share/wl18xx.
Station Mode[edit]
This demo configures the WiLink device to be in station mode. In station mode, the device acts as a WiFi client and connects to an access point.
Hardware Setup[edit]
- The EVM with the WiLink device should be connected to a host computer through a serial interface
- Serial specifications: 115200 baud, 8N1
- Ensure that the WiLink device is mounted correctly onto the EVM and that you have configured the target device using the procedure from earlier
- The WiLink device will be connecting to a nearby Access Point, it can be secured or unsecured
Station Mode Procedure[edit]
The general procedure of using the pre-built scripts for Station Mode is as follows:
- Navigate to the directory which contains the out-of-box scripts
- Load wlcore module
- Start station mode
- Connect to an unsecured access point
- Request an IP address from the access point
- Ping the access point to verify the connection
Connecting to an Unsecured AP[edit]
cd /usr/share/wl18xx ./load_wlcore.sh ./sta_start.sh ./sta_connect-ex.sh SSID udhcpc -i wlan0
Connecting to a Secured AP[edit]
cd /usr/share/wl18xx ./load_wlcore.sh ./sta_start.sh ./sta_connect-ex.sh SSID WPA-PSK password udhcpc -i wlan0
Verifying Connectivity[edit]
In order to verify the connection, use the ping command. For example, if the Access Point IP address is 192.168.1.1, we will invoke the following command on the EVM:
ping 192.168.1.1
You should see the an output similar to the following:
PING 192.168.1.1 (192.168.1.1): 56 data bytes 64 bytes from 192.168.1.1: seq=0 ttl=64 time=1003.369 ms 64 bytes from 192.168.1.1: seq=1 ttl=64 time=2.526 ms 64 bytes from 192.168.1.1: seq=2 ttl=64 time=7.931 ms 64 bytes from 192.168.1.1: seq=3 ttl=64 time=7.925 ms 64 bytes from 192.168.1.1: seq=4 ttl=64 time=7.968 ms 64 bytes from 192.168.1.1: seq=5 ttl=64 time=8.105 ms
You can also invoke the command
iw wlan0 link
. This command will display the AP settings and verify the connection.
AP Mode (create an Access Point)[edit]
This demo shows how to configure the system to act as an AP, both with or without security.
Hardware Setup[edit]
- The EVM with the WiLink device should be connected to a host computer through a serial interface
- Serial specifications: 115200 baud, 8N1
- Ensure that the WiLink device is mounted correctly onto the EVM and that you have configured the target device using the procedure from earlier
- The WiLink device will be acting as an Access Point. The connection can be tested using a device such as a smartphone or laptop.
AP Mode Procedure[edit]
Configuring the Access Point[edit]
Configure the AP by editing the hostapd.conf file, located at /usr/share/wl18xx/hostapd.conf. In this file, there are options to change the SSID, security and other advanced features shown in the file.
To edit hostapd.conf, perform the following commands:
cd /usr/share/wl18xx vi hostapd.conf #Type 'i' to edit #Hit ESC to exit edit mode #Type ':wq' to write and quit
Once this is completed, the AP settings have been set and it is time to start the Access Point!
Starting the AP[edit]
Before starting the access point, ensure that the script includes the right location of the hostapd daemon, which is /usr/sbin
Open the ap_start script for editing, and make sure HOSTAPD_BIN_DIR = /usr/sbin. If it is a different directory, change it as follows:
vi ap_start.sh #Type 'i' to edit #Change HOSTAPD_BIN_DIR=/usr/sbin #Type ':wq' to write and quit
Once the directory is changed in the script, we can now start the AP.
./ap_start.sh
Note that the settings of the AP are loaded by default from /usr/share/wl18xx/hostapd.conf, which sets the following:
SSID: SitaraAP Region: US Channel: 11 Beacon interval: 100 kus Security: Open
Verifying Connectivity[edit]
To verify the AP broadcasting, use any commercial Station (smart phone, laptop, etc.) and connect. You should see a prompt (AP_STA_CONNECTED) when the station successfully connects to the WiLink AP.
MultiRole (STA + AP modes)[edit]
This demo will show how to use the WiLink device as both a station and as an AP, using the out-of-box scripts available at /usr/share/wl18xx.
An example use-case for a multirole Wi-Fi device might be to act as a wireless bridge. In MultiRole, the WiLink device can connect to an internet-enabled secure AP (STA mode) as a client, while simultaneously acting as a station to which other devices can then connect to for internet access.
Hardware Setup[edit]
- The EVM with the WiLink device should be connected to a host computer through a serial interface
- Serial specifications: 115200 baud, 8N1
- Ensure that the WiLink device is mounted correctly onto the EVM and that you have configured the target device using the procedure from earlier
- The WiLink device will be connecting to another AP while also acting as an AP to other devices
MultiRole Setup Procedure[edit]
General Procedure[edit]
The process of executing a multirole connection is summarized as follows:
- Load wlcore
- Start Station Role
- Connect to an Access Point
- Start AP Role
Loading wlcore[edit]
Using the out-of-box WiLink scripts, load wlcore by executing the following commands:
cd /usr/share/wl18xx ./load_wlcore.sh
Start Station Role[edit]
Next, start Station Mode.
./sta_start.sh
Connect to an Access Point[edit]
Using the following commands, connect to an AP by replacing "exampleSSID" and "examplepassword" with the target AP's information. Once connected, request an IP address.
./sta_connect-ex.sh exampleSSID WPA-PSK examplepassword udhcpc -i wlan0
Start AP Role[edit]
Before starting the access point, make sure that the script includes the right location of the hostapd daemon, which is /usr/sbin.
Open the ap_start script for editing, and make sure HOSTAPD_BIN_DIR = /usr/sbin. If it is a different directory, change it as follows:
vi ap_start.sh #Type 'i' to edit #Change HOSTAPD_BIN_DIR=/usr/sbin #Type ':wq' to write and quit
Note that the settings of the AP are loaded by default from /usr/share/wl18xx/hostapd.conf, which sets the following:
SSID: SitaraAP Region: US Channel: 11 Beacon interval: 100 kus Security: Open
The settings can be viewed and changed in the /usr/share/wl18xx/hostapd.conf file. To edit hostapd.conf, perform the following commands:
cd /usr/share/wl18xx vi hostapd.conf #Type 'i' to edit #Hit ESC to exit edit mode #Type ':wq' to write and quit
Finally, start the AP:
./ap_start.sh
If the default hostapd.conf settings were not changed, the AP should now be broadcasting as SitaraAP while also being connected as a Station to the AP specified in the "Start Station Role" section. To verify the station connectivity, invoke:
iw wlan0 link
The details of the AP you are connected to should show up.
To verify the AP broadcast, use any commercial Station (smart phone, laptop, etc.) and connect. You should see a prompt (AP_STA_CONNECTED) when the station successfully connects to the WiLink AP.
WiFi Peer-to-Peer (P2P)[edit]
- 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.
Setting up P2P[edit]
There are three scripts provided for the setup and usage of WiFi P2P. These scripts are located in /usr/share/wl18xx. The script names and their functions are as follows: p2p_start.sh : Starts the P2P interface p2p_stop.sh : Stops the P2P interface p2p_cli.sh : Enter into the P2P command line interface
Starting and Configuring P2P[edit]
Change the working directory to /usr/share/wl18xx
cd /usr/share/wl18xx
Run the p2p_start script. The output should look similar to the following:
root@am335x-evm:/usr/share/wl18xx# ./p2p_start.sh Successfully initialized wpa_supplicant rfkill: Cannot open RFKILL control device wlcore: PHY firmware version: Rev 8.2.0.0.232 wlcore: firmware booted (Rev 8.9.0.0.48) IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready cfg80211: Calling CRDA for country: US cfg80211: Regulatory domain changed to country: US cfg80211: DFS Master region: FCC cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 mBm), (N/A) cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 1700 mBm), (N/A) cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2300 mBm), (0 s) cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm), (N/A) cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) wlcore: down rfkill: Cannot open RFKILL control device Could not read interface p2p-dev-wlan0 flags: No such device wlcore: PHY firmware version: Rev 8.2.0.0.232 wlcore: firmware booted (Rev 8.9.0.0.48) p2p-dev-wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=US
Run the p2p_cli script. The output should look similar to the following:
root@am335x-evm:/usr/share/wl18xx# ./p2p_cli.sh wpa_cli v2.5-devel Copyright (c) 2004-2015, 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 >
NOTE: Make sure that all the participating EVMs the WiFi Direct (P2P) network have unique MAC addresses and that all have IP addresses in the same subnet. NOTE: P2P uses the 5GHz band by default. If one of the EVMs (e.g. BeagleBone) does not support the 5GHz band, use the additional parameter "freq=2412" to the p2p connect commands.
Connecting in P2P mode[edit]
PBC (Push Button Control) mode[edit]
Step # | EVM #1 | EVM #2 | Comments |
---|---|---|---|
1 | p2p_find | p2p_find | |
2 | p2p_peers | p2p_peers | Verify MAC addresses of P2P candidates |
3 | p2p_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 |
PBC mode, with EVM #1 as Group Owner[edit]
Step # | EVM #1 | EVM #2 | Comments |
---|---|---|---|
1 | p2p_find | p2p_find | |
2 | p2p_peers | p2p_peers | Verify MAC addresses of P2P candidates |
3 | p2p_group_add | Define EVM #1 as Group Owner | |
4 | quit wpa_cli -ip2p-wlan0-0 |
Enter the wpa_cli using the newly created p2p-wlan0-0 interface | |
5 | wps_pbc | ||
6 | p2p_connect EVM#1_MAC_ADDRESS pbc join |
WPS connection, with EVM #1 as group owner[edit]
Step # | EVM #1 | EVM #2 | Comments |
---|---|---|---|
1 | p2p_find | p2p_find | |
2 | p2p_peers | p2p_peers | Verify MAC addresses of P2P candidates |
3 | p2p_group_add | Define EVM #1 as GO | |
4 | quit wpa_cli -ip2p-wlan0-0 |
Enter the wpa_cli using the newly created p2p-wlan0-0 interface | |
5 | wps_pin any | EVM #1's PIN code will print on the following line | |
6 | p2p_connect EVM#1_MAC_ADDRESS EVM#1_PIN_NUMBER join |
PIN connection[edit]
Step # | EVM #1 | EVM #2 | Comments |
---|---|---|---|
1 | p2p_find | p2p_find | |
2 | p2p_peers | p2p_peers | Verify MAC addresses of P2P candidates |
3 | p2p_connect EVM#2_MAC_ADDRESS pin auth | EVM #1's PIN code will print on the following line | |
4 | p2p_connect EVM#1_MAC_ADDRESS EVM#1_PIN_CODE | Replace EVM#1_PIN_CODE with the PIN from Step 3 |
P2P Demo[edit]
In this example, we will explore how to connect two EVMs together using Wi-Fi P2P. EVM#1 will be set as the Group Owner for this network. Once the P2P network has been established, we will assign IP addresses to both devices and perform a ping test to verify connectivity.
The command flow is as follows:
Step # | EVM #1 | EVM #2 | Comments |
---|---|---|---|
1 | p2p_start.sh | p2p_start.sh | cd /usr/share/wl18xx/ ./p2p_start.sh |
2 | p2p_cli.sh | p2p_cli.sh | ./p2p_cli.sh |
3 | p2p_find | p2p_find | |
4 | p2p_peers | p2p_peers | Verify MAC addresses of P2P candidates |
5 | p2p_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 | ||
7 | Verify connection with Ping traffic | ||
8 | p2p_stop.sh | p2p_stop.sh | ./p2p_stop.sh |
EVM #1: p2p_cli.sh root@am437x-evm:/usr/share/wl18xx# ./p2p_cli.sh wpa_cli v2.5-devel Copyright (c) 2004-2015, 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 > |
EVM #2: p2p_cli.sh root@am335x-evm:/usr/share/wl18xx# ./p2p_cli.sh wpa_cli v2.5-devel Copyright (c) 2004-2015, 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 > |
EVM #1: p2p_find
> p2p_find OK <3>CTRL-EVENT-SCAN-STARTED ... > P2P-DEVICE-FOUND 54:4a:16:3a:c6:29 p2p_dev_addr=54:4a:16:3a:c6:29 pri_dev_type=0-00000000-0 name='Sitara' config_methods=0x188 dev_capab=0x25 group_capab=0x0 new=1 <3>P2P-DEVICE-FOUND 54:4a:16:3a:c6:29 p2p_dev_addr=54:4a:16:3a:c6:29 pri_dev_type=0-00000000-0 name='Sitara' config_methods=0x188 dev_capab=0x25 group_capab=0x0 new=1 <3>CTRL-EVENT-SCAN-STARTED ...
> p2p_peers 54:4a:16:3a:c6:29
EVM #2: p2p_find
> p2p_find OK <3>CTRL-EVENT-SCAN-STARTED ... > P2P-DEVICE-FOUND 78:a5:04:26:97:3e p2p_dev_addr=78:a5:04:26:97:3e pri_dev_type=0-00000000-0 name='Sitara' config_methods=0x188 dev_capab=0x25 group_capab=0x0 new=1 <3>P2P-DEVICE-FOUND 78:a5:04:26:97:3e p2p_dev_addr=78:a5:04:26:97:3e pri_dev_type=0-00000000-0 name='Sitara' config_methods=0x188 dev_capab=0x25 group_capab=0x0 new=1 <3>CTRL-EVENT-SCAN-STARTED ...
> p2p_peers 78:a5:04:26:97:3e
EVM #1: p2p_connect
> p2p_connect 54:4a:16:3a:c6:29 pbc auth go_intent=7 OK > P2P-FIND-STOPPED <3>P2P-FIND-STOPPED > P2P-GO-NEG-SUCCESS role=GO freq=5785 ht40=1 peer_dev=54:4a:16:3a:c6:29 peer_iface=56:4a:16:3a:c6:28 wps_method=PBC <3>P2P-GO-NEG-SUCCESS role=GO freq=5785 ht40=1 peer_dev=54:4a:16:3a:c6:29 peer_iface=56:4a:16:3a:c6:28 wps_method=PBC > rfkill: Cannot[ 163.485189] IPv6: ADDRCONF(NETDEV_UP): p2p-wlan0-0: link is not ready open RFKILL control device [ 163.696518] wlcore: down p2p-wlan0-0: interface state UNINITIALIZED->HT_SCAN Using interface p2p-wlan0-0 with hwaddr 7a:a5:04:26:97:3d and ssid "DIRECT-HS" [ 163.964447] IPv6: ADDRCONF(NETDEV_CHANGE): p2p-wlan0-0: link becomes ready p2p-wlan0-0: interface state HT_SCAN->ENABLED p2p-wlan0-0: AP-ENABLED p2p-wlan0-0: CTRL-EVENT-CONNECTED - Connection to 7a:a5:04:26:97:3d completed [id=0 id_str=] p2p-wlan0-0: WPS-PBC-ACTIVE <3>CTRL-EVENT-SCAN-RESULTS > p2p-wlan0-0: CTRL-EVENT-EAP-STARTED 56:4a:16:3a:c6:28 p2p-wlan0-0: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1 p2p-wlan0-0: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=14122 method=254 p2p-wlan0-0: WPS-REG-SUCCESS 56:4a:16:3a:c6:28 78efc791-3214-54b1-8c7e-5be0d1f274e2 P2P-GROUP-FORMATION-SUCCESS <3>P2P-GROUP-FORMATION-SUCCESS <3>P2P-GROUP-STARTED p2p-wlan0-0 GO ssid="DIRECT-HS" freq=5785 passphrase="hf3O0VFN" go_dev_addr=78:a5:04:26:97:3e > P2P-GROUP-STARTED p2p-wlan0-0 GO ssid="DIRECT-HS" freq=5785 go_dev_addr=78:a5:04:26:97:3e p2p-wlan0-0: WPS-PBC-DISABLE p2p-wlan0-0: WPS-SUCCESS p2p-wlan0-0: CTRL-EVENT-EAP-FAILURE 56:4a:16:3a:c6:28 p2p-wlan0-0: AP-STA-CONNECTED 56:4a:16:3a:c6:28 p2p_dev_addr=54:4a:16:3a:c6:29 AP-STA-CONNECTED 56:4a:16:3a:c6:28 p2p_dev_addr=54:4a:16:3a:c6:29 <3>AP-STA-CONNECTED 56:4a:16:3a:c6:28 p2p_dev_addr=54:4a:16:3a:c6:29
EVM #2: p2p_connect
> p2p_connect 78:a5:04:26:97:3e pbc P2P-FIND-STOPPED OK <3>P2P-FIND-STOPPED > P2P-GO-NEG-SUCCESS role=client freq=5785 ht40=1 peer_dev=78:a5:04:26:97:3e peer_iface=7a:a5:04:26:97:3d wps_method=PBC <3>P2P-GO-NEG-SUCCESS role=client freq=5785 ht40=1 peer_dev=78:a5:04[ 152.100796] IPv6: ADDRCONF(NETDEV_UP): p2p-wlan0-0: link is not ready :26:97:3e peer_iface=7a:a5:04:26:97:3d wps_method=PBC > rfkill: Cannot open RFKILL control device p2p-wlan0-0: SME: Trying to authenticate with 7a:a5:04:26:97:3d [ 153.031799] p2p-wlan0-0: authenticate with 7a:a5:04:26:97:3d (SSID='DIRECT-HS' freq=5785 MHz) [ 153.048411] p2p-wlan0-0: send auth to 7a:a5:04:26:97:3d (try 1/3) [ 153.106117] p2p-wlan0-0: authenticated p2p-wlan0-0: Trying to associate with 7a:a5:04:26:97:3d (SSID='D[ 153.112919] p2p-wlan0-0: associate with 7a:a5:04:26:97:3d (try 1/3) IRECT-HS' freq=5785 MHz) [ 153.137937] p2p-wlan0-0: RX AssocResp from 7a:a5:04:26:97:3d (capab=0x11 status=0 aid=1) [ 153.160889] IPv6: ADDRCONF(NETDEV_CHANGE): p2p-wlan0-0: link becomes ready [ 153.168129] p2p-wlan0-0: associated p2p-wlan0-0: Associated with 7a:a5:04:26:97:3d p2p-wlan0-0: CTRL-EVENT-EAP-STARTED EAP authentication started p2p-wlan0-0: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=14122 method=1 p2p-wlan0-0: CTRL-EVENT-EAP-METHOD EAP vendor 14122 method 1 (WSC) selected p2p-wlan0-0: WPS-CRED-RECEIVED p2p-wlan0-0: WPS-SUCCESS P2P-GROUP-FORMATION-SUCCESS <3>P2P-GROUP-FORMATION-SUCCESS > p2p-wlan0-0: CTRL-EVENT-EAP-FAILURE EAP authentication failed[ 153.587483] p2p-wlan0-0: deauthenticating from 7a:a5:04:26:97:3d by local choice (Reason: 3=DEAUTH_LEAVING) [ 153.641061] cfg80211: Calling CRDA to update world regulatory domain p2p-wlan0-0: CTRL-EVENT-DISCONNECTED bssid=7a:a5:04:26:97:3d reason=3 locally_generated=1 p2p-wlan0-0: SME: Trying to authenticate with 7a:a5:04:26:97:3d [ 153.662373] p2p-wlan0-0: authenticate with 7a:a5:04:26:97:3d (SSID='DIRECT-HS' freq=5785 MHz) [ 153.693043] p2p-wlan0-0: send auth to 7a:a5:04:26:97:3d (try 1/3) [ 153.886367] p2p-wlan0-0: authenticated p2p-wlan0-0: Trying to associate with 7a:a5:04:26:97:3d (SSID='D[ 153.890652] cfg80211: World regulatory domain updated: IRECT-HS' freq=5785 MHz) [ 153.901788] cfg80211: DFS Master region: unset [ 153.908091] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 153.917925] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 153.926348] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 153.934436] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A) [ 153.942746] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 153.953124] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 153.962716] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s) [ 153.970848] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A) [ 153.979253] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A) [ 153.987494] cfg80211: Calling CRDA for country: US p2p-wlan0-0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD[ 154.002636] p2p-wlan0-0: associate with 7a:a5:04:26:97:3d (try 1/3) [ 154.122766] cfg80211: Regulatory domain changed to country: US [ 154.129005] p2p-wlan0-0: RX AssocResp from 7a:a5:04:26:97:3d (capab=0x11 status=0 aid=1) [ 154.137984] cfg80211: DFS Master region: FCC [ 154.142205] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 154.153611] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 3000 mBm), (N/A) [ 154.161787] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 1700 mBm), (N/A) [ 154.172011] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2300 mBm), (0 s) [ 154.181774] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm), (N/A) [ 154.191168] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) p2p-wlan0-0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=US [ 154.212782] p2p-wlan0-0: associated p2p-wlan0-0: Associated with 7a:a5:04:26:97:3d p2p-wlan0-0: WPA: Key negotiation completed with 7a:a5:04:26:97:[ 154.291945] wlcore: Association completed. 3d [PTK=CCMP GTK=CCMP] p2p-wlan0-0: CTRL-EVENT-CONNECTED - Connection to 7a:a5:04:26:97:3d completed [id=0 id_str=] <3>P2P-GROUP-STARTED p2p-wlan0-0 client ssid="DIRECT-HS" freq=5785 psk=08dd88ac41f0a0d4321fd33de19e35d7a54fb827e8a5359193d8487880e15704 go_dev_addr=78:a5:04:26:97:3e > P2P-GROUP-STARTED p2p-wlan0-0 client ssid="DIRECT-HS" freq=5785 go_dev_addr=78:a5:04:26:97:3e
Exit the wpa supplicant CLI by hitting "q" on both EVMs.
> q
Assign ip address to "p2p-wlan0-0" interface on both EVMs.
EVM #1: Assign IP Address
root@am437x-evm:/usr/share/wl18xx# ifconfig p2p-wlan0-0 192.168.3.3 root@am437x-evm:/usr/share/wl18xx# ifconfig -a eth0 Link encap:Ethernet HWaddr C4:BE:84:CC:AC:A4 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:168 eth1 Link encap:Ethernet HWaddr C4:BE:84:CC:AC:A6 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:119 errors:0 dropped:0 overruns:0 frame:0 TX packets:119 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:191475 (186.9 KiB) TX bytes:191475 (186.9 KiB) p2p-wlan0-0 Link encap:Ethernet HWaddr 7A:A5:04:26:97:3D inet addr:192.168.3.3 Bcast:192.168.3.255 Mask:255.255.255.0 inet6 addr: fe80::78a5:4ff:fe26:973d/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:33 errors:0 dropped:2 overruns:0 frame:0 TX packets:36 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2919 (2.8 KiB) TX bytes:4457 (4.3 KiB) wlan0 Link encap:Ethernet HWaddr 78:A5:04:26:97:3D BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
EVM #2: Assign IP Address
root@am335x-evm:/usr/share/wl18xx# ifconfig p2p-wlan0-0 192.168.3.4 root@am335x-evm:/usr/share/wl18xx# ifconfig -a eth0 Link encap:Ethernet HWaddr C8:A0:30:AD:12:B4 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:171 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:10 errors:0 dropped:0 overruns:0 frame:0 TX packets:10 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:700 (700.0 B) TX bytes:700 (700.0 B) p2p-wlan0-0 Link encap:Ethernet HWaddr 56:4A:16:3A:C6:28 inet addr:192.168.3.4 Bcast:192.168.3.255 Mask:255.255.255.0 inet6 addr: fe80::544a:16ff:fe3a:c628/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:26 errors:0 dropped:0 overruns:0 frame:0 TX packets:38 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3023 (2.9 KiB) TX bytes:4041 (3.9 KiB) wlan0 Link encap:Ethernet HWaddr 54:4A:16:3A:C6:28 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Use ping command to verify connection
EVM #1: Ping Test
root@am437x-evm:/usr/share/wl18xx# ping 192.168.3.4 PING 192.168.3.4 (192.168.3.4): 56 data bytes 64 bytes from 192.168.3.4: seq=0 ttl=64 time=193.529 ms 64 bytes from 192.168.3.4: seq=1 ttl=64 time=1032.839 ms 64 bytes from 192.168.3.4: seq=2 ttl=64 time=32.006 ms 64 bytes from 192.168.3.4: seq=3 ttl=64 time=54.723 ms 64 bytes from 192.168.3.4: seq=4 ttl=64 time=77.625 ms 64 bytes from 192.168.3.4: seq=5 ttl=64 time=306.206 ms 64 bytes from 192.168.3.4: seq=6 ttl=64 time=125.311 ms 64 bytes from 192.168.3.4: seq=7 ttl=64 time=148.801 ms --- 192.168.3.4 ping statistics --- 8 packets transmitted, 8 packets received, 0% packet loss round-trip min/avg/max = 32.006/246.380/1032.839 ms
EVM #2: Ping Test
root@am335x-evm:/usr/share/wl18xx# 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=229.453 ms 64 bytes from 192.168.3.3: seq=1 ttl=64 time=9.430 ms 64 bytes from 192.168.3.3: seq=2 ttl=64 time=10.999 ms 64 bytes from 192.168.3.3: seq=3 ttl=64 time=9.187 ms 64 bytes from 192.168.3.3: seq=4 ttl=64 time=10.008 ms 64 bytes from 192.168.3.3: seq=5 ttl=64 time=9.076 ms 64 bytes from 192.168.3.3: seq=6 ttl=64 time=115.450 ms --- 192.168.3.3 ping statistics --- 7 packets transmitted, 7 packets received, 0% packet loss round-trip min/avg/max = 9.076/56.229/229.453 ms
Exit the p2p tests on both EVMs
EVM #1: Exit
root@am437x-evm:/usr/share/wl18xx# ./p2p_stop.sh P2P-GROUP-REMOVED p2p-wlan0-0 GO reason=REQUESTED p2p-wlan0-0: interface state ENABLED->DISABLED p2p-wlan0-0: AP-STA-DISCONNECTED 56:4a:16:3a:c6:28 p2p_dev_addr=54:4a:16:3a:c6:29 AP-STA-DISCONNECTED 56:4a:16:3a:c6:28 p2p_dev_addr=54:4a:16:3a:c6:29 p2p-wlan0-0: AP-DISABLED p2p-wlan0-0: CTRL-EVENT-DISCONNECTED bssid=7a:a5:04:26:97:3d reason=3 locally_generated=1 nl80211: deinit ifname=p2p-wlan0-0 disabled_11b_rates=1 [ 1135.058889] wlcore: down P2P-DEVICE-LOST p2p_dev_addr=54:4a:16:3a:c6:29 nl80211: deinit ifname=p2p-dev-wlan0 disabled_11b_rates=0 OK root@am437x-evm:/usr/share/wl18xx# [ 1135.173022] wlcore: down p2p-dev-wlan0: CTRL-EVENT-TERMINATING nl80211: deinit ifname=wlan0 disabled_11b_rates=0 wlan0: CTRL-EVENT-TERMINATING
EVM #2: Exit
root@am335x-evm:/usr/share/wl18xx# ./p2p_stop.sh nl80211: deinit ifname=p2p-dev-wlan0 disabled_11b_rates=0 OK [ 1169.243405] wlcore: down root@am335x-evm:/usr/share/wl18xx# p2p-dev-wlan0: CTRL-EVENT-TERMINATING nl80211: deinit ifname=wlan0 disabled_11b_rates=0 wlan0: CTRL-EVENT-TERMINATING
For more advanced P2P demos, please visit: WiLink8_WLAN_Advanced_Demos:_Linux#P2P_commands
Suspend Resume[edit]
For low-power modes, the WL18xx chip can be held in a suspend/shutdown mode where it will draw minimal current in order to preserve battery life/minimize power draw. These commands can be run on any supported platform, including, but not limited to, the AM335x, AM437x, AM57x, and BeagleBone. The WL18xx module also supports Wake on WLAN (WoWLAN) on these platforms.
Suspend Resume in shutdown mode On Suspend state, the WL18xx chip will be held in shutdown mode, where the host disables the WLAN portion by keeping the WLAN_Enable signal OFF, in which the WL18xx chip has minimal current consumption.
How to operate Suspend Resume To enable the the processor to enter the suspend state perform the following:
Attach the file system "debugfs" which is of type debugfs) at the directory "tmp"
mount -t debugfs debugfs /tmp/
Enabling system for hitting OFF:
By default, retention is the deepest sleep state attempted. To enable power domain transitions to off mode
echo 1 > /tmp/pm_debug/enable_off_mode
To enter suspend mode:
echo mem > /sys/power/state
To Resume from suspend:
Serial console activity or other configured wakeup sources (keypad, touchscreen) will trigger resume
Suspend Resume Example w/ AM437SK
- Load wlcore module
- Start station mode
- Connect to AP
- Enter suspend mode
- After some time, resume from suspend
First, load the wlcore module, start the station and connect to an AP with the following commands:
cd /usr/share/wl18xx ./load_wlcore.sh ./sta_start.sh ./sta_connect-ex.sh OpenSSID
You can verify it is connected with the following command, which will output the AP settings and RSSI:
iw wlan0 link
You can now enter Suspend mode by evoking:
echo mem > /sys/power/state
The expected results are the following log, and the EVM screen turning off:
[ 344.900146] PM: Syncing filesystems ... done. [ 347.304138] Freezing user space processes ... (elapsed 0.01 seconds) done. [ 347.324859] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done. [ 347.344879] Suspending console(s) (use no_console_suspend to debug) [ 347.359039] wl12xx: down [ 347.492248] PM: suspend of devices complete after 139.892 msecs [ 347.494049] PM: late suspend of devices complete after 1.708 msecs [ 354.081787] GFX domain entered low power state [ 354.081848] Successfully transitioned all domains to low power state [ 1599.585723] PM: Syncing filesystems ... done. [ 1602.515808] Freezing user space processes ... (elapsed 0.01 seconds) done. [ 1602.539642] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done. [ 1602.559600] Suspending console(s) (use no_console_suspend to debug) [ 1602.567535] wl12xx: down [ 1602.706909] PM: suspend of devices complete after 139.770 msecs [ 1602.708557] PM: late suspend of devices complete after 1.556 msecs [ 1634.825073] GFX domain entered low power state
Note: The last 4 lines will be shown only after resume (since suspend happened before the print task was completed)
After hitting the terminal console - in order to resume from suspend mode, the EVM screen will be active again, following the logs below:
[ 354.290771] PM: early resume of devices complete after 208.465 msecs [ 354.606018] net eth0: CPSW phy found : id is : 0x4dd074 [ 354.610931] wl12xx: state: 0 [ 355.069427] wl12xx: PHY firmware version: Rev 8.2.0.0.232 [ 355.069488] wl12xx: firmware booted (Rev 8.9.0.0.48) [ 355.130493] wl12xx: Association completed. [ 355.153411] PM: resume of devices complete after 861.928 msecs [ 355.216430] Restarting tasks ... done.
After a suspend or after some idle time, use the powerdomain transition stats to check that transitions to off-mode are happening
# cat /tmp/pm_debug/count
the results are:
root@am335x-evm:~# cat /tmp/pm_debug/count [ 611.886413] pwrdm state mismatch(cefuse_pwrdm) 3 != 0 cefuse_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0 mpu_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0,RET-MEMBANK2-OFF:0,RET-MEMBANK3-OFF:0 per_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:7,RET-MEMBANK1-OFF:0,RET-MEMBANK2-OFF:0,RET-MEMBANK3-OFF:0 rtc_pwrdm (OFF),OFF:1,RET:0,INA:0,ON:0,RET-LOGIC-OFF:0 gfx_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:0,RET-MEMBANK1-OFF:0 l4_cefuse_clkdm->cefuse_pwrdm (0) gfx_l4ls_gfx_clkdm->gfx_pwrdm (0) gfx_l3_clkdm->gfx_pwrdm (1) l4_rtc_clkdm->rtc_pwrdm (1) mpu_clkdm->mpu_pwrdm (1) l4_wkup_aon_clkdm->wkup_pwrdm (3) l3_aon_clkdm->wkup_pwrdm (1) l4_wkup_clkdm->wkup_pwrdm (5) clk_24mhz_clkdm->per_pwrdm (1) lcdc_clkdm->per_pwrdm (1) cpsw_125mhz_clkdm->per_pwrdm (2) pruss_ocp_clkdm->per_pwrdm (0) ocpwp_l3_clkdm->per_pwrdm (0) l4hs_clkdm->per_pwrdm (1) l3_clkdm->per_pwrdm (10) l4fw_clkdm->per_pwrdm (2) l3s_clkdm->per_pwrdm (4) l4ls_clkdm->per_pwrdm (19)
The counter that will advance each suspend resume cycle is: per_pwrdm (ON),OFF:0,RET:0,INA:0,ON:1,RET-LOGIC-OFF:7,RET-MEMBANK1-OFF:0,RET-MEMBANK2-OFF:0,RET-MEMBANK3-OFF:0
SISO20/SISO40/MIMO Operation Modes Switching[edit]
Please refer to App Note SWRA489 regarding configuration using the wlconf tool. Section 6 details out how to switch operation modes between SISO20, SISO40, and MIMO.