Minimal throughput tests over Wi-Fi STA: HTTP download (no TLS) and raw TCP upload.
Download measures only the HTTP body (after \r\n\r\n). Upload sends a fixed pattern and times the send path.
- Initializes Wi-Fi in STA mode and connects to your AP with power-save disabled (
WIFI_PS_NONE). - Download path: connect to
DL_HOST:DL_PORT, sendGET DL_PATH HTTP/1.1, start timing on the first body byte, read until EOF/limit, log bytes, seconds, Mbit/s. - Upload path: connect to
UL_HOST:UL_PORT, sendUL_TOTAL_BYTESof 0xA5 payload in chunks,shutdown(SHUT_WR), log bytes, seconds, Mbit/s.
#define DL_HOST "ADD_HOST_IP"
#define DL_PORT 8080
#define DL_PATH "/1MB.bin"
#define DL_LIMIT_BYTES 0
#define UL_HOST "ADD_UPLOAD_SINK_IP"
#define UL_PORT 5001
#define UL_TOTAL_BYTES (8*1024*1024)
#define WIFI_SSID "ADD_AP_SSID"
#define WIFI_PASS "ADD_AP_PASS"- ESP-IDF (v5.x recommended)
- Python 3 (for the HTTP server and TCP sink)
- A Wi-Fi AP your ESP32 can join
download/1MB.bin is already provided. To recreate it (PowerShell):
fsutil file createnew 1MB.bin 1048576- Download (HTTP) server - from the
download/folder containing1MB.bin:
python -m http.server 8080- Upload (TCP) sink - in a separate terminal, from
upload/:
cd upload
python tcp_sink.pyRun idf.py -p <PORT> flash monitor (or your preferred monitor command).
Example output:
