Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
iKK001 opened this issue Nov 17, 2024 · 2 comments
Open
1 task done

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

iKK001 opened this issue Nov 17, 2024 · 2 comments
Labels
Status: Awaiting triage Issue is waiting for triage

Comments

@iKK001
Copy link

iKK001 commented Nov 17, 2024

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

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@iKK001 iKK001 added the Status: Awaiting triage Issue is waiting for triage label Nov 17, 2024
@SuGlider
Copy link
Collaborator

SuGlider commented Nov 17, 2024

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)?

@iKK001
Copy link
Author

iKK001 commented Nov 23, 2024

Yes, it shows the new productName and is recognized by webUSB.

However, after running above setup, for programming with the ArduinoIDE I need to hardware-reset the ESP32S3 since the port is no longer recognized otherwise... (The HW-reset is done by holding IO0 to GND while connecting to USB and then release IO0 again...)

So in short, other than the inconvenience of needing to hw-reset again and again, the above code works.

However, I have another problem as trying to describe:

The claimInterface is no longer working as it was before. i.e. if I run an ESP32S3 out of the box (i.e. without the above setup but as delivered), the claimInterface works. If I apply the above code, it no longer can find any interfaces. Why ???

Is there a better way to change VID, PID, ProductName and MnufacturerName to keep claimInterface working ?

Here my settings:

Screenshot 2024-11-23 at 15 44 20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting triage Issue is waiting for triage
Projects
None yet
Development

No branches or pull requests

2 participants