Code cdc_acm_vcp example from esp-idf5.3.2

voyager46
Posts: 6
Joined: Tue Jul 09, 2024 4:54 pm

Code cdc_acm_vcp example from esp-idf5.3.2

Postby voyager46 » Sat Dec 14, 2024 8:54 pm

Trying to insert a BLE Client in this example, but I cannot enable Bluetooth either in menuconfig nor in esp-ide. Would like to get data from a ble device and pass it thru the cdc port of the esp32s3 to another device. I can't do it directly as the receiver only has a ch3x serial port and nothing else. The cdc example works perfect. I can pass any information thru the USB port of the esp32s3 Devkit to my old device. So this part works. My problem is including the ble on the Devkit.

I hope somebody can help me with this problem.

drstefankrank
Posts: 5
Joined: Sat Dec 28, 2024 8:06 pm

Re: Code cdc_acm_vcp example from esp-idf5.3.2

Postby drstefankrank » Sat Dec 28, 2024 8:26 pm

Hi,

I had the same problem with the example, so I created a new project and manually added the example code and dependencies.
My goal is to create a VCP serial to Bluetooth bridge. Combining both examples was difficult, because one is written in C++ and the other in C. I am using the spp_server.c from the examples, where as my main is a cpp file.

So far it works, but I get strange characters and other garbage when copy/pasting or request a lot of data from the serial device. It may be a buffer/speed problem.

It seems you are trying the same. I may upload the project to github if this is the case.

These are the options in sdkconfig:
#
# Bluetooth
#
CONFIG_BT_ENABLED=y
CONFIG_BT_BLUEDROID_ENABLED=y
# CONFIG_BT_NIMBLE_ENABLED is not set
# CONFIG_BT_CONTROLLER_ONLY is not set
CONFIG_BT_CONTROLLER_ENABLED=y
# CONFIG_BT_CONTROLLER_DISABLED is not set

#
# Bluedroid Options
#
CONFIG_BT_BTC_TASK_STACK_SIZE=3072
CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y
# CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1 is not set
CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0
CONFIG_BT_BTU_TASK_STACK_SIZE=4352
# CONFIG_BT_BLUEDROID_MEM_DEBUG is not set
CONFIG_BT_BLUEDROID_ESP_COEX_VSC=y
CONFIG_BT_BLE_ENABLED=y
CONFIG_BT_GATTS_ENABLE=y
# CONFIG_BT_GATTS_PPCP_CHAR_GAP is not set
# CONFIG_BT_BLE_BLUFI_ENABLE is not set
CONFIG_BT_GATT_MAX_SR_PROFILES=8
CONFIG_BT_GATT_MAX_SR_ATTRIBUTES=100
# CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set
CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_AUTO=y
CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0
# CONFIG_BT_GATTS_ROBUST_CACHING_ENABLED is not set
# CONFIG_BT_GATTS_DEVICE_NAME_WRITABLE is not set
# CONFIG_BT_GATTS_APPEARANCE_WRITABLE is not set
CONFIG_BT_GATTC_ENABLE=y
CONFIG_BT_GATTC_MAX_CACHE_CHAR=40
CONFIG_BT_GATTC_NOTIF_REG_MAX=5
# CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set
CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=3
CONFIG_BT_BLE_SMP_ENABLE=y
# CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set
# CONFIG_BT_BLE_SMP_ID_RESET_ENABLE is not set
# CONFIG_BT_STACK_NO_LOG is not set

I hope this helps.

voyager46
Posts: 6
Joined: Tue Jul 09, 2024 4:54 pm

Re: Code cdc_acm_vcp example from esp-idf5.3.2

Postby voyager46 » Wed Jan 01, 2025 11:02 am

Hi Stefan,
first of all, a Happy New Year and all the best for you. Sure I would be interested in your Code and try it on my board. I am still stuck in mine. Could you give me a short note (and URL) when you have uploaded it to Github. Thank you for answering my post.

drstefankrank
Posts: 5
Joined: Sat Dec 28, 2024 8:06 pm

Re: Code cdc_acm_vcp example from esp-idf5.3.2

Postby drstefankrank » Wed Jan 01, 2025 2:54 pm

I uploaded the current code base. Good luck, maybe we can solve the issues together!
https://github.com/dr-stefan-krank/ESP3 ... BT-Bridge/

drstefankrank
Posts: 5
Joined: Sat Dec 28, 2024 8:06 pm

Re: Code cdc_acm_vcp example from esp-idf5.3.2

Postby drstefankrank » Wed Jan 01, 2025 6:31 pm

and I forgot: A happy new year as well!

nopnop2002
Posts: 347
Joined: Thu Oct 03, 2019 10:52 pm
Contact:

Re: Code cdc_acm_vcp example from esp-idf5.3.2

Postby nopnop2002 » Sat May 31, 2025 1:19 am

I uploaded the current code base. Good luck, maybe we can solve the issues together!
https://github.com/dr-stefan-krank/ESP3 ... BT-Bridge/
This is probably because there is no sdkconfig.defaults.

This might help.

https://github.com/nopnop2002/esp-idf-vcp2ble

voyager46
Posts: 6
Joined: Tue Jul 09, 2024 4:54 pm

Re: Code cdc_acm_vcp example from esp-idf5.3.2

Postby voyager46 » Sat May 31, 2025 9:57 am

I gave up combining cdc_acm_vcp with ble or wlan using a ESP32-S3. Instead I am using a simple Wemos ESP32 mini with a small usb host board from hobbytronics.co.uk I had lying around. This Board is based around the Microchip 24FJ64GB002 microcontroller which contains a built-in full-speed USB host controller. This allows the board to interface with and control any USB slave device – flash drives, keyboards, digital cameras, PS3 game controllers, and much more! It can

So I can use the WLan of the ESP32 and my Sensors (also based on Wemos ESP32) communicate with ESP-Now which is much faster than Ble and has a longer range.
Unfortunately this board is no longer available. But they are selling the main chip as SOIC, SSOP and DIP28. The Schematic is provided so you can build the simple board with few components. Steven is a very, very helpful guy and can surely help you.

So I could close my project which runs very reliable.

drstefankrank
Posts: 5
Joined: Sat Dec 28, 2024 8:06 pm

Re: Code cdc_acm_vcp example from esp-idf5.3.2

Postby drstefankrank » Sat May 31, 2025 4:30 pm

Funny, because after giving up for a while, I got it working today.

I can reliably transfer data without any crashes. I also modified the VCP driver to accept multiple VIDs. Some devices brand their chips, even though there's no difference for the driver. For example, Netgear Switches on their PL2303 chips.

I also modified the python client to directly jump into a terminal mode after connection.

I'm soon going to update my git repository, after some clean-up and annotation.

For me having it on Bluetooth is important. I'm going to use it as a wireless way to configure network switches at customer sites without running any USB cables. Being able to sit 10m away from the switch, instead of standing in front of a rack holding the laptop is a big win.
I believe for your application the long time stability is more important. I'm not sure about the reliability of that BLE connection.

drstefankrank
Posts: 5
Joined: Sat Dec 28, 2024 8:06 pm

Re: Code cdc_acm_vcp example from esp-idf5.3.2

Postby drstefankrank » Mon Jun 02, 2025 2:31 pm


voyager46
Posts: 6
Joined: Tue Jul 09, 2024 4:54 pm

Re: Code cdc_acm_vcp example from esp-idf5.3.2

Postby voyager46 » Sat Jun 07, 2025 9:00 am

Hi Stefan,
Congrats for your success. I am now trying to combine my ESP32-S3 DEV Board with cdc_acm_vcp with WLan and ESP-Now as I have run out of the small USB Host Boards from HobbyTronics and don't want to create some new. I am struggling along on a Mac and ESP-Idf.
Have a nice day.

Who is online

Users browsing this forum: No registered users and 1 guest