Android USB Serial - problems

Any advice for getting a serial port working over USB?

I’m experimenting with two different USB-Serial dongles, one based on the Prolific PL2303 chipset and the other based on the FTDI R232. I’ve only had luck getting the prolific chip to do anything at all, but it’s extremely intermittent.

I’ve written some test apps based on Prolific’s drivers with middling success. Most of the time, the USB-serial dongle isn’t detected at all. The only way to get Android to recognize the presence of a serial dongle is to connect a micro-USB cable, then disconnect it. This seems to force Android to re-enumerate the USB bus, and see the USB-serial dongle. This will work through the first run of a serial app. After I quit and relaunch, the dongle isn’t detected.

No luck at all with the FTDI chipset, even using their provided test app (link below)

A second problem I have, is that for some of the test apps I’ve written, Android fails to request USB permission despite having

<uses-feature android:name=""/>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />

in the AndroidManifest.xml file.

Here are the various apps and libraries I’ve tried:

[works sometimes]
Prolific PL2303 Android USB Host API SDK (v1.0.0.13b)

[doesn’t work]
FTDI UART Terminal Application

[doesn’t work - sometimes crashes]

[doesn’t work]

I can’t really speak to the “android drivers” things, the whole concept is pretty flakey.

But I will tell you that if you build the appropriate drivers into the linux kernel, either of the devices will work flawlessly AS a generic linux RS232 device. I.e., /dev/ttyUSBx

Hello: I ‘think’ your problem is permissions on the /dev/ttyXXX device. connect to the board with adb shell, change to the /dev directory, and use ls look at the listed tty* devices. When you plug in the dongle you should get an additional tty* device. (/dev/ttyACM0 for the dongle I was using). Then run ls -l and you will find you don’t have write permissions. you can fix this with su and chmod, but the next timer you boot it will disappear. You need a more permanent solution.

Automatically Starting a program after the IFC6410 boots

The script you need to modify is:

You need to add the following at the very bottom of the file:
chmod 777 /dev/ttyACM0
chmod 777 /dev/ttyACM1

If you want your program to start when the 410c boots, just add it below the chmod instructions in the same file:

am start -n org.opencv.samples.tutorial2/org.opencv.samples.tutorial2.Tutorial2Activit