Page 1 of 1
Host library help for esp32
Posted: Fri Dec 05, 2025 1:07 am
by X86Jamie
I have a Esp32s3-wroom-1 and want to use OTG usb gpio pin 19, and 29 connect to dm, dp usb on the modem and have the Esp32 enumerate the 3 ports AT, nema, and dm just like windows or open wrt would. Seems impossible to get any cdc host libraries to compile! I really don’t like using vs code with expressif idf extension very clunky. Id prefer ardunio IDE.
Any examples for this kind of host code.
Re: Host library help for esp32
Posted: Fri Dec 05, 2025 10:28 am
by lichurbagan
Right now, Arduino-ESP32 does not support USB-Host (CDC-Host, HID-Host, MSC-Host) on the ESP32-S3.
Only USB-Device mode is fully supported in Arduino.
USB-OTG host mode does work perfectly in ESP-IDF (with TinyUSB), but Arduino does not expose the host-side APIs yet.
Re: Host library help for esp32
Posted: Fri Dec 05, 2025 12:22 pm
by X86Jamie
I have vs code with expressif extension and tried v4, v5 nothing compiles when trying to use cdc host libraries. I do not see config settings for cdc host or tiny USB stack enable. It is very difficult. And the vs code extension is so clunky and slow on a decant low end gaming laptop.
Any other IDE? And what settings for config for my esp32s3-wroom-1. Any example code for modem communication over usb, and esp acting as host? I’ll take an example using any IDE:)
Thanks so much.
Re: Host library help for esp32
Posted: Sat Dec 06, 2025 2:53 pm
by X86Jamie
I’m now using windows Powershell and esp-idf-4.4 directly! This is the fastest way to compile!
I found this
https://gitlab.informatik.uni-bremen.de ... t_bg96.cpp
It compiled and loaded no problem. But the debug output says it’s failing to enumerate my device. I’m wondering if this is not compatible with my chip? Or if need to down grade the ships base instruct set … if possible?
Otherwise maybe the config settings need to be changed from default?
Re: Host library help for esp32
Posted: Sun Dec 07, 2025 12:52 pm
by nopnop2002
Here is official example.
https://github.com/espressif/esp-idf/tr ... s/usb/host
You need external USB CONNECTOR.
Code: Select all
ESP BOARD USB CONNECTOR (type A)
--
[5V] -----------> | || VBUS (5V)
[GPIO19] ------> | || D-
[GPIO20] ------> | || D+
[GND] ----------> | || GND
--
Re: Host library help for esp32
Posted: Wed Dec 10, 2025 12:57 pm
by X86Jamie
Thanks. But that example doesn’t do me any good.
I need the CDC/host/bg96 modem example from Version 5.0 beta. Why was it dropped? It kinda worked as in I was able to send at commands to modem via otg cdc uart.
The trouble is esp-idf doesn’t support blynk Arduino libraries until version 5.1, which is when they dropped the bg96 modem example.
I tried to move the bg96 code over to the 5.1 version it was a never ending nightmare of differences and never compiled.
Next I in the Arduino ported cdc example I linked at the beginning I ported it to use the bg96 code and it worked. It’s just very buggy keeps dropping connections for no reason even though I have a minimal sketch and good signal strength.
Also every other power cycle it seems I need to physically unplug then hot plug the modem back in order for it to enumerate again on the esp32!!
Such a nightmare! Why isn’t this better supported? Why say it does otg cdc host usb when there is such limited offerings? I bought the more expensive esp32 for that exact reason!
Re: Host library help for esp32
Posted: Thu Dec 11, 2025 1:41 am
by nopnop2002
I tried to move the bg96 code over to the 5.1 version it was a never ending nightmare of differences and never compiled.
The cdc_acm_bg96 sample code was able to build with ESP-IDF V5.5.
I don't have a Quectel BG96 LTE/GPS so I'm not sure if it will work properly.
The usb_host_cdc_acm component must use V1.
Code: Select all
## IDF Component Manager Manifest File
dependencies:
idf: ">=4.4"
igrr/libnmea: "^0.1.1"
usb_host_cdc_acm: "1.*"
Re: Host library help for esp32
Posted: Thu Dec 11, 2025 12:45 pm
by X86Jamie
5.5 has cdc bg96 in public repo? Or you have to manually add it? Thanks I’ll give this a try.
If you don’t have a bg96 but have a bg95, ec25, any of them and likely more will work. You just have to change the device vid, or pid to match.
Re: Host library help for esp32
Posted: Thu Dec 11, 2025 11:57 pm
by nopnop2002
>5.5 has cdc bg96 in public repo?
No.
>Or you have to manually add it?
Yes.
You can get fron here.
https://github.com/espressif/esp-idf/tr ... c_acm_bg96