Android Serial RS232 and USB

Roberto Soler
Hi,

We are building a custom app for the MINI6410 running Android. This app
requires us to add a barcode scanner through the RS232 port of the
mini6410. I have not seen how to actually read the serial ports on Android.


Is there any example code, drivers or libraries that need to be installed
to make the Barcode Scanner work with the RS232 on Android?

Thanks,
Roberto

Dave McLaughlin
Hi Roberto, 

Did you ever manage to get RS232 working with the Android OS on your
Mini6410?

I am still looking to see how to do this as I need to implement Modbus over
RS485 or RS232 from within an Android Java application.

Cheers
Dave...

Coskun
I'm also looking for the same solution.

Dave McLaughlin
Using this code you can get the serial ports to work under Android on the
mini6410 but you need a little work to rebuild the Android OS for it to
work first time.

http://code.google.com/p/android-serialport-api/

You need to rebuild with genroot.sh and include the following 3 lines after
the mknod for the ports. Without these I got permission errors when I tried
to open the ports.

# The following is needed to allow user access to the serial ports
  chmod 666 rootfs_dir/dev/s3c2410_serial1
  chmod 666 rootfs_dir/dev/s3c2410_serial2
  chmod 666 rootfs_dir/dev/s3c2410_serial3

The init.rc should do this but for some reason it don't work.

I also had to change the serialport-api SerialPort.c code to remove the
O_DIRECT flag on the open and then recompile (You need the Android NDK to
do this) and then I was able to open the ports and send and receive data.

If anyone has any questions on this, give me a shout?

Dave...

rico
mr.dave
can you share a video about that?

Dan
Hi Dave, forgive me if this is a dumb question, but what is genroot.sh?  A
google search returns your post as the 3rd result from the top :p.  I also
see a link to the file but I'm not sure how to use it in building the
serial port library (I'm admittedly a bit of a novice).  

I'm actually working on the exact same application as you, modbus over
rs485, and I'm having some trouble with permissions as well as sending and
receiving messages.  Any help you can offer would be appreciated.  You can
email me if you want to discuss. dan770 at gma.l.com  Thanks

Nick
I have the same problem, but i don't know what genroot.sh is? and how to
add 3 line 
  chmod 666 rootfs_dir/dev/s3c2410_serial1
  chmod 666 rootfs_dir/dev/s3c2410_serial2
  chmod 666 rootfs_dir/dev/s3c2410_serial3
hope your help.
thanks

Dave McLaughlin
Hi all,

Sorry for the delay. genroot.sh is part of the source code to build Android
that you should have received with the board. I'll see if I can find the
web page that describes how to build Android the easy way. You need to use
Linux to do this.

Dan, I'll be in touch shortly.

Dave...

srinivasan
Hi Everyone,

I am trying to read data from a serial port in the below given opencv
link, I have no problem with
sending bytes. Everything works fine. There is a problem when i
receive bytes. Every time a read a byte from ttymxc0 something happens
and the byte is not only read for the first time it is sending some
junk data  but after pressing the the two enter keys it is able to
read the data correctly but my concern to read the data without
pressing any enter keys in the beginning only.

http://code.google.com/p/android-serialport-api/source/checkout

So could any body provide sme corrected code to get rid of this
annoying serial port read problem,

Am new to this android applications development, pls help me.

Advanced Thanks,
Srinivasan S

Moss
Hi
My android has problem receiving data from my sensor. It is ok sending
data. In the Loopback, it's always zero data received back.

Can anyone give me a hand?

praba
Hi,

I want to send and receive files through Bluetooth from MINI6410. So I've
tried to use Bluetooth dongle through the RS232 port of the mini6410. But
the android OS does not detected that Bluetooth. if turn on the Bluetooth
it is not working.

How to solve that, please help.


Thanks,
praba

Prabha
Hi,

Is there any link, where I can find sample android application for UART
communication? Where I can find list of API's which are used in serial port
communication.


Thanks,
Prabha.