mik3y / usb-serial-for-android

Android USB host serial driver library for CDC, FTDI, Arduino and other devices.
MIT License
4.81k stars 1.58k forks source link

USB get_status request failed #491

Closed WanManito closed 1 year ago

WanManito commented 1 year ago

version = 3.5.1

When I connect to a USB serial port with no available devices, I can connect normally, but when I close it, it will trigger the exception "java. io. IOException: USB get_status request failed", and I cannot connect all devices normally. If I connect to new available devices again, the exception "Reset failed: result=-1" will always be triggered

kai-morich commented 1 year ago

which device type are you using? do you get the exception from the close command?

WanManito commented 1 year ago

Ftdi vid = 1027,pid = 24577 prolific vid = 1659,pid = 9155, close exception = "java. io. IOException: USB get_status request failed"

WanManito commented 1 year ago

As a supplementary explanation, I used two types of USB serial devices with the same phenomenon. The testing process is as follows: The USB port connects to Android devices, but DB9 is not connected to any devices. It can open the connection normally, and closing it again will trigger an exception, and then it cannot connect to any other devices. @kai-morich

kai-morich commented 1 year ago

does it fail with FTDI or Prolific device? Prolific devices are known for unstable connection.

WanManito commented 1 year ago

Hello, both devices have been tested and this phenomenon is inevitable. I'm not sure if I have described it clearly @kai-morich

kai-morich commented 1 year ago

when opening again, you very likely cannot reopen an existing UsbSerialPort object, but have to redo initialization starting with manager.openDevice. How do you close it? please provide exception details and callstack.

WanManito commented 1 year ago

I'm very sorry, because I used a USB hub to connect two USB serial devices. After repeated testing, it was a problem with the USB hub. I switched to another brand of USB hub and everything was normal. Thank you for your support

Jai-GAY commented 1 year ago

@WanManito

I think is good that you share the brand, model, and picture so the rest of the users can avoid it to repeat the same questions to the developers. That's one of the ways we can contribute back to the open-source.