Skip to content

Low TCP/UDP throughput on the ESP32 ESP-Hosted-MCU slave (EHM-115) #112

@nkp123

Description

@nkp123

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate.
  • Provided a clear description of your suggestion.
  • Included any relevant context or examples.

Issue or Suggestion Description

Hi,
I am working on connecting ESP32-P4 SoC (ESP32P4NRW32) with ESP32 module (ESP32-WROOM-32E-N4) using my custom board. My main goal is to get WiFI and A2DP Bluetooth Classic working. I am facing an issue with the performance however. I have narrowed down the (probable) cause to ESP-Hosted slave (ESP32 module) itself, (only when running ESP-Hosted-MCU slave compiled firmware).

Steps to reproduce:

  • Prepare ESP-Hosted-MCU Slave example via idf.py create-project-from-example "espressif/esp_hosted=2.6.0:slave"
  • Enable via menuconfig CLI Shell console and disable Bluetooth to test only wifi (simultaneously freeing memory for an iperf server)
  • Compile and flash the module
  • Execute commands via CLI:
wifi init
wifi start
sta SSID PASSWD
iperf -s
  • Run iperf2 on PC and test performance

I am getting only about 2Mbps of UDP/TCP throughput without Bluetooth and ~700kbps when Bluetooth is enabled.

Notes:

I am using ESP-IDF version 5.5.1 and ESP-Hosted-MCU version 2.6.0

During diagnostics I have tried some other things:

  • Verifying SDIO (4 bit, 20 MHz) transport speed between ESP32P4 and ESP32: Got ~40Mbps unidirectional
  • Verifying ESP-Hosted on another EV board (Waveshare ESP32P4+ESP32C6 combo): Got ~30 Mbps TCP and ~40Mbps UDP unidirectional
  • Trying running ESP-IDF iperf project example instead of the iperf integrated into the ESP-Hosted-MCU CLI on the ESP32, bypassing ESP-Hosted altogether: Got ~25 Mbps TCP and ~33Mbps UDP unidirectional

Any help would be appreciated.

Thanks,
Norbert

In the file below you can find full ESP32 slave logs:
ESP32 ESP-Hosted-MCU log.log

Below I am attaching only iperf results.

[...]
coprocessor>  iperf -s
I (234551) IPERF: mode=tcp-server sip=localhost:5001, dip=0.0.0.0:5001, interval=3, time=30
I (234555) iperf: Socket created
coprocessor>  I (236865) wifi:<ba-add>idx:1 (ifx:0, 48:a9:8a:06:20:7f), tid:6, ssn:2, winSize:64
I (236887) iperf: accept: 192.168.100.114,55576

Interval       Bandwidth
 0.0- 3.0 sec  1.87 Mbits/sec
 3.0- 6.0 sec  1.85 Mbits/sec
W (245385) iperf: tcp server recv error, error code: 128, reason: Socket is not connected
I (245387) iperf: TCP Socket server is closed.
I (245389) iperf: iperf exit
 6.0- 9.0 sec  1.75 Mbits/sec
 
coprocessor>  iperf -c 192.168.100.114 -i 1
I (561993) IPERF: mode=tcp-client sip=localhost:5001, dip=192.168.100.114:5001, interval=1, time=30
I (562003) iperf: Successfully connected

Interval       Bandwidth
coprocessor>   0.0- 1.0 sec  2.62 Mbits/sec
 1.0- 2.0 sec  2.12 Mbits/sec
 2.0- 3.0 sec  2.25 Mbits/sec
 3.0- 4.0 sec  2.25 Mbits/sec
 4.0- 5.0 sec  2.12 Mbits/sec
 5.0- 6.0 sec  2.25 Mbits/sec
 6.0- 7.0 sec  2.25 Mbits/sec
 7.0- 8.0 sec  2.12 Mbits/sec
 8.0- 9.0 sec  2.88 Mbits/sec
 9.0-10.0 sec  2.12 Mbits/sec
10.0-11.0 sec  2.12 Mbits/sec
11.0-12.0 sec  2.50 Mbits/sec
12.0-13.0 sec  2.50 Mbits/sec
13.0-14.0 sec  2.00 Mbits/sec
14.0-15.0 sec  2.00 Mbits/sec
15.0-16.0 sec  2.00 Mbits/sec
16.0-17.0 sec  1.75 Mbits/sec

coprocessor>  17.0-18.0 sec  1.00 Mbits/sec
W (580903) iperf: tcp client send error, error code: 104, reason: Connection reset by peer
I (580905) iperf: TCP Socket client is closed.
I (580907) iperf: iperf exit
18.0-19.0 sec  0.75 Mbits/sec

I am attaching results from the iperf on PC as well:

$ iperf -c 192.168.100.198 -i 1
------------------------------------------------------------
Client connecting to 192.168.100.198, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  1] local 192.168.100.114 port 55576 connected with 192.168.100.198 port 5001
[ ID] Interval       Transfer     Bandwidth
[  1] 0.0000-1.0000 sec   245 KBytes  2.00 Mbits/sec
[  1] 1.0000-2.0000 sec   180 KBytes  1.47 Mbits/sec
[  1] 2.0000-3.0000 sec   141 KBytes  1.15 Mbits/sec
[  1] 3.0000-4.0000 sec   239 KBytes  1.96 Mbits/sec
[  1] 4.0000-5.0000 sec   186 KBytes  1.52 Mbits/sec
[  1] 5.0000-6.0000 sec   205 KBytes  1.68 Mbits/sec
[  1] 6.0000-7.0000 sec   177 KBytes  1.45 Mbits/sec
[  1] 7.0000-8.0000 sec   228 KBytes  1.87 Mbits/sec
[  1] 8.0000-9.0000 sec   217 KBytes  1.77 Mbits/sec
[  1] 9.0000-10.0000 sec   177 KBytes  1.45 Mbits/sec


$ iperf -s -i 1
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size:  128 KByte (default)
------------------------------------------------------------
[  1] local 192.168.100.114 port 5001 connected with 192.168.100.198 port 56643
[ ID] Interval       Transfer     Bandwidth
[  1] 0.0000-1.0000 sec   275 KBytes  2.25 Mbits/sec
[  1] 1.0000-2.0000 sec   226 KBytes  1.85 Mbits/sec
[  1] 2.0000-3.0000 sec   219 KBytes  1.80 Mbits/sec
[  1] 3.0000-4.0000 sec   219 KBytes  1.80 Mbits/sec
[  1] 4.0000-5.0000 sec   240 KBytes  1.97 Mbits/sec
[  1] 5.0000-6.0000 sec   215 KBytes  1.76 Mbits/sec
[  1] 6.0000-7.0000 sec   245 KBytes  2.00 Mbits/sec
[  1] 7.0000-8.0000 sec   215 KBytes  1.76 Mbits/sec
[  1] 8.0000-9.0000 sec   233 KBytes  1.91 Mbits/sec
[  1] 9.0000-10.0000 sec   218 KBytes  1.78 Mbits/sec

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions