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

CH341A meet java.io.IOException: Expected 0x0 byte, but get 0xff [init #1] #514

Closed ethi1989 closed 10 months ago

ethi1989 commented 1 year ago

when i use ch341a , I meet java.io.IOException: Expected 0x0 byte, but get 0xff [init #1], I have no idea ,is it the hardware error or the library error vendorId : 6790 productId : 21795

kai-morich commented 1 year ago

I am not aware of issues with CH34X devices. Is it very new or very old? please try a different device.

ethi1989 commented 1 year ago

I am not aware of issues with CH34X devices. Is it very new or very old? please try a different device.

ok, I only have a usb relay, I will buy another Ch34X, but may I modify the code like this? does it result anything? FROM private void initialize() throws IOException { checkState("init #1", 0x5f, 0, new int[]{-1 /* 0x27, 0x30 */, 0x00}); TO private void initialize() throws IOException { checkState("init #1", 0x5f, 0, new int[]{-1 /* 0x27, 0x30 */, -1});

kai-morich commented 1 year ago

you can try with different values, but as they are not officially documented, nobody knows if these values are ok