ESP32 - which board to connect 2 USB host devices (CDC)

[Beer]
Posts: 1
Joined: Sat Jan 27, 2024 10:55 pm

ESP32 - which board to connect 2 USB host devices (CDC)

Postby [Beer] » Thu Feb 01, 2024 10:10 pm

Hello!

I would like to make my first project on ESP32 using Micropython.
What I want to do is something like protocol converter between 2 USB devices.
In fact it is only one way communication (first device sending data and the second one is receiving).
The packet must be parsed and rebuild so the receiving device can understand the message)

Each device creates virtual COM (on Windows PC) or /dev/ttyUSBx on raspberry pi.
(It works on raspberry pi and it seems that first device is using FTDI driver and second PL2303.

I actually have this board https://www.diymore.cc/products/diymore ... no-nodemcu )
but unfortunately it seems that host USB library for MicroPython is still under development (no final release yet).

My questions are:
1. Which board do you recommend for my project (I don't need display - I got this board as a gift and it was lying somewhere in my desk)
2. This board should also be fixed and battery powered including charger/charge protection circuit)
3. Is there any working USB library for MicroPython
4. I MicroPython a story of success or should I start learning C/C++.
Since I know a little python (raspberry pi), I thought it would be easier to switch to MicroPython.

I appreciate your help.

Regards,
[Beer]

tore-espressif
Posts: 19
Joined: Thu Oct 07, 2021 8:11 am

Re: ESP32 - which board to connect 2 USB host devices (CDC)

Postby tore-espressif » Wed Feb 14, 2024 9:54 am

Hi,
I'm not proficient with Micropython, but from a quick look to their docs, they don't seem to have USB Host support implemented.

USB is not peer-to-peer communication. There always is a Host and a Device. In your case, the ESP32 boards are USB devices and RPi is USB Host. The USB feature is not implemented in ESP32 but in the serial converters (FTDI or PL2303 chips).

If you want to experiment with USB features and ESPs, you will need ESP32-S2 or ESP32-S3 that have USB-OTG peripheral. We have drivers implemented in C.

Anyway, since this is your first project, I'd recommend you to start with some simpler protocol. If you only want to send data between 2 devices, UART might be the best start. You will also have UART support in Micropython, if that is what you prefer.

Good luck!

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 40 guests