UsbSerial icon indicating copy to clipboard operation
UsbSerial copied to clipboard

App crash when "createUsbSerialDevice"

Open williamtran1988 opened this issue 9 years ago • 11 comments

Hi All,

I am having an issue when integrate with library. My application was crashed when "createUsbSerialDevice",

i have 2 case as below:

  • Plug USB to android device: ==> OK
    • App is open because i have device filter USB attached.
    • Can create a connection and open it.
  • USB is already plugged.
    • Reboot android device.
    • Permission is granted.
    • openDevice success
    • createUsbSerialDevice ===> FAILED.

Could somebody help me on this?

williamtran1988 avatar Mar 24 '17 04:03 williamtran1988

i have simmilar issue...

PawelSzymanski89 avatar Oct 29 '18 13:10 PawelSzymanski89

@PawelSzymanski89 Some info from Logcat would be great

felHR85 avatar Nov 08 '18 11:11 felHR85

I have the same issue in my app ( cratch on createUsbSerialDevice I think because openDevice always returns null ). Your example works fine and my code is a copy past of your example ... obviously something is missing in my code but I can not figure what.. A queston : How to get logcat and debug ? if the USB is attached to the FDTI I can not connect to Android Studio. Maybe a silly question but a suggestion would be appreciated. Thanks

ToninoTarsi avatar Nov 18 '18 17:11 ToninoTarsi

Hi @ToninoTarsi What Android version do you have? Also It would be great to take a look of the exception stacktrace

felHR85 avatar Nov 18 '18 17:11 felHR85

Thanks Felipe Android 6 ( LG G3 ) . For the stacktrace I will be happy to be able to provide you one but I have no idea on how to connect simultaneously the FDTI and the PC to my phone. How do you do that ? Regards

ToninoTarsi avatar Nov 18 '18 17:11 ToninoTarsi

@ToninoTarsi Android 6 should work fine. What kind of UsbSerial device are you connecting? if createUsbSerialDevice is returning null that means the usb device "is not supported" because VID-PID are not recognized. For debugging through wifi try this

felHR85 avatar Nov 18 '18 17:11 felHR85

Thanks for the information about ADB ove WiFi .. I will try. The device is an FTDI ( device.getVendorId() return 1027 ) and your example sync works fine so it is supported and your library works fine. The ADB over wifi will help to understand what I'm missing .. I hope. Thanks

ToninoTarsi avatar Nov 18 '18 18:11 ToninoTarsi

@ToninoTarsi And the product id? Vendor id is standard FTDI but maybe that product id is not supported.

felHR85 avatar Nov 18 '18 18:11 felHR85

PID = 24597 (dec ) 0x6015

ToninoTarsi avatar Nov 18 '18 18:11 ToninoTarsi

@ToninoTarsi It should be supported

felHR85 avatar Nov 18 '18 18:11 felHR85

Yes .. it works. It was my fault. Thanks for indicating me how to use ADB over Wifi .. I did not known that :-) Regards

ToninoTarsi avatar Nov 18 '18 20:11 ToninoTarsi