Introduction
In this lab, we will use the Network Terminal example in the SimpleLink™ Wi-Fi® CC32xx Software Development Kit as a tool to learn the flow of a basic Wi-Fi application before we dig into the code. The Network Terminal example demonstrates the various range of networking capabilities which the SimpleLink Wi-Fi CC32xx/CC31xx device family provides.
The purpose of this lab is to familiarize users with Wi-Fi and tools such as Code Composer Studio, by importing existing examples into the IDE and utilizing the debugger. The lab contains several tasks:
Task 1: Building and loading the Network terminal example
Task 2: Get familiar with the Network Terminal commands
Task 3: Use commands to demonstrate basic Wi-Fi applications
Prerequisites
Software
- Code Composer Studio v10.3 or newer
- SimpleLink Wi-Fi CC32xx Wireless MCUs support installed
- Make sure that CCS is using the latest updates: Help → Check for Updates
- CC32xx SDK v5.20 or newer OR
- SimpleLink SDK Wi-Fi Plugin v4.20 (if you are using a CC31xx BoosterPack)
- Terminal emulator program such as TeraTerm or PuTTY
Hardware
- 2x CC32xx LaunchPads
- CC3235S LaunchPad (LAUNCHXL-CC3235S)
- CC3235SF LaunchPad (LAUNCHXL-CC3235SF)
- CC3220S LaunchPad (CC3220S-LAUNCHXL)
- CC3220SF LaunchPad (CC3220SF-LAUNCHXL)
- 2x Micro-USB cable (included with LaunchPad)
- 802.11b/g/n Wireless Access Point (AP)
Instead of using a CC32xx LaunchPad, the following hardware can also be used:
- 2x CC31xx BoosterPacks (BOOSTXL-CC3135 or CC3120-BOOST)
- 2x LaunchPads of supported host devices including any combination of the following:
- MSP432P401R LaunchPad (MSP-EXP432P401R)
- MSP432P4111 LaunchPad (MSP-MSP432P4111)
- MSP432E401Y LaunchPad (MSP-MSP432E401Y)
- CC26X2R1 LaunchPad ([LAUNCHXL-CC26X2R1](https://www.ti.com/tool/LAUNCHXL-CC26X2R
Note
Some exercises in this lab require two SimpleLink Wi-Fi LaunchPads or BoosterPacks. A subset can be completed with one LP/BP.
Task 1: Building and loading the Network Terminal example
CC31xx Hardware Setup
If you are setting up a CC31xx BoosterPack for the first time, see the Out of Box Experience for the CC3135 or CC3120.
In CCS, open the TI Resource Explorer (View → Resource Explorer)
Follow the steps below to import the
network_terminal
example depending on which device you are using.- Be sure you select your desired project "flavor" (CC3235S-LAUNCHXL, MSP_EXP432P401R, TI-RTOS, Free-RTOS, CCS, GCC, etc.).
The image below shows the CC3220 TI-RTOS CCS example for this lab:
network_terminal_CC3220SF_LAUNCHXL_tirtos_ccs
Expand the folders under the SimpleLink CC32xx SDK as shown to select the
network_terminal
example, then click the Import to IDE icon at the top-rightExpand the folders under the SimpleLink SDK Wi-Fi Plugin as shown to select the
network_terminal
example, then click the Import to IDE icon at the top-right
Build the project by selecting Build Project from the Project menu or right-clicking the name of the project. It may take a couple minutes to build.
You'll need two devices for some of the lab exercises, so you will want to flash the Network Terminal application to two LaunchPads. (If you only have one LaunchPad, you can read through the first two exercises and then skip to exercise 3.)
We will be using the SysConfig ImageCreator tool to flash the application. Plug in one LaunchPad, build the project, then select the Flash button from the top menu. Once it is complete, plug in the second LaunchPad, rebuild the project, and select the Flash button again.
Why do we have to rebuild the project? The SysConfig ImageCreator tool auto-detects the MAC address of the LaunchPad in order to create a development image for that device. To learn more about development images, check out the Device Overview in the Out of Box Experience.
Load the application to your first host MCU LaunchPad in CCS by clicking the green bug in the top menu. Once it is complete, you can unplug the first LaunchPad and repeat with the second LaunchPad.
Open a UART terminal for each LaunchPad on your device's COM port. We want to use the XDS110 Class Application/User UART port with the following parameters:
UART Configuration
Baud rate: 115200
Data: 8 bit
Parity: None
Stop: 1 bit
Flow control: None
Task 2: Get familiar with the Network Terminal commands
For simplicity, we divide the application's functionality into four different silos. Each silo contains several commands accessible by the user via command line interface.
Silo | Description |
---|---|
WLAN | Contains link layer functions like scan, connect, etc. |
Socket | Shows variety of socket API and responsible for sending and receiving data. |
NetApp | Demonstrates the usage of networking applications. |
Transceiver | Gives the user a direct interface to the NWP radio for RF tests, raw sockets (L1) and more. |
Available commands
You can type help
into the terminal at any time to see a complete list of
available commands.
WLAN commands
scan
: Retrieves scan results from network processor’s (NWP) scan cachesetpolicy
: Defines the device’s scan behavior and starts background scanswlanconnect
: Connects device to an APwlandisconnect
: Disconnect from APwlan_ap_start
: Configures the device to operate in AP modewlan_ap_stop
: Set device in Station modecreatefilter
: Creates an RX filter. RX filters are a set of rules and actions imposed on each packet received from the airenablefilter
: Enables all defined filtersdisablefilter
: Disables all defined filtersdeletefilter
: Deletes all defined filtersenablewowlan
: Defines a pattern-based filter, then sends host MCU to Low Power Deep Sleep (LPDS). Once the pattern filter triggers, the NWP would wake the host MCU from LPDS using host IRQ as a wake up source.p2pstart
: Sets the NWP in discoverable Peer to Peer mode and connects to another visible P2P device
Socket commands
send
: Demonstrates opening a TCP or UDP socket, sending data in packets, and closing socketrecv
: Demonstrates opening a listening socket, receiving data in packets, and closing socket
NetApp commands
ping
: Pings specific host name or IP, and prints statistics to terminalmdnsadvertise
: Advertises a service over mDNSmdnsquery
: Runs mDNS query for services over local LAN
Transceiver commands
radiotool
: Starts the Radio Tool. This allows users to run several radio-related tests for RX and TX operations
Learn more about the commands
You can learn more about any command and see an example of usage by typing [command] -help
into the terminal or see the network_terminal
README.
Task 3: Use commands to demonstrate basic Wi-Fi applications
In these exercises, you can grab a partner or flash the same application to both LaunchPads. We will refer to the partners or devices as User 1 and 2.
Backspaces
This terminal application does not support backspaces. If you mistype a command, you will have to retry it.
Exercise 1
User 1: Set up your device as an open Access Point. Once a Station connects
and pings you, send a number of packets to the station and wait for them to be received by the Station.
Once the Station has completed and disconnected, set the device to Station mode.
User 2: You are acting as a Station. Scan for an AP, and connect to
User 1's AP. Ping the AP, then listen for incoming packets. Once completed, disconnect from the AP.
Hint: When communicating using sockets, the server must be set up
before the client.
User 1: wlan_ap_start -s "demoAP" -t OPEN
User 2: scan -n 20
User 2: wlanconnect -s "demoAP" -t OPEN
User 2: ping -h <server IP address>
User 1: send -s -p 5001
User 2: recv -c <server IP address> -p 5001
User 2: wlandisconnect
User 1: wlan_ap_stop
Congratulations! You just set up your first Wi-Fi Access Point and communicated with a Station.
Exercise 2
Try the same exercise as above, but make User 1's AP a secured network!
User 1: wlan_ap_start -s "demoAP" -t WPA/WPA2 -p "password"
User 2: scan -n 20
User 2: wlanconnect -s "demoAP" -t WPA/WPA2 -p "password"
User 2: ping -h <server IP address>
User 1: send -s -p 5001
User 2: recv -c <server IP address> -p 5001
User 2: wlandisconnect
User 1: wlan_ap_stop
Exercise 3
As a station, connect to an AP with internet access (a hotspot or router, for example). Ping a popular website, such as google.com or ti.com. Send 5 Echo-request packets with a 2 second delay interval.
scan -n 20
wlanconnect -s "demoAP" -t WPA/WPA2 -p "password"
ping -h www.ti.com -c 5 -i 2
wlandisconnect
Use your own AP's SSID and password in the wlanconnect command
Exercise 4
Start the Radio tool by calling the radiotool
command and run the RX task on
any channel. RX testing is used for gathering Wi-Fi statistics for a specified channel.
Take a look at the RX statistics breaking down the traffic the SimpleLink device sees broadcasting on the specific channel (example below). This traffic comes from broadcasting Wi-Fi networks in the area. The RSSI (Received Signal Strength Indicator) histogram shows the power present in a received radio signal, and the rate histogram shows the data rate in Mbps.
For more details on the radio tool in this example, see the network_terminal
README.
*********************************Rx Statistics**********************************
Received Packets: 20266
Average RSSI for management: -74 Average RSSI for other packets: -83
----------------------- RSSI Histogram -----------------------
-40dBm to -87dBm (below and above RSSI will appear in the first and last cells)
10 20 30 40 50 60 70 80 90 100
|----+----+----+----+----+----+----+----+----+----|
-40dBm (0.06%)
|----+----+----+----+----+----+----+----+----+----|
-49dBm (1.59%)
|----+----+----+----+----+----+----+----+----+----|
-58dBm (0.52%)
|----+----+----+----+----+----+----+----+----+----|
-68dBm*************** (30.60%)
|----+----+----+----+----+----+----+----+----+----|
-77dBm*********************** (46.09%)
|----+----+----+----+----+----+----+----+----+----|
-87dBm********** (21.14%)
|----+----+----+----+----+----+----+----+----+----|
10 20 30 40 50 60 70 80 90 100
----------------------- Rate Histogram -----------------------
10 20 30 40 50 60 70 80 90 100
|----+----+----+----+----+----+----+----+----+----|
0 * (3.09%)
|----+----+----+----+----+----+----+----+----+----|
1 (0.03%)
|----+----+----+----+----+----+----+----+----+----|
2 (0.03%)
|----+----+----+----+----+----+----+----+----+----|
3 (0.03%)
|----+----+----+----+----+----+----+----+----+----|
4 ********************************************** (93.70%)
|----+----+----+----+----+----+----+----+----+----|
5 (0.86%)
|----+----+----+----+----+----+----+----+----+----|
6 (0.03%)
|----+----+----+----+----+----+----+----+----+----|
7 (0.06%)
|----+----+----+----+----+----+----+----+----+----|
8 * (2.13%)
|----+----+----+----+----+----+----+----+----+----|
9 (0.00%)
|----+----+----+----+----+----+----+----+----+----|
10 (0.00%)
|----+----+----+----+----+----+----+----+----+----|
11 (0.00%)
|----+----+----+----+----+----+----+----+----+----|
12 (0.04%)
|----+----+----+----+----+----+----+----+----+----|
13 (0.00%)
|----+----+----+----+----+----+----+----+----+----|
14 (0.00%)
|----+----+----+----+----+----+----+----+----+----|
15 (0.00%)
|----+----+----+----+----+----+----+----+----+----|
16 (0.00%)
|----+----+----+----+----+----+----+----+----+----|
17 (0.00%)
|----+----+----+----+----+----+----+----+----+----|
18 (0.00%)
|----+----+----+----+----+----+----+----+----+----|
19 (0.00%)
|----+----+----+----+----+----+----+----+----+----|
10 20 30 40 50 60 70 80 90 100
The data was sampled during 97337mSec
*******************************End Rx Statistics********************************
Technical support
For any questions you might have, please search on the TI SimpleLink Wi-Fi E2E Forum.
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.