Code for ESP32
Go to file
Bob 1654753bbb Add RSSI and enhanced network info to WiFi connection logs
Show signal strength (RSSI in dBm) when connected to AP
Show gateway and netmask in addition to IP address
Useful for debugging WiFi connectivity in multi-device deployments
2025-11-09 21:01:11 +00:00
main Add RSSI and enhanced network info to WiFi connection logs 2025-11-09 21:01:11 +00:00
.gitignore Initial commit: ESP32 iperf implementation 2025-11-08 19:57:11 +00:00
CMakeLists.txt Initial commit: ESP32 iperf implementation 2025-11-08 19:57:11 +00:00
MASS_DEPLOY.md Add mass deployment system with static IP and WiFi configuration 2025-11-08 23:10:07 +00:00
PARALLEL_FLASH.md Add parallel mass flash script for 3-5x faster deployment 2025-11-08 23:23:09 +00:00
README.md Add support for ESP32-S2 and ESP32-S3 chips 2025-11-08 20:38:08 +00:00
detect_esp32.py Add mass deployment system with static IP and WiFi configuration 2025-11-08 23:10:07 +00:00
flash_all.py Add mass deployment system with static IP and WiFi configuration 2025-11-08 23:10:07 +00:00
flash_all_parallel.py Show chip type and port during build and flash operations 2025-11-09 20:56:40 +00:00

README.md

ESP32 iperf

Network performance testing tool for ESP32 based on iperf2.

Features

  • TCP and UDP client/server modes
  • Bandwidth measurement
  • Packet loss detection (UDP)
  • Console-based control interface
  • WiFi station mode support

Hardware Requirements

  • ESP32, ESP32-S2, or ESP32-S3 development board
  • WiFi network

Software Requirements

  • ESP-IDF v5.0 or later
  • iperf2 or iperf3 for testing with PC

Building

  1. Set up ESP-IDF environment:
. $HOME/Code/esp32/esp-idf/export.sh
  1. Set the target chip (choose one):
# For ESP32
idf.py set-target esp32

# For ESP32-S2
idf.py set-target esp32s2

# For ESP32-S3
idf.py set-target esp32s3
  1. Configure WiFi credentials:
idf.py menuconfig

Navigate to "ESP32 iperf Configuration" and set your SSID and password.

  1. Build the project:
idf.py build
  1. Flash to your device:
idf.py -p /dev/ttyUSB0 flash monitor

Usage

TCP Server Mode

On ESP32:

iperf> iperf -s

On PC:

iperf -c <ESP32_IP>

TCP Client Mode

On PC:

iperf -s

On ESP32:

iperf> iperf -c <PC_IP>

UDP Mode

Add -u flag for UDP testing:

iperf> iperf -s -u
iperf> iperf -c <IP> -u

Options

  • -s : Run as server
  • -c <ip> : Run as client, connecting to server IP
  • -u : Use UDP instead of TCP
  • -p <port> : Port number (default: 5001)
  • -t <time> : Test duration in seconds (default: 30)
  • -b <bw> : Bandwidth limit for UDP in Mbps
  • -a : Abort running test

Examples

# TCP client test for 10 seconds
iperf -c 192.168.1.100 -t 10

# UDP server on port 5002
iperf -s -u -p 5002

# Stop running test
iperf -a

Project Structure

esp32-iperf/
├── CMakeLists.txt
├── main/
│   ├── CMakeLists.txt
│   ├── Kconfig.projbuild
│   ├── main.c          # WiFi initialization and console
│   ├── iperf.c         # iperf implementation
│   └── iperf.h         # iperf header
└── README.md

Author

Bob - Creator of iperf2

License

Open source