esp-iot-solution icon indicating copy to clipboard operation
esp-iot-solution copied to clipboard

Feature Request: Support for RNDIS/ECM Connectivity in AP Mode (AEGHB-618)

Open BlueDeer233 opened this issue 10 months ago • 1 comments

Answers checklist.

  • [X] I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • [X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • [X] I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Hello ESP-IOT-SOLUTION Team,

I am currently working with the ESP-IOT-SOLUTION framework and have encountered a scenario where the ability to connect a PC to the ESP32's Access Point (AP) via RNDIS or ECM could significantly enhance the framework's utility, particularly for creating a self-contained local network environment.

Feature Description

I propose the implementation of functionality within rndis_connect() and ecm_open() that would allow these methods to support connections in AP mode. This feature would enable the ESP32 to act not only as a Wi-Fi Access Point but also as a virtual Ethernet device that PCs can connect to via USB. This setup would be immensely useful for situations where wireless connectivity is insufficient or unreliable, and a wired connection via USB could provide a stable and reliable network interface.

Current Behavior

Currently, attempting to invoke rndis_connect() while the ESP32 is configured in AP mode results in a system crash with a StoreProhibited exception. This indicates an illegal attempt to write to a protected memory address.

[0;32mI (2205) WIFI: AP Started[0m
[0;32mI (2205) MAIN: WIFI initialization DONE, Local IP: 192.168.4.1[0m
Guru Meditation Error: Core  0 panic'ed (StoreProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x400879b8  PS      : 0x00060130  A0      : 0x800879d5  A1      : 0x3ffd1ae0  
A2      : 0x4001000b  A3      : 0x3f008a24  A4      : 0x3f008aa0  A5      : 0x3ffd1b00  
A6      : 0x3ffd1ae0  A7      : 0x0000000c  A8      : 0x00000000  A9      : 0x00000007  
A10     : 0x00000051  A11     : 0x3ffd1bec  A12     : 0x3ffd1ae0  A13     : 0x0000000c  
A14     : 0x00000000  A15     : 0x00000000  SAR     : 0x00000004  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00000000  LBEG    : 0x3ffd1ae0  LEND    : 0x0000000c  LCOUNT  : 0x40026e00  

Proposed Benefits

  • Enhanced Connectivity: Provides an alternative connection method that could be more stable and reliable than Wi-Fi in certain environments.
  • Increased Flexibility: Allows users to create a fully integrated IoT environment where the ESP32 can manage both Wi-Fi and USB network traffic.
  • Broader Use Cases: Makes the ESP32 suitable for a wider range of applications, such as in environments where Wi-Fi is prohibited or in settings where direct USB connectivity to a computing device is necessary.

Thank you for considering this feature request. I believe many users would benefit from these enhancements and I look forward to potential discussions on this proposal.

Best Regards,

BlueDeer233 avatar Apr 10 '24 17:04 BlueDeer233

@BlueDeer233 Thanks for your proposal. We will discuss this internally and give you feedback.

For the StoreProhibited bug in Current Behavior, would you please point out which example are you using?

leeebo avatar Apr 20 '24 13:04 leeebo