How to Enable Communication Between Clients Connected to ESP32 Access Point and USB Ethernet Interface

Ammarkhan
Posts: 1
Joined: Sun Sep 22, 2024 7:39 pm

How to Enable Communication Between Clients Connected to ESP32 Access Point and USB Ethernet Interface

Postby Ammarkhan » Sun Sep 22, 2024 7:49 pm

Hello ESP32 community,

I am working on a project where I have successfully configured my ESP32 to function both as an Access Point (AP) and as a USB Ethernet interface (network card). Now, I need to establish communication between clients connected to the ESP32's AP and my machine via the USB Ethernet interface.

What I have done so far:
1. ESP32 as an AP: I’ve set up the ESP32 to act as an Access Point. Clients can connect to it, and I can manage the connections.

2. ESP32 as a USB Ethernet interface: The ESP32 is working as a USB Ethernet device using TinyUSB (e.g., RNDIS/CDC-ECM), and it's recognized as a network interface on my machine.

My Questions:
1. How can I forward IP packets between the clients connected to the ESP32's AP and my machine over the USB Ethernet interface? I am looking for a recommended approach to set up efficient packet forwarding.
2. Should I use lwIP for IP forwarding, or are there other APIs or methods that would be better suited for this scenario?
3. Are there any example projects or additional configurations that can help optimize communication between the Wi-Fi interface and the USB Ethernet interface?

Any guidance or example code would be greatly appreciated!

Thank you in advance

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

Re: How to Enable Communication Between Clients Connected to ESP32 Access Point and USB Ethernet Interface

Postby nopnop2002 » Tue Sep 24, 2024 5:47 am

I don't know how to build a USB ethernet interface.

For data transfer between interfaces, sample code is available here.

https://github.com/espressif/esp-idf/tr ... ork/eth2ap

https://github.com/espressif/esp-idf/tr ... rk/sta2eth

Who is online

Users browsing this forum: Bing [Bot] and 232 guests