esp-idf/examples/performance/README.md

45 lines
1.9 KiB
Markdown
Raw Normal View History

2017-03-23 04:36:32 -04:00
# Wifi Performance Examples
Some simple codes help to test the wifi performance.
Including TCP/UDP TX/RX throughput.
# tcp_perf
2017-04-10 08:39:04 -04:00
This example is used to test tcp throughput and delay time.
2017-03-23 04:36:32 -04:00
2017-04-10 08:39:04 -04:00
Step1: Set options in `make menuconfig` like ssid, password, server ip and server port. And choose what the esp32 will work as.
2017-03-23 04:36:32 -04:00
2017-04-10 08:39:04 -04:00
* AP or STA. You can set one esp32 as AP and another esp32 as STA with same ssid & password, also you can use Router or wifi adapter instead of one of these.
2017-03-23 04:36:32 -04:00
2017-04-10 08:39:04 -04:00
* Client or server. Make sure the client has correct server ip & port so they can get connected. It's okay if you create a tcp server & client using PC since one of the wifi device is't esp32.
2017-03-23 04:36:32 -04:00
2017-04-10 08:39:04 -04:00
* Send or receive. Set one of them sending data and the other receiving.
2017-03-23 04:36:32 -04:00
2017-04-10 08:39:04 -04:00
Step2: Exit menuconfig, saving the new settings. Then build the app and flash it to the ESP32.
2017-03-23 04:36:32 -04:00
2017-04-10 08:39:04 -04:00
Step3: Start test. And here are some things that might help you do the test easily.
2017-03-23 04:36:32 -04:00
* You'd better turn on the AP before the STA.
2017-04-10 08:39:04 -04:00
* The tcp server should be started before the tcp client.
* If you use a esp32 as AP, you'd better use it as tcp server also.
* Once the tcp connection crashed, esp32 should be restarted to re-establish TCP connection.
2017-03-23 04:36:32 -04:00
2017-04-10 08:39:04 -04:00
Step4: View the result. After connection established, TCP server and TCP client can send data to each other. The result of throughput will be printed in the serial log.
2017-03-23 04:36:32 -04:00
2017-04-10 08:39:04 -04:00
See [main.c](./tcp_perf/main/main.c) for full details.
2017-03-23 04:36:32 -04:00
# udp_perf
This example is similar to tcp_perf. Also the steps is similar to tcp_perf.
There's a obvious difference between udp_perf and tcp perf:
2017-04-10 08:39:04 -04:00
Before formal sending & receiving, a packet will be send from client to server. So the server can know the ip&port of client. It is usually eaiser to set the UDP server as the receiver.
2017-03-23 04:36:32 -04:00
2017-04-10 08:39:04 -04:00
See [main.c](./udp_perf/main/main.c) for full details.
2017-03-23 04:36:32 -04:00
# More
See the [README.md](../README.md) file in the upper level [examples](../) directory for more information about examples.