Telit Wireless Solutions WE866C3 User Manual

WE866C3 Wi-Fi Network Interface Card
(NIC) User Guide
1VV0301545 Rev 1.0 2018-07-09
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
SPECIFICATIONS ARE SUBJECT TO CHANGE WITHOUT NOTICE
NOTICE
While reasonable efforts have been made to assure the accuracy of this document, Telit assumes no liability resulting from any inaccuracies or omissions in this document, or from use of the information obtained herein. The information in this document has been carefully checked and is believed to be reliable. However, no responsibility is assumed for inaccuracies or omissions. Telit reserves the right to make changes to any products described herein and reserves the right to revise this document and to make changes from time to time in content hereof with no obligation to notify any person of revisions or changes. Telit does not assume any liability arising out of the application or use of any product, software, or circuit described herein; neither does it convey license under its patent rights or the rights of others.
It is possible that this publication may contain references to, or information about Telit products (machines and programs), programming, or services that are not announced in your country. Such references or information must not be construed to mean that Telit intends to announce such Telit products, programming, or services in your country.
COPYRIGHTS
This instruction manual and the Telit products described in this instruction manual may be, include or describe copyrighted Telit material, such as computer programs stored in semiconductor memories or other media. Laws in the Italy and other countries preserve for Telit and its licensors certain exclusive rights for copyrighted material, including the exclusive right to copy, reproduce in any form, distribute and make derivative works of the copyrighted material. Accordingly, any copyrighted material of Telit and its licensors contained herein or in the Telit products described in this instruction manual may not be copied, reproduced, distributed, merged or modified in any manner without the express written permission of Telit. Furthermore, the purchase of Telit products shall not be deemed to grant either directly or by implication, estoppel, or otherwise, any license under the copyrights, patents or patent applications of Telit, as arises by operation of law in the sale of a product.
COMPUTER SOFTWARE COPYRIGHTS
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
USAGE AND DISCLOSURE RESTRICTIONS
I. License Agreements
The software described in this document is the property of Telit and its licensors. It is furnished by express license agreement only and may be used only in accordance with the terms of such an agreement.
II. Copyrighted Materials
Software and documentation are copyrighted materials. Making unauthorized copies is prohibited by law. No part of the software or documentation may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language or computer language, in any form or by any means, without prior written permission of Telit
III. High Risk Materials
Components, units, or third-party products used in the product described herein are NOT fault-tolerant and are NOT designed, manufactured, or intended for use as on-line control equipment in the following hazardous environments requiring fail-safe controls: the operation of Nuclear Facilities, Aircraft Navigation or Aircraft Communication Systems, Air Traffic Control, Life Support, or Weapons Systems (High Risk Activities"). Telit and its supplier(s) specifically disclaim any expressed or implied warranty of fitness for such High Risk Activities.
IV. Trademarks
TELIT and the Stylized T Logo are registered in Trademark Office. All other product or service names are the property of their respective owners.
V. Third Party Rights
The software may include Third Party Right software. In this case you agree to comply with all terms and conditions imposed on you in respect of such separate software. In addition to Third Party Terms, the disclaimer of warranty and limitation of liability provisions in this License shall apply to the Third Party Right software.
TELIT HEREBY DISCLAIMS ANY AND ALL WARRANTIES EXPRESS OR IMPLIED FROM ANY THIRD PARTIES REGARDING ANY SEPARATE FILES, ANY THIRD PARTY MATERIALS INCLUDED IN THE SOFTWARE, ANY THIRD PARTY MATERIALS
FROM WHICH THE SOFTWARE IS DERIVED (COLLECTIVELY “OTHER CODE”), AND
THE USE OF ANY OR ALL THE OTHER CODE IN CONNECTION WITH THE SOFTWARE, INCLUDING (WITHOUT LIMITATION) ANY WARRANTIES OF SATISFACTORY QUALITY OR FITNESS FOR A PARTICULAR PURPOSE.
NO THIRD PARTY LICENSORS OF OTHER CODE SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND WHETHER MADE UNDER CONTRACT, TORT OR OTHER LEGAL THEORY, ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE OTHER CODE OR THE EXERCISE OF ANY RIGHTS GRANTED UNDER EITHER OR BOTH THIS LICENSE AND THE LEGAL TERMS APPLICABLE TO ANY SEPARATE FILES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
Contents
NOTICE….. ....................................................................................................... 2
COPYRIGHTS .................................................................................................. 2
COMPUTER SOFTWARE COPYRIGHTS ....................................................... 2
USAGE AND DISCLOSURE RESTRICTIONS ................................................ 3
CONTENTS ...................................................................................................... 4
1. INTRODUCTION ............................................................................ 7
Scope ............................................................................................. 7
Audience ........................................................................................ 7
Contact Information and Support ................................................... 7
Text Convention ............................................................................. 8
Related Documents ........................................................................ 9
2. HARDWARE AND SOFTWARE COMPONENTS ....................... 10
Hardware Components ................................................................ 10
Linux Host .................................................................................... 11
WE866C3 Modules ...................................................................... 11
SDIO Interconnect ........................................................................ 11
Software Components .................................................................. 11
Linux Application .......................................................................... 12
2.2.1.1. WPA Supplicant ............................................................................ 12
2.2.1.2. WPA CLI ....................................................................................... 12
2.2.1.3. Hostapd ........................................................................................ 12
2.2.1.4. Hostapd CLI .................................................................................. 12
2.2.1.5. UserApp ........................................................................................ 12
Telit Wi-Fi NIC Applications .......................................................... 12
2.2.2.1. WE866C3 Wi-Fi Driver ................................................................. 12
2.2.2.2. WE866C3 Firmware ..................................................................... 12
Software Package ........................................................................ 13
3. REFERENCE PLATFORM .......................................................... 14
X86 PC Host Platform .................................................................. 14
Arm Cortex A9 Embedded Platform ............................................. 14
4. BUILDING AND LOADING THE SOFTWARE ............................ 17
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
X86 PC Host Platform .................................................................. 17
ARM Cortex A9 Embedded Platform ............................................ 17
WE866C3 Linux Package ............................................................ 17
Building WE866C3 Driver ............................................................. 17
Loading the Driver Module ........................................................... 17
5. WIRELESS NETWORK OPERATIONS ...................................... 19
WE866C3 WLAN Interface Details ............................................... 19
STA Mode .................................................................................... 19
AP Mode ....................................................................................... 21
Concurrent Mode Operation ......................................................... 23
STA - AP Mode Concurrency ....................................................... 23
STA - P2P Mode Concurrency ..................................................... 24
P2P Mode ..................................................................................... 24
P2P Client Mode .......................................................................... 25
P2P GO Mode .............................................................................. 25
Throughput Measurement ............................................................ 26
UDP Throughput Test Procedure in Station Mode ....................... 26
TCP Throughput Test Procedure in Station Mode ....................... 27
APPENDIX A: DOWNLOADING, BUILDING, AND INSTALLING LINUX KERNEL ON
X86 UBUNTU ................................................................................................. 28
A.1 Test Setup Preparation ................................................................ 28
A.2 Installing Linux Kernel v4.9.11 ..................................................... 28
A.3 Building WE866C3 Driver for x86 Platform .................................. 30
APPENDIX B: BUILDING AND INSTALLING LINUX KERNEL AND DRIVER ON NXP
I.MX 6 EMBEDDED HOST ............................................................................. 31
B.1 Basic Requirements ..................................................................... 31
B.2 Building the Kernel for i.MX 6 Platform......................................... 31
B.3 Setting up the SD Card ................................................................ 33
B.4 Building WE866C3 Wi-Fi Linux Application for i.MX 6 on EVK
platform ........................................................................................ 34
6. DOCUMENT HISTORY ................................................................ 36
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
FIGURE LIST
Figure 1:- Software Components .................................................................................... 11
Figure 2:- i.MX 6SLL EVK Board .................................................................................... 14
Figure 3:- WE866C3 Board ............................................................................................. 15
Figure 4:- Jumper Position for 1.8v SDIO Signal ............................................................ 15
Figure 5:- Jumper Position for 3.3v SDIO Signal ............................................................ 16
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
1. INTRODUCTION
Scope
This user guide provides information required to install and evaluate Telit Wi-Fi NIC driver for Linux hosts with WE866C3 modules. It also provides guidelines to prepare the host platform and start testing the module using the Linux supplicant applications.
Audience
This document is intended for Telit customers, who are integrators and about to implement their applications using Telit Wi-Fi NIC module.
Contact Information and Support
For general contact, technical support services, technical questions and report documentation errors, contact Telit Technical Support at:
TS-SRD@telit.com
Alternatively, use:
http://www.telit.com/support
For detailed information about where you can buy the Telit modules or for recommendations on accessories and components visit:
http://www.telit.com
Our aim is to make this guide as helpful as possible. Keep us informed of your comments and suggestions for improvements.
Telit appreciates feedback from the users of our information.
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
Text Convention
Danger – This information MUST be followed or catastrophic equipment failure or bodily injury may occur.
Caution or Warning – Alerts the user to important points about integrating the module, if these points are not followed, the module and end user equipment may fail or malfunction.
Tip or Information – Provides advice and suggestions that may be useful when integrating the module.
All dates are in ISO 8601 format, i.e. YYYY-MM-DD.
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
Related Documents
Please refer to https://www.telit.com/m2m-iot-products/wifi-bluetooth-modules/ for current documentation and downloads.
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
2. HARDWARE AND SOFTWARE COMPONENTS
This chapter describes the components and procedures for building a wireless application with a Linux host and Telit WE866C3 Wi-Fi NIC module.
The Telit WE866C3 module provides IEEE802.11a/b/g/n/ac Wireless LAN functionalities. It integrates complete MAC, PHY and RF functionality on a single chip providing a low cost and an easy-to-use solution for adding wireless connectivity to applications.
WE866C3 modules integrate the required components like crystals, regulators, RF front end components to provide ready-to-use WLAN radio modules that can be used as NIC cards to provide network connectivity to hosts. These modules are regulatory, certified and calibrated for easy integration and building applications instantly without requiring any work on radio connectivity modules.
WE866C3 modules provide an external interface, i.e., SDIO port to interface it to a variety of hosts. The SDIO interface provides Ultra High Speed (SDR104) interconnection for faster communication with the host systems that are based on processors with 32-bit CPU and MMU which run on Linux operating systems. The Linux host runs the WLAN drivers, the network stack, the supplicant and authenticator 802.11 security applications to establish an 802.11 based Wireless LAN network using the WE866C3 module.
Standard Linux applications such as “wpa_supplicant” and “hostapd” are used for control path communications and standard Linux data path is used for data communications, and no custom software required.
Hardware Components
The following diagram illustrates the hardware components:
Figure :-Hardware Components
The description to the hardware components are as follows:
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
Linux Host
The Linux host can be any processor system that can run standard Linux software. It can be a high end X86 PC or an embedded platform like i.MX 6SLL. The host processor should be a 32-bit system running a 32-bit Linux operating system.
NOTE: Currently, WE866C3 driver is supported in 32-bit Linux environment
only.
WE866C3 Modules
WE866C3 modules acts as NIC card, providing IEEE802.11 a/b/g/n/ac MAC functionalities.
SDIO Interconnect
Software Components
The following diagram illustrates the software components being used. Telit Wi-Fi NIC host software is provided along with the package – which is required to be installed in a directory and built, for details refer to 4. Building and Loading the Software.
Figure 1:- Software Components
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
Linux Application
Standard Linux applications are used for network connection setup and management. Following are the standard Linux application:
2.2.1.1. WPA Supplicant
wpa_supplicant” is a WPA supplicant for Linux, BSD, Mac OS X, and Windows with WPA and WPA2 (IEEE 802.11i / RSN) support. It is suitable for both desktop/laptop computers and embedded systems. The supplicant is IEEE 802.1X/WPA component that is used in the client stations. It implements key negotiation with a WPA Authenticator, controls the roaming and IEEE 802.11 authentication/association of WLAN driver.
2.2.1.2. WPA CLI
wpa_cli is a text-based frontend program interacting with wpa_supplicant. It is used to get the status, change configuration, trigger events, and request interactive user input.
2.2.1.3. Hostapd
“hostapd” is a user space daemon for access point and authentication servers. It implements IEEE 802.11 access point management, IEEE 802.1X/WPA/WPA2/EAP Authenticators, RADIUS client, EAP server, and RADIUS authentication server.
2.2.1.4. Hostapd CLI
hostapd_cli utility is a text-based frontend program for interacting with hostapd.
2.2.1.5. UserApp
“UserApp” makes use of networking services to setup socket connections and perform data transfer.
Telit Wi-Fi NIC Applications
2.2.2.1. WE866C3 Wi-Fi Driver
WE866C3 Wi-Fi driver software package provided by Telit, is a kernel module which implements Wi-Fi driver for interfacing the Linux kernel network control and data path to the WE866C3 Wi-Fi device. It’s implemented as an IEEE802.11 Soft-MAC driver to establish communication between the Linux kernel and WE866C3 device. It contains SDIO driver adaptation layer for communication between Linux kernel and WE866C3 device over SDIO interconnect. It also performs queuing and flow control.
2.2.2.2. WE866C3 Firmware
WE866C3 firmware binaries are provided as part of the driver software package. These binaries should be placed at a certain location in the Linux host machine file system. These binaries will be accessed by the WE866C3 device to implement the IEEE 802.11 MAC functionality. It handles scan, association and data transfer functionality and implements other MAC features, PHY and RF functionalities etc.
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
Software Package
Following are the software package contents:
1. apps – This folder contains the supported application software files
2. build – This folder contains scripts and make files to compile the driver software
3. drivers – This folder contains driver source code files and make files a. patches – This folder contains required patch files to be used in the Linux host
system
b. firmware – This folder contains binary images needed to run the WE866C3
device
4. bsp – This folder contains the files that support the bringing up of the platform a. i.mx 6sll – This folder contains patch file for i.MX 6SLL EVK platform.
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
3. REFERENCE PLATFORM
This chapter describes the reference platform used to demonstrate the solution, the setup and applications used.
X86 PC Host Platform
“Lenovo Thinkpad T410i” laptop is used as the X86 PC host for testing the WE866C3
WLAN module. This host machine is booted with Ubuntu 16.04, 32-bit OS and the Linux kernel version 4.9.11.
Arm Cortex A9 Embedded Platform
Figure 2:- i.MX 6SLL EVK Board
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
Figure 3:- WE866C3 Board
The WE866C3 NIC card has an LED indicator and an antenna mount point to plug in the connector cables from the external antennas. It also has a jumper to select between 1.8v and 3.3v SDIO line signal operations, depending on the host platform with SDIO controller capabilities.
If the host SDIO controller is based on SD 2.0 protocol, then it supports only 3.3v I/O operation. So, the jumper should be put into 3.3v position.
If the host SDIO controller is based on SD 3.0 protocol, then it supports 1.8v I/O operation. The jumper should be put in the 1.8v position.
1.8v and 3.3v jumper positions are given in the following figure:
Figure 4:- Jumper Position for 1.8v SDIO Signal
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
Figure 5:- Jumper Position for 3.3v SDIO Signal
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
4. BUILDING AND LOADING THE SOFTWARE
This chapter provides the steps for building WE866C3 Linux drivers, loading and running them on a reference platform.
Telit WE866C3 Wi-Fi driver software package consists of folders such as apps, build, drivers etc. It generates the folder rootfste-p233.build after building the driver. WE866C3 driver is supported with the Linux kernel version 4.9.11. The Linux kernel 4.9.11 should be patched with the kernel patch files given in the driver software package.
X86 PC Host Platform
and Installing Linux Kernel on x86 Ubuntu.
ARM Cortex A9 Embedded Platform
i.MX 6SLL-EVK board must be booted with Linux kernel v4.9.11 built and with the required patches. The driver project should be cross-compiled for the i.MX 6SLL_EVK platform. For details refer to Appendix B: Building and Installing Linux Kernel and Driver on NXP
i.MX 6 Embedded Host
WE866C3 Linux Package
This step is common for all Linux host platforms.
1. Create a folder called “telit”.
mkdir ~/telit
2. Copy WE866C3.tar.gz package into this directory.
3. Unzip the package using following command.
tar xvf WE866C3.tar.gz
Building WE866C3 Driver
1. To build the driver, go to the build directory in the WE866C3 project.
cd WE866C3/build
2. To clean and build the driver, run the make command with clean option.
make clean
3. Run the make command to build the driver files.
make
When the build to the driver code is successful, the loadable kernel object file (wlan.ko) is generated and placed in the output directory
WE866C3/rootfs-te-p233.build/lib/modules
Loading the Driver Module
The required driver configuration files will be available in the directory – WE866C3/rootfs-
te-p233.build/lib/firmware/wlan/. These files should be copied to the location /lib/firmware/wlan in the host machine.
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
Before placing the driver object (wlan.ko) file, plug the WE866C3 Wi-Fi card in SDIO slot of the host machine.
1. Insert the WE866C3 kernel object(.ko) file into Linux kernel.
sudo insmod rootfs-te-p233.build/lib/modules/wlan.ko
2. WE866C3 Wi-Fi card will be listed as a wireless device with the names wlan0 & p2p0, in the network interface list.
ifconfig -a
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
5. WIRELESS NETWORK OPERATIONS
This chapter provides step by step procedure to setup wireless network connectivity and perform data transfer. Prepare the system (refer Chapter – 4 Building and Loading the
Software”) before configuring the WLAN interface.
Following are the steps to connect to the wireless network and test data transfer, once the WLAN interface is configured:
NOTE: Configuration instructions are only for reference and contain typical
example. For more details refer – Linux documentation.
WE866C3 WLAN Interface Details
If the driver is loaded correctly, WE866C3 device will be listed in the wireless interfaces present in the host system. WE866C3 module will register two wireless interfaces wlan0 & p2p0. This is verified using the following command:
Ifconfig
iw dev
The following command is used to check the features and commands supported by all devices:
iw phy
STA Mode
Telit WE866C3 module supports 802.11 b/g/n & a/ac modes in STA operations. STA mode supports connecting to both 2.4 GHz & 5GHz BSS networks.
Following are the steps required to configure and test wireless interface in station mode:
1. Configure DHCP a. Open configuration file and make sure DHCP is enabled.
vi /etc/network/interfaces
b. File should contain below two lines:
auto wlan0
iface wlan0 inet dhcp
2. Restart networking
/etc/init.d/networking restart
3. Create or update the configuration file. In STA mode, configuration file is common between the 802.11b/g/n or 802.11a/ac networks.
Typical configuration file contains the following references: a. Open Mode (for example sta_open_con.conf file)
ctrl_interface=/run/wpa_supplicant
update_config=1
network={
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
ssid="MY_AP_OPEN"
scan_ssid=1
key_mgmt=NONE
}
b. AES security (for example sta_aes_con.conf file)
ctrl_interface=/run/wpa_supplicant
update_config=1
network={
ssid="MY_AP_AES"
scan_ssid=1
key_mgmt=WPA-PSK
psk="TelitDemo123"
proto=RSN
pairwise=CCMP
group=CCMP
}
4. Terminate wpa_supplicant (if its running)
sudo killall wpa_supplicant
sudo rfkill unblock wifi
5. Start wpa_supplicant and initiate connection (use the required conf file) For example:
wpa_supplicant -B -i wlan0 nl80211 -c sta_open_con.conf
wpa_supplicant -B -i wlan0 nl80211 -c sta_aes_con.conf
6. Get IP address by running dhclient
dhclient wlan0
7. To check the IP address and status:
ifconfig wlan0
8. If needed disable power save feature
sudo iw dev wlan0 set power_save off
sudo iw dev wlan0 get power_save
9. If required start wpa_cli application
wpa_cli -i wlan0
10. Test data transfer using ping
ping <AP IP address>
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
AP Mode
Telit WE866C3 module supports 802.11 b/g/n and a/ac modes in AP operations. AP interface supports starting a BSS in 2.4 GHz & 5GHz network.
Following are the steps required to install, configure, and test wireless interface in AP mode:
1. Install the DHCP server.
sudo apt-get install isc-dhcp-server
2. Configure DHCP server
a. Open configuration file and make sure static configuration.
vi /etc/network/interfaces
b. File content:
auto wlan0
iface wlan0 inet static
address 10.0.0.1
netmask 255.255.255.0
gateway 10.0.0.1
c. Restart networking
/etc/init.d/networking restart
3. Open dhcp configuration file and modify if required
vi /etc/dhcp/dhcpd.conf
Sample configuration given below:
ddns-update-style none;
ignore client-updates;
authoritative;
option routers 10.0.0.1;
option subnet-mask 255.255.255.0;
option broadcast-address 10.0.0.255;
option domain-name-servers 10.0.0.1,8.8.8.8,8.8.4.4;
option time-offset 0;
default-lease-time 1209600;
max-lease-time 1814400;
subnet 10.0.0.0 netmask 255.255.255.0 {
range 10.0.0.3 10.0.0.13;
}
4. Start DHCP Server
sudo service isc-dhcp-server restart
or
sudo service isc-dhcp-server start
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
5. Start DHCP server and select the interface to start DHCP server. Open the file
“/etc/default/isc-dhcp-server” and write INTERFACES="wlan0"
6. Create or update the hostapd configuration file
Typical configuration file contains the following references:
a) 802.11 b/g/n mode AP with Open security (hostapd_open.conf)
interface=wlan0
driver=nl80211
ssid=Test_AP_OPEN
channel=11
hw_mode=g
ieee80211n=1
b) 802.11 b/g/n mode AP with AES security (hostapd_aes.conf)
interface=wlan0
driver=nl80211
ssid=Test_AP_AES
channel=11
hw_mode=g
ieee80211n=1
wpa=2
wpa_passphrase=TelitDemo123
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
c) 802.11 a/ac VHT=80 mode AP with AES security (hostapd_11ac_aes.conf)
interface=wlan0
driver=nl80211
ssid=Test_AP_AES
channel=161
hw_mode=a
ieee80211n=1
ieee80211ac=1
vht_capab=[HTC-VHT80]
vht_oper_chwidth=0
vht_oper_centr_freq_seg0_idx=161
wpa=2
wpa_passphrase=TelitDemo123
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
Note: In 802.11 a/ac mode the VHT parameters should be adjusted according to the requirement.
7. Terminate wpa_supplicant (if running)
sudo killall wpa_supplicant
sudo rfkill unblock wifi
8. Start hostapd (use the required conf file)
For example:
sudo hostpd -B -dd hostapd_open.conf
sudo hostpd -B -dd hostapd_aes.conf
9. Start CLI application to check the status.
sudo hostapd_cli
10. Connect a client to this AP and test data transfer using ping.
Concurrent Mode Operation
STA - AP Mode Concurrency
This feature is used to enable the STA and AP interfaces operating concurrently in the same channel.
1. Load the driver into the kernel and insert the WE866C3 Wi-Fi module into SDIO slot.
2. Setup a virtual interface for AP mode of operation.
iw dev wlan0 interface add ap0 type __ap
3. Start STA mode in WLAN0 interface and connect to the required AP.
sudo wpa_supplicant -B -i wlan0 -D nl80211 -c sta_aes_con.conf
4. Run dhclient application to get the IP address for the STA interface.
sudo dhlcient wlan0
5. Assign static address to the newly created AP interface ap0 and start DHCP server as shown in the section 5.3 AP Mode.
6. Before starting the AP interface, start the DHCP server using isc-dhcp-server application. Refer section 5.3 AP Mode.
7. AP interface can be started either using the wpa_supplicant or hostapd application. a. To start the AP interface using the hostapd application issue the command.
sudo hostapd -B -dd hostapd_open.conf
Note: The channel mentioned in hostapd config file should be same as the channel in which STA operates. b. To start the AP interface using the WPA supplicant application, suitable
configuration file is needed. For Example: concurrent_ap.conf
ctrl_interface=/run/wpa_supplicant
update_config=1
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
network={
ssid="Concurrent_AP"
mode=2
key_mgmt=NONE
}
Note: It is not required to mention the channel in AP configuration file. It follows the channel used by the STA.
wpa_supplicant -B -i ap0 -D nl80211 -c concurrent_ap.conf
8. STA and AP interface can be started using a single wpa_supplicant
wpa_supplicant -B -i ap0 -D nl80211 -c concurrent_ap.conf -N
-i wlan0 -D nl80211 -c sta_aes_con.conf
9. Run the DHCP server and assign IP to STA interface and test data transfer for both STA and AP interfaces.
STA - P2P Mode Concurrency
STA & P2P mode concurrent operation can be tested using the wpa_supplicant application.
1. Start STA mode in wlan0 interface and connect to the required AP. Refer section
5.2 STA Mode.
2. Start P2P functionality, in the p2p0 interface using the wpa_supplicant application. P2P mode supports both GO and client functionalities. Refer section 5.5 P2P Mode for the steps to configure the p2p0 interface.
P2P Mode
WE866C3 driver supports the P2P mode of operation. WE866C3 device registers a p2p0 physical interface which is used for P2P mode. P2P mode can be started as either P2P client or P2P Group Owner (GO) functionality. P2P mode can be tested using the wpa_supplicant application. Both P2P GO and P2P client functionalities can be achieved using the same configuration file.
Typical P2P configuration file will contain the following settings:
p2p_mode.conf
ctrl_interface=/var/run/wpa_supplicant
update_config=1
ap_scan=1
device_name=WE866C3-P2P-Linux
device_type=1-0050F204-1
config_methods=display keypad push_button
p2p_oper_reg_class=81
p2p_oper_channel=1
p2p_listen_reg_class=81
p2p_listen_channel=1
p2p_go_intent=15
persistent_reconnect=1
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
P2P Client Mode
In P2P client mode, the WE866C3 device is connected to a P2P device capable of running as GO. It can connect to an autonomous P2P GO device or it can connect to a normal P2P device, which will become GO during the connection process.
1. For client mode, write the GO intent to a lesser value in the config file
p2p_go_intent=1
2. Start the wpa_supplicant for the p2p interface using the above configuration file.
wpa_supplicant -B -D nl80211 -i p2p0 -c p2p_mode.conf
3. Start the wpa_cli to issue the p2p commands
wpa_cli -i p2p0
4. Scan the GO MAC address to connect
p2p_find
5. When the target GO details are listed in the find operation, stop find
p2p_stop_find
6. The MAC address of all the devices found will be listed using the command
p2p_peers
7. Connect the GO MAC address using the PIN method
p2p_connect <GO MAC addr> pin go_intent=1
This command generates the “PIN” number to be typed in the keypad of the GO device.
8. When the P2P connection is successful, then the command for the status of the device provides the new BSS
status
9. Get the IP address for the P2P client interface
dhclient p2p0
Once the IP address is received, check the data transfer with GO using the Ping test.
P2P GO Mode
WE866C3 module can start P2P GO mode in two ways:
The module can start as a GO autonomously and a client can connect to it.
During connection with another P2P device, WE866C3 can be assigned as P2P GO.
1. For P2P GO mode, write the GO intent value to a maximum value in config file
p2p_go_intent=15
2. Before starting the p2p0 interface in GO mode, assign static IP address for the p2p0 interface and start the isc-dhcp-server for the p2p interface. Refer section -
5.3 AP Mode.
3. Start the wpa_supplicant for the p2p interface using the above configuration file
wpa_supplicant -B -D nl80211 -i p2p0 -c p2p_mode.conf
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
4. Start the wpa_cli to issue the p2p commands
wpa_cli -i p2p0
5. Scan the GO MAC address to connect and issue command for time for scan completion
p2p_find 20
6. The MAC address of all the devices found will be listed using the command
p2p_peers
7. To start a persistent group
p2p_group_add persistent freq=2 ht40
freq=2 means 2.4 GHz network. freq=5 means 5GHz network.
8. If the autonomous GO is started successfully, then the P2P GO device will be in connected state. To check the status,
status
9. Scan from the p2p client device and issue the connect request to GO MAC address. In GO device issue the connect command to the client device address along with the PIN generated by the client address
p2p_connect <Client MAC address> “pin_value” go_intent=15
10. Run the dhclient in the P2P client device and check the data transfer between P2P GO and client devices.
Throughput Measurement
UDP Throughput Test Procedure in Station Mode
Bring up WE866C3 Wi-Fi NIC module (say STA#1) and connect to an AP
Connect one of the PC/Laptop (say STA#2) to the same AP through an ethernet
cable
Disable power save in STA#1
sudo iw dev wlan0 set power_save off
Start UDP server in STA#2
iperf -s -u
Ping STA#2 and make sure the link is up and ARP is resolved
Now issue the following command in STA#1
>iperf -u -c <IP address of STA#2> -t 60 -b 100m
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
TCP Throughput Test Procedure in Station Mode
Bring up WE866C3 Wi-Fi NIC module (say STA#1) and connect to an AP
Connect one of the PC/Laptop (say STA#2) to same AP through ethernet cable
Disable power save in WE866C3 Wi-Fi NIC
sudo iw dev wlan0 set power_save off
Start TCP server in Laptop.
iperf -s
Now issue the following command in STA#1
>iperf -c <IP address of STA#2> -t 60
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
APPENDIX A: DOWNLOADING, BUILDING, AND INSTALLING LINUX KERNEL ON X86 UBUNTU
This section provides step by step procedure to setup the host platform and install the Linux kernel v4.9.11 required to build and use the WE866C3 Wi-Fi driver package. A host X86 machine, is required to be installed with Linux OS 32-bit with kernel version 4.9.11. And, the kernel v4.9.11 should be patched with the patch files provided in the driver package.
A.1 Test Setup Preparation
Before building the kernel v4.9.11, the X86 host machine must be ready with the following packages installed:
sudo apt-get update
sudo apt-get install ncurses-dev
sudo apt-get install libssl-dev
sudo apt-get install libnl-3-dev
sudo apt-get install libnl-genl-3-dev
sudo apt-get install bison
sudo apt-get install flex
A.2 Installing Linux Kernel v4.9.11
1. Before downloading the kernel, set the git credentials which will be used while patching the kernel
git config --global user.name “name” git config --global user.email “name@mail.com”
2. Download the latest stable Linux kernel from the kernel tree
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux­stable.git
3. Enter the Linux kernel directory
cd linux-stable
4. Get the copy of kernel version 4.9.11 into your directory
git checkout v4.9.11
5. Apply the required patches to the downloaded kernel code
git am WE866C3/drivers/patches/te-p233/v4.9.11/*.patch
6. Configure Linux Kernel by issuing the below command and enable the required settings
make menuconfig
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
NOTE: By default, "make menuconfig" command reads the configuration file
used by the current booted kernel and uses it to create the new configuration (.config) file.
User is requested to enable the platform specific drivers and configurations, that are needed for the host system functionalities.
Enable the following settings in the kernel:
CFG80211 – To enable Wireless configuration APIs CONFIG_NL80211_TESTMODE=y – To support commands in test mode MMC - To enable MMC/SD/SDIO card support MMC_DEBUG – To enable MMC debugging (If debugging is required) CFG80211_INTERNAL_REGDB – To use the statically compiled
regulatory rule data base
7. Build and install the Linux kernel with the required modules
make -j8
make modules
make modules_install
make headers_install
make install
8. After installation, reboot the host to boot with kernel v4.9.11. If the newly built kernel v4.9.11 is not the latest in the host machine (i.e., the host machine is already running with a kernel version higher than v4.9.11), then while rebooting hold the SHIFT key to enter inside GRUB and select the desired kernel v4.9.11. After rebooting, check the current kernel version using the below command.
uname -a
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
A.3 Building WE866C3 Driver for x86 Platform
Refer Chapter - 4 Building and Loading the Software - for the procedure to build project files.
When the driver project is built, the binaries and configuration will be available in the folder WE866C3/rootfs-te-p233.build/. These binaries and configuration files should be copied to the required locations in the kernel.
1. The binary files should be copied to the location /lib/firmware in the Linux kernel file system of the host machine.
sudo cp -rf ~/WE866C3/rootfs-te­p233.build/lib/firmware/WLAN-firmware/* /lib/firmware/
2. The configuration files should be copied to the location /lib/firmware/wlan in the Linux kernel file system. Create a folder named “wlan” in the target location, if there is no folder.
sudo mkdir /lib/firmware/wlan/
sudo cp -rf ~/WE866C3/rootfs-te­p233.build/lib/firmware/wlan/* /lib/firmware/wlan/
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
APPENDIX B: BUILDING AND INSTALLING LINUX KERNEL AND DRIVER ON NXP I.MX 6 EMBEDDED HOST
i.MX 6 SLL-EVK board is used as the embedded Linux host platform, to test the Telit Wi­Fi module WE866C3. This section provides the steps to bring up the host machine with the kernel v4.9.11 and install the WE866C3 driver for the i.MX 6 SLL-EVK platform.
B.1 Basic Requirements
1. Laptop or a desktop running a recent release of Debian, Fedora or Ubuntu; without OS virtualization software.
2. ARM Cross Compiler Linaro toolchain binaries: http://www.linaro.org/downloads/
3. Bootloader Das U-Boot – the Universal Boot Loader: http://www.denx.de/wiki/U-Boot Source: http://git.denx.de/?p=u-boot.git;a=summary
4. Linux Kernel – imx_4.9.11_1.0.0_ga from Freescale
5. ARM based rootfs a. Debian: https://www.debian.org b. Ubuntu: http://www.ubuntu.com
B.2 Building the Kernel for i.MX 6 Platform
1. Create a directory “mcimx6sll -evk” and consider this as the build directory
mkdir ~/mcimx6sll-evk
cd ~/mcimx6sll-evk
2. Create directory boot, kernel_modules which would hold the final images and info
mkdir ~/mcimx6sll-evk/boot
mkdir ~/mcimx6sll-evk/kernel_modules
3. Download the pre-built Linaro GCC compiler for cross compilation
wget -c --no-check-certificate https://releases.linaro.org/components/toolchain/binaries/6.4-
2017.11/arm-linux-gnueabihf/gcc-linaro-6.4.1-2017.11-i686_arm­linux-gnueabihf.tar.xz
tar xf gcc-linaro-6.4.1-2017.11-i686_arm-linux-gnueabihf.tar.xz
4. Download the ARM based rootfs
wget -c https://rcn-ee.com/rootfs/eewiki/minfs/ubuntu-
16.04.3-minimal-armhf-2017-12-09.tar.xz
tar xf ubuntu-16.04.3-minimal-armhf-2017-12-09.tar.xz
5. Download the Linux source code from Freescale server (Branch -imx_4.9.11_1.0.0_ga)
git clone -b imx_4.9.11_1.0.0_ga --single-branch git://git.freescale.com/imx/linux-imx.git
6. Download the u-boot - the Universal Boot Loader
wget -c ftp://ftp.denx.de/pub/u-boot/u-boot-2018.01.tar.bz2
tar xf u-boot-2018.01.tar.bz2
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
7. Apply the patch to u-boot,
cd ~/mcimx6sll-evk/WE866C3/bsp/imx6sll
cp mcimx6sll-evk-fixes.patch ~/mcimx6sll-evk/u-boot-2018.01
cd ~/mcimx6sll-evk/u-boot-2018.01
patch -p1 < mcimx6sll-evk-fixes.patch
8. Set the environment variable with following command:
export ARCH=arm
export CROSS_COMPILE=~/mcimx6sll-evk/gcc-linaro-6.4.1-
2017.11-i686_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
9. Configure and build the u-boot. The image “u-boot-dtb.imx” should be ready
make mx6sllevk_defconfig
make -j4
10. Navigate to the Linux kernel source code directory using command:
cd ~/mcimx6sll-evk/linux-imx
11. Patch the files to avoid kernel build errors.
patch -p1 < ~/mcimx6sll-evk/WE866C3/bsp/imx6sll/v4.9.11/wl_cfg80211.patch
12. Patch the kernel using the patches given along with the WE866C3 package
git am ~/mcimx6sll-evk/WEX866C3/drivers/patches/te-p233/v4.9.11/*.patch
13. Make the default config for i.mx series devices
make imx_v7_defconfig
14. Modify the kernel configuration for any required changes
make menuconfig
Enable the following settings in the kernel: CFG80211 – To enable Wireless configuration APIs CONFIG_NL80211_TESTMODE=y – To support commands in test mode MMC - To enable MMC/SD/SDIO card support MMC_DEBUG – To enable MMC debugging (If debugging is required) CFG80211_INTERNAL_REGDB – To use the statically compiled regulatory rule
data base Device drivers-> Network device Support-> Wireless LAN-> Intersil deives->
IEEE 802.11 for Host AP
15. Install “lzop” before building the kernel
sudo apt-get install lzop
16. Build the kernel image. This step may take long time
make bzImage
17. Copy the image into the boot directory
cp arch/arm/boot/zImage ~/mcimx6sll-evk/boot/zImage
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
18. Build the dtb files
make dtbs
19. Build the modules and copy it to the “kernel_modules” directory
make modules
make modules_install INSTALL_MOD_PATH=~/mcimx6sll-evk/kernel_modules
20. Create an environment variable using the folder name "4.X.Y-Z" exactly as
shown in the folder ~/mcimx6sll-evk/kernel_modules/lib/modules/”.
export kernel_version=4.X.Y-Z
B.3 Setting up the SD Card
Insert the SD card into the laptop
1. Assume “DISK=/dev/mmcblk0, lsblk is used for determining the device id.
export DISK=/dev/mmcblk0
2. To erase the partition table/labels on microSD card, execute the following command:
sudo dd if=/dev/zero of=${DISK} bs=1M count=50
Now remove and re-insert the MMC card.
3. Install the bootloader
sudo dd if=~/mcimx6sll-evk/u-boot-2018.01/u-boot-dtb.imx of=${DISK} seek=2 bs=512
4. Create Partition Layout util-linux v2.26, sfdisk is rewritten and is based on libfdisk.
sudo sfdisk -version
If sfdisk >= 2.26.x
sudo sfdisk ${DISK} <<-__EOF__
1M,,L,*
__EOF__
If sfdisk <= 2.25.x
sudo sfdisk –UNIT M ${DISK} <<-__EOF__
1,,L,*
__EOF__
5. Format Partition
sudo mkfs.ext4 -V
for: DISK=/dev/mmcblk0
sudo mkfs.ext4 -L rootfs ${DISK}p1
for: DISK=/dev/sdX
sudo mkfs.ext4 -L rootfs ${DISK}1
6. Mount Partition
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
Most systems have the partitions auto mounted.
sudo mkdir -p /media/rootfs/
for: DISK=/dev/mmcblk0
sudo mount ${DISK}p1 /media/rootfs/
for: DISK=/dev/sdX
sudo mount ${DISK}1 /media/rootfs/
7. Copy the root file system
sudo tar xfvp ~/mcimx6sll-evk/ubuntu-16.04.3-minimal-armhf­2017-12-09/armhf-rootfs-ubuntu-xenial.tar -C /media/rootfs
sudo chown root:root /media/rootfs/
sudo chmod 755 /media/rootfs/
8. Set uname_r in /boot/uEnv.txt
sudo sh -c "echo 'uname_r=${kernel_version}' >> /media/rootfs/boot/uEnv.txt"
9. Copy the kernel image
sudo cp -v ~/mcimx6sll-evk/boot/zImage /media/rootfs/boot/vmlinuz-${kernel_version}
10. Copy the device tree binaries
sudo mkdir -p /media/rootfs/boot/dtbs/${kernel_version}/
sudo cp -v ~/mcimx6sll-evk/linux­imx/arch/arm/boot/dts/imx6sll*.dtb /media/rootfs/boot/dtbs/${kernel_version}/
11. Copy the kernel modules
sudo cp -rv ~/mcimx6sll-evk/kernel_modules/lib/ /media/rootfs/
12. Create static information about filesystem
sudo sh -c "echo '/dev/mmcblk1p1 / auto errors=remount-ro 0 1' >> /media/rootfs/etc/fstab"
13. Unmount the SD card
sync
sudo umount /media/rootfs
B.4 Building WE866C3 Wi-Fi Linux Application for i.MX 6 on EVK platform
To cross-compile the driver code for the i.MX 6SLL-EVK host, following changes are to be done in the driver files.
Consider the path ~/mcimx6sll-evk/WE866C3/“is the location where the driver project is cross-compiled for the i.MX 6 platform.
1. Edit the driver configuration file “config.te-p233”, available in the folder WE866C3/build/scripts/te-p233/config.te-p233 as given below: a. Assign the kernel path variable to the location where the Linux kernel v4.9.11
is cross-compiled for i.MX 6SLL-EVK board
export KERNELPATH=~/mcimx6sll-evk/linux-imx/
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
b. Assign the kernel architecture variable with ARM
export KERNELARCH=arm
c. Assign the tool prefix variable with the path name, in which “Linaro” cross-
compile tool chain is located.
export TOOLPREFIX=~/mcimx6sll-evk/gcc-linaro-6.4.1-
2017.11-i686_arm-linux- gnueabihf/bin/arm-linux-gnueabi-
2. Edit the Make file in the folder “WE866C3/driver/qcacld-new/” as below: a. Assign the kernel source variable with the path location in which the kernel
code is placed.
export KERNEL_SRC ?= ~/mcimx6sll-evk/linux-imx/
Refer Chapter - 4. Building and Loading the Software - for the procedure to build the driver project files.
When the driver project is built, the binaries and configuration is available in the folder WE866C3/rootfs-te-p233.build/. These binaries and configuration should be copied to the Linux files system expanded in the i. MX 6 host SD card.
the SD card.
sudo cp -rf ~/mcimx6sll-evk/WE866C3/rootf-te-p233.
build/ /media/rootfs/home/ubuntu/
2. Copy the binaries to the location /lib/firmware in the Linux kernel file system
mounted on the SD card.
sudo cp -rf ~/mximx6sll-evk/WE866C3/rootfs-te­p233.build/lib/firmware/WLAN-firmware/* /media/rootfs/lib/firmware/
3. Copy the configuration files to the location /lib/firmware/wlan/ in the Linux kernel
file system. Create a folder named “wlan” in the target location, if there is no folder.
sudo mkdir /media/rootfs/lib/firmware/wlan/
sudo cp -rf ~/mcimx6sll-evk/WE866C3/rootfs-te­p233.build/lib/firmware/wlan/* /media/rootfs/lib/firmware/wlan/
WE866C3 Wi-Fi Network Interface Card (NIC) User Guide
6. DOCUMENT HISTORY
Revision
Date
Changes
0.0
2018-06-21
First issue
1.0
2018-07-09
Updated section: B.2 Building the Kernel for i.MX 6 Platform
5.3 AP Mode
Loading...