USB host device not reported on disconnect and reconnect

clydeps
Posts: 8
Joined: Tue Jun 14, 2022 12:17 am

USB host device not reported on disconnect and reconnect

Postby clydeps » Sat Jul 27, 2024 4:29 am

I'm using the usb host library on an ESP32S3. If I reset the ESP with a USB device connected, or plug in a USB device after the ESP has started up, I get, as expected, a USB_HOST_CLIENT_EVENT_NEW_DEV message, and can connect to the device.

If I then unplug the device, I get, again as expected, a USB_HOST_CLIENT_EVENT_DEV_GONE message.

However, if I now plug the device in again, I get no messages, and thus can't connect to the device. Same if I plug in a different device, no message.

Any ideas?

username
Posts: 538
Joined: Thu May 03, 2018 1:18 pm

Re: USB host device not reported on disconnect and reconnect

Postby username » Sun Jul 28, 2024 4:17 am

Without having any reference to you code how can we help ?

clydeps
Posts: 8
Joined: Tue Jun 14, 2022 12:17 am

Re: USB host device not reported on disconnect and reconnect

Postby clydeps » Sun Aug 25, 2024 9:47 am

The code is similar to the example in the API docs, but what I did wrong was not calling `usb_host_device_close` after the device was removed. All working now.

Who is online

Users browsing this forum: Google [Bot] and 133 guests