Throughput

The throughput example (located in the Adafruit_WICED_Arduino/examples/WiFi folder) uses AdafruitTCP to test the TCP throughput between the WICED Feather and another device running 'netcat', which simply listens for incoming TCP data on the specified port.

Setup

Set your AP details using the WLAN_SSID and WLAN_PASS flags, setting them to the values used by you own access point:

Download: file
#define WLAN_SSID             "YOUR SSID HERE"
#define WLAN_PASS             "YOUR SSID KEY HERE"

You also need to set the IP address and port of the server you will be connecting to (the machine where you will be running netcat):

Download: file
// your local PC's IP to test the throughput
// Run this command to create a server on your PC
// > nc -l 8888

IPAddress server_ip(10, 0, 1, 27);
const uint16_t port = 8888;

Running Netcat

Before using this sketch you will need to start netcat and tell it to start listening on the pre-determined port, which can be done with the following command:

Download: file
$ nc -l 8888

Depending on the version of netcat you are using, you may or may not seeing any feedback right away, but once netcat starts any incoming characters received will be echoed back to the command line, as shown in the example below:

Download: file
000000000000000000000000000000000000000000000000
111111111111111111111111111111111111111111111111
222222222222222222222222222222222222222222222222
333333333333333333333333333333333333333333333333
444444444444444444444444444444444444444444444444
555555555555555555555555555555555555555555555555
666666666666666666666666666666666666666666666666
777777777777777777777777777777777777777777777777
888888888888888888888888888888888888888888888888
999999999999999999999999999999999999999999999999

To stop netcat (once the test is complete) simply hit CTRL+C.

Compile and Flash

You can then compile and flash your sketch to the WICED Feather using the 'Download' arrow icon at the top of the IDE:

You should see the USB DFU progress as the update advances, and there will be a 'Done Uploading' message in the top left of the status bar when you are done:

Testing the Sketch

Wait a few seconds for the USB CDC serial interface to enumerate, and then open the Serial Monitor using either the Serial Monitor icon in the upper-right of the IDE or via Tools > Serial Monitor:

This will cause the WICED Feather to attempt to connect to the access point, and then it will attempt to connect to the netcat TCP Server:

At this point go to the top of the serial monitor and enter any character into the text box at the top and click the SEND button to start sending 1MB of data to netcat:

This will start the throughput test, which will display the calculated KB per second from the transfer:

This guide was first published on Mar 23, 2016. It was last updated on Mar 23, 2016. This page (Throughput) was last updated on Mar 31, 2016.