-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extremely slow RNDIS throughput with esp-tinyusb (IEC-137) #46
Comments
@wuyuanyi135 The main difference between tinyusb Would you please try again with |
@leeebo Hello, Thanks for your tips! I have tried your suggestion by commenting out This is way slower than the implementation in |
Hi,
results are satysfying, over 34mbit/s when esp32 is a server and 26mbit/s when its a client. |
IIRC P4 has high speed USB 2.0, while S3 only has full speed (12mbps) interface right? |
Thats correct |
hi, is still an issue in 5.3.1 ? is it because S3 has full speed USB? |
The https://github.com/espressif/esp-iot-solution/tree/master/examples/usb/device/usb_dongle |
To be honest it is hard to say if library or esp32 performance is bad. 50-ish mbit/s seems to be very slow on USB HS, which is 480mbit/s, but it should be satisfactory for low price chip. The question is, are our expectation matching reality and can be achieved with freertos? |
i'm interested in this since i'm trying to implement a sniffer that will transmit to wireshark with tcp over usb, where wireshark would be the tcp client calling the sniffer, getting trafic over serial connection can quickly clog up the connection, so i'm trying to figure out something faster. btw i'm also having issues to control the dhcp server behavior in the sample sta2eth where i'm trying to prevent it from issuing it a dns ip as i don't want it receiving any dns queries from the network (because performance) `
} |
@emaayan Greetings. I also tried disabling DNS providing but without luck. I didn't try further since it doesn't really matter anyway. As long as the metrics of the USB RNDIS interface has lower priority than the internet interface it won't cause connectivity issue of the PC. I was looking for some configuration bytes to provide a large metrics number by the DHCP server but I couldn't find any. Why did you want to disable DNS on the DHCP? |
I'm trying to reduce the amount of traffic this card has as much as possible , because I've noticed it was starting to get DNS queries from the machine, and I'm having performance issues when trying to push traffic from the card to the machine. and i'm not sure why that is. i've also noticed it's processing MDNS traffic so i'm trying to eliminate that as well. |
Answers checklist.
Which component are you using? If you choose Other, provide details in More Information.
device/esp_tinyusb
ESP-IDF version.
v5.2
Development Kit.
ESP32-S3-WROOM-1-N8R8
Used Component version.
1.4.4 (Dirty)
More Information.
In my project, a USB dongle made of ESP32-S3 are used as communication gateway that creates an RNDIS interface on the PC for connecting with the other devices.
Observations
Current setup
I have been using the tinyusb and additions from esp-iot-bridge and the throughtput was satisfactory (max ~7Mbps). Because of the USB refactoring work, the esp-iot-bridge solution does not compile on esp-idf > 5.2.
Code difference
The iot-bridge's
[tinyusb_install_driver](https://github.com/espressif/esp-iot-bridge/blob/master/components/usb/usb_device/additions/src/tinyusb.c)
uses tons of hal code but theesp-tinyusb
counterpart uses new API that is compatible withesp-idf>5.2
.However, from my observation, with esp_tinyusb, the throughtput was only about 400 Kbps, which is much slower than what I could get from esp-iot-bridge. Looking at the implementation of ECM_RNDIS in tinyusb, it seems there isn't any significant change from the versions.
Benchmark
Note:
Conclusions
From my analysis, I found that
esp-tinyusb
will lead to very chopy network (ping vary from <1ms to seconds or timeout) and will no longer respond after heavy traffic.I guess the slowdown was not caused by tinyusb. Most probably the way how tinyusb driver are installed (see Code difference) caused the issue. But these code involves too much implementation details of USB peripheral so I am not able to further track down.
Can you please compare the network throughtput when using this project and see if the speed confirms my observations?
The text was updated successfully, but these errors were encountered: