espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.71k stars 7.43k forks source link

claimInterface no longer works when using USB.h on an ESP32-S3 #10611

Open iKK001 opened 5 days ago

iKK001 commented 5 days ago

Board

ESP32S3 Dev Module

Device Description

plain module on breadboard

Hardware Configuration

no special HW configuration

Version

latest master (checkout manually)

IDE Name

Arduino IDE

Operating System

macOS 15.1

Flash frequency

80 Mhz

PSRAM enabled

yes

Upload speed

115200

Description

I am running a WebUSB web-page. It all works if I use the standard ESP32S3 Dev Module out of the box.

However, if I try to customize the productName and manufacturerName of my ESP32S3 module, then the CLAIM INTERFACE of my web-application does no longer work.

Inside my Web-application (i.e. not so important whtat it does), the interace-claim is important in order to send or receive cmds to or from the ESP32 module.

Normally the interface-Nr is equal to 1 for my ESP32S3 Dev Module. But as soon as I mutate prod- and manuf-Names, then my Web-Application can't claim the interface no more.

await usbDevice.claimInterface(pairedDevice, x);   // normally x=1   ....but not if I mutate prod- and manuf-Names...

I tried x=0....100 All with failure.....

I run this Arduino code (see Sketch below) to customize my productionName and manufacturerName

Any idea how to get the CLAIM INTERFACE running again? Is there more USB cmds that I can apply to maybe define the interface ?

Sketch

#include "USB.h"

void setup() {

    USB.PID(0x1001);
    USB.VID(0x303a);
    USB.productName("MyProduct");
    USB.manufacturerName("MyCompany");    
    USB.begin();

    Serial.begin(115200);
    while (!Serial) {
        delay(10);
    }
}

void loop() { 
  delay(1000);
}

Debug Message

My Web-Application throws an error saying something like "The interface of the usb-device cannot be claimed"

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

SuGlider commented 5 days ago

Changing VID, PID, ProductName and MnufacturerName is recognized by the HOST Operating System? Can you see those ids in the USB devices list (lsusb or some other command/GUI)?