Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using serial port RS-232 in android?

I want to send signals via serial port using the JavaComm API classes on an Android device, and here is how I imagine it:

1- the Android device would be: Archos 3.2 which has android 2.2 and USB host mode.

2- include RxTx lib package with my Android app. and include RxTx native code using Android NDK.

3- a short cable which is usb-->serial.

Could you explain to me where I might face problems?

like image 871
rami Avatar asked Jan 07 '11 00:01

rami


2 Answers

I just ported the JavaCOMM ( GNU RXTX ) library to the Android. Here is the link http://v-lad.org/projects/gnu.io.android/

You still might need to rebuild your kernel and maybe recompile the shared library for your environment. But this should get you started.

like image 192
Vlad Avatar answered Oct 15 '22 22:10

Vlad


As noted above, you'll need to come up with device drivers for whatever USB<->Serial device you have. Many of these devices use the Prolific PL2303 chip:

http://www.qbik.ch/usb/devices/showdr.php?id=175

which the stock linux kernel has support for, and has had for a long time. I've used this and it works fine, so I would recommend you stick with USB<->Serial devices that use this chip.

Beyond that, with udev these devices normally show up as /dev/ttyUSB#. How that happens with Android, I don't know, so you'll need to figure that out.

Finally, you will need to build the RxTx native code. This code is pretty crufty - I had problems building it on a fairly modern Angstrom, and I was not trying to cross-compile at all.

like image 40
TazMainiac Avatar answered Oct 15 '22 23:10

TazMainiac