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.
Portable Wireless Gateway
THIS PAGE IS UNDER CONSTRUCTION
Overview[edit]
WiLink 8 can be configured to 2 different Roles (STA & AP) simultaneously to connect directly with other WiFi Devices on different RF Channel (WiFi networks). We call this Multirole.
Goal[edit]
The goal of this demo is to let your mobile device be connected to the WL8 platform, which is connected to an AP with internet access, in order to get internet access. Additionally to measure throughput in multirole it will show how to use iperf to measure throughput from the mobile device through to an iperf server running on a device connected to the AP with internet access.
Features in this demo[edit]
- WiFi MIMO connectivity
- Multi-role operation of Access point (AP) & Station on different channels (Multi-Role & Multi-Channel)
- Access Point with Multiple Stations
Prerequisites[edit]
Hardware[edit]
- 1x AM335x EVM platform with WL8 OR 1x BeagleboneBlack (BBB) with WL8 Cape
- 1x Access Point (AP) with internet access
- 1x Mobile device with WiFi connectivity
- 1x RS-232 console wire to access Terminal on the platform from PC. On BBB ssh over usb is also an option.
Software[edit]
- AM335x image from SDK8 for flashing into SD card (Please refer to WL8 release download page) for either EVM or BBB+cape or the Debian K3.8 image available here. If using Debian ensure that debian wpa_supplicant is disabled and that udhcpc is installed as described at the end of that page.
- PC Terminal software (Putty, TeraTerm, etc.)
Instruction[edit]
Pre-Work[edit]
Before proceeding to the next part, make sure you know:
- How to check if the WL8 required Linux modules are inserted.
- How to how to configure hostapd.conf to set your desired SSID, security, channel, etc.
- How to use ifconfig command to bring the wireless up & down
- How to use wpa_supplicant to configure preset network and security
Step 1: Configuration Files[edit]
Hostapd Configuration[edit]
Begin by configuring /etc/hostapd-mr.conf for AP mode, using wlan1 as the interface. This is the minimum set of parameters to create an 802.11n AP on channel 11 with SSID MultiRoleSSID and no security.
interface=wlan1 ssid=\"MultiRoleSSID\" channel=11 hw_mode=g ieee80211n=1
udhcpd Configuration[edit]
Next, configure the DHCP server through /etc/udhcpd-mr.conf. udhcpd will need to be set for the interface chosen in hostapd-mr.conf (ex: wlan1). Below is an example udhcpd-mr.conf:
# Sample udhcpd configuration file (/etc/udhcpd.conf) # The start and end of the IP lease block start 10.4.30.40 #default: 192.168.0.20 end 10.4.30.48 #default: 192.168.0.254 # The interface that udhcpd will use interface wlan1 #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 10.4.30.34 option lease 864000 # 10 days of
wpa_supplicant configuration[edit]
Configure wpa_supplicant. Below is an example wpa_supplicant_mr_demo.conf for this demo. This will connect using the default WPA-PSK2 security. Change password and SSID for actual AP being used
ctrl_interface=/var/run/wpa_supplicant network={ psk="myPassword" ssid="myAP" }
Step 2: Connection[edit]
Set WL18xx to operate as AP and Station[edit]
- Use iw to add wlan1 interface.<syntaxhighlight lang="bash">iw $(ls /sys/class/ieee80211/) interface add wlan1 type managed</syntaxhighlight>
- Configure IP of Default Gateway and run hostapd.<syntaxhighlight lang="bash">ifconfig wlan1 10.4.30.34 netmask 255.255.255.0 up </syntaxhighlight><syntaxhighlight lang="bash">hostapd /etc/hostapd-mr.conf &</syntaxhighlight>
- Add DHCP server and NAT capabilites to the AP.<syntaxhighlight lang="bash">udhcpd /etc/udhcpd.conf</syntaxhighlight><syntaxhighlight lang="bash">iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE</syntaxhighlight>
- Configure wlan0 as Station, run wpa_supplicant, and start the Station DHCP client.<syntaxhighlight lang="bash">ifconfig wlan0 up</syntaxhighlight><syntaxhighlight lang="bash">wpa_supplicant -d -Dnl80211 -c/etc/wpa_supplicant_mr_demo.conf -iwlan0 -B</syntaxhighlight>
- Bridge the two interfaces together<syntaxhighlight lang="bash">echo 1 > /proc/sys/net/ipv4/ip_forward</syntaxhighlight><syntaxhighlight lang="bash">udhcpc -i wlan0</syntaxhighlight>
Step 3: Mobile Device Connection[edit]
You may now use your mobile device to access internet via the AP you just created. Simply connect to the SSID (in this case, Multirole_Demo).
Running the Demo[edit]
Connecting to the Internet[edit]
In order to bring up the demo quickly, we're here to provide a simple script that packs all the commands into a single file. Simply download the multirole demo file to the build machine or to the target and extract it : <syntaxhighlight lang="bash"> $tar -zxvf multirole-demo-v1.tar.gz </syntaxhighlight>
This extracts a single script called multirole-demo.sh. When the script is run it will create in the root filesystem the required configuration scripts as well as the target run script. There are several places the script may need edited
- Use the variable FS in the script to point to the file system eg FS=/media/rootfs for an SD card mounted in the host or FS= if running on the target.
- If running a Debian file system the variable USER must be empty to reflect that logging in as root gives a home directory of /root.
- Change the SSID and password in wpa_supplicant_mr_demo.conf for the AP in use to access the Internet.
Then run the demo as follows
<syntaxhighlight lang="bash">
- start-mr.sh
</syntaxhighlight>
After the script runs the mobile device can be connected to the AP "MultiRoleSSID" and then browse using the internet connection.
Benchmarking the Multirole performance[edit]
The tool iperf can be used to benchmark the throughput achievable using WL18xx. The system used in shown in the diagram below.
In this case the "Internet AP" is allocating IP addresses in the subnet 192.168.0.100 and above. To run this demo on the linux PC run an iperf server to receive TCP traffic. <syntaxhighlight lang="bash"> $iperf -s </syntaxhighlight>
Ideally the Linux machine should be connected to the AP via Ethernet so that the AP does not need to split the wifi bandwidth between two links. This ensures that the WL18xx is the bottleneck in the link.
On the mobile device run an iperf application to connect to the server. Since we are using NAT and port forwarding in the Linux networking stack the phone does not need to understand how it is being routed to the Linux machine, it just needs to know its IP address. In the example the phone runs the iperf application with the following parameters
-c 192.168.0.101 -t 120 -i 10
This connects as a client (ie transmitter) to the server at 192.168.0.101 and transmits TCP traffic as fast as possible for 120 seconds and reports the throughput at an interval of 10 seconds.
For performance numbers, please refer to WL18xx Software Specification User Guide