How can I check USB device in Android-x86 console?

3,101 views
Skip to first unread message

allankliu

unread,
Mar 13, 2012, 8:12:39 AM3/13/12
to Android-x86
I am trying to setup a custom demo which similiar to
Misslelauncher.apk. It is a demo apk from Android SDK, which
demonstrates USB host API to trigger a toy USB misslelanucher. The
demo works for Android 3.1 or later. Android works as USB host and
select and communicate expected USB device in user app.

I want to change it to support other USB device like FTDI USB/UART CDC
bridge IC.

Because I have no new Android Tablet at hand, I have to test it on
real tablet later though. Anyway, I want to evaluate/develop my app on
Android-x86 platform in VirtualBox or a Physical PC.

If I am correct, USB driver is moved to user space, USB host manager
should be able to talk to USB device without hacking kernel. However,
when I plug-in the USB devices, including thumbdrive, USB/UART
converter, Arduino board. Nothing happened, no matter in VirtualBox
(nevertheless, I have enable USB support for guest PC and filter the
device to guest) or Physical PC.

No popup notification. I checked it with:

lsusb

Nothing at all!

How can I start to get it work? Which Tablet/Mobile is suitable for
such application?

Ketut Putu Kumajaya

unread,
Mar 13, 2012, 12:40:14 PM3/13/12
to andro...@googlegroups.com

If I am correct, Arduino using FTDI chip. For FTDI serial support, you need ftdi_sio kernel module. After modprobe ftdi_sio, you can access a serial device over /dev/ttyUSB0. Good luck!

Ketut P. Kumajaya

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-x86...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.

20120314063746.png

allankliu

unread,
Mar 13, 2012, 8:10:21 PM3/13/12
to Android-x86
Thanks, Ketut.

Very nice! Where can I find a ftdi_sio.so? Build from source code?

It seems a dmesg output. Actually in my VirtualBox/Android-x86 setup,
I also find some USB classes are supported already, including ACM/CDC,
GSM and HID.

I know kernel hacking always makes things work. However, I don't want
to hack the kernel. Because this approach is only suitable for
engineers/hackers, not for consumers. As Google stated, the USB driver
has been moved to user space. And in Android 3.1+, the USB host can do
a lot of job. (http://developer.android.com/guide/topics/usb/
host.html)

Based upon this information, an apk should be able to discovery,
enumerate and communicate with an external USB device (like FTDI
bridge IC) via its USB host/OTG port. Since Android-x86 has USB host
by default, theoritically it should be able to archieve the purpose.
But I don't know how to access the USB information in console shell,
just in order to make sure Android has found the new device. The
regular command 'lsusb' shows nothing at all. BTW, lsusb is build into
busybox in Android.

Thanks for your time and reply, anyway.

Yours sincerely
Allan K Liu



On Mar 14, 12:40 am, Ketut Putu Kumajaya <ketut.kumaj...@gmail.com>
wrote:
> If I am correct, Arduino using FTDI chip. For FTDI serial support, you need
> ftdi_sio kernel module. After modprobe ftdi_sio, you can access a serial
> device over /dev/ttyUSB0. Good luck!
>
> Ketut P. Kumajaya
>  20120314063746.png
> 113KViewDownload- Hide quoted text -
>
> - Show quoted text -

allankliu

unread,
Mar 13, 2012, 8:19:43 PM3/13/12
to Android-x86
It seems everything should work without rooting system. Check this
please.

http://android.serverbox.ch/

Yours sincerely
Allan K Liu

On Mar 14, 12:40 am, Ketut Putu Kumajaya <ketut.kumaj...@gmail.com>
wrote:
> If I am correct, Arduino using FTDI chip. For FTDI serial support, you need
> ftdi_sio kernel module. After modprobe ftdi_sio, you can access a serial
> device over /dev/ttyUSB0. Good luck!
>
> Ketut P. Kumajaya

Bocar Ndiaye

unread,
Mar 13, 2012, 8:19:52 PM3/13/12
to andro...@googlegroups.com

Hi Allan,
Usb connection for arduino and other devices will be a very usufull feature for androidx86.
Bocar

Chih-Wei Huang

unread,
Mar 13, 2012, 9:07:28 PM3/13/12
to andro...@googlegroups.com
2012/3/14 allankliu <alla...@gmail.com>:

> Thanks, Ketut.
> Very nice! Where can I find a ftdi_sio.so? Build from source code?
> It seems a dmesg output. Actually in my VirtualBox/Android-x86 setup,
> I also find some USB classes are supported already, including ACM/CDC,
> GSM and HID.
>
> I know kernel hacking always makes things work. However, I don't want
> to hack the kernel. Because this approach is only suitable for
> engineers/hackers, not for consumers. As Google stated, the USB driver
> has been moved to user space. And in Android 3.1+, the USB host can do
> a lot of job. (http://developer.android.com/guide/topics/usb/
> host.html)

You probably misunderstood something.
You always need kernel support.
Without the kernel driver you can do nothing.
(that's why your lsusb is empty)
Google's doc doesn't (need to) mention that
because it's assumed. Phone vendors
have enable that in their shipped kernel.

As Ketut said, you probably need ftdi-sio driver
(or other driver depends on your hardware).
The driver may not be enabled in your kernel
so you are on your own.


--
Chih-Wei
Android-x86 project
http://www.android-x86.org

allankliu

unread,
Mar 13, 2012, 10:04:58 PM3/13/12
to Android-x86
Thanks, Chih-Wei,

As you said, I have to root Android-x86, build ftdi-sio.ko and
modprobe it.

Then it is only suitable for hackable hardware. A little bit
depressed.

I am using Android-x86-v3.2-eeepc, do you have any idea for anything
related to USB pre-built by default with kernel, which I can use
directly? It could be generic, like HID, CDC that can be used for
general purpose communication.

Yours sincerely
Allan K Liu

On Mar 14, 9:07 am, Chih-Wei Huang <cwhu...@android-x86.org> wrote:
> 2012/3/14 allankliu <allank...@gmail.com>:

allankliu

unread,
Mar 13, 2012, 10:23:04 PM3/13/12
to Android-x86
Dear Chih-Wei,

One more question. I guess MSD should be enabled in kernel to support
USB memory stick. Why I can not see it from lsusb command, anyway?

Chih-Wei Huang

unread,
Mar 13, 2012, 11:09:11 PM3/13/12
to andro...@googlegroups.com
2012/3/14 allankliu <alla...@gmail.com>:

> As you said, I have to root Android-x86, build ftdi-sio.ko and
> modprobe it.
>
> Then it is only suitable for hackable hardware. A little bit
> depressed.

Oh, we are hacking it, this is the goal of this project.

As said, on android phones the vendors have prepared
all environment for you. You just need to follow Google's doc
to do the coding.

For android-x86, we are playing the role of phone vendors.
Ideally we should prepare the same environment like phones,
but in the real world there are too many peripherals to be supported.
It's impossible to provide a "universal image" to support all.
(though there are some discussion about this topic recently)

Unfortunately, as I've checked, none of the prebuilt image
we provided supports ftdi-sio.
But it's not that difficult. Just follow the CustomizeKernel doc
in our website to build your own image with the drivers
you need.

> I am using Android-x86-v3.2-eeepc, do you have any idea for anything
> related to USB pre-built by default with kernel, which I can use
> directly? It could be generic, like HID, CDC that can be used for
> general purpose communication.

That depends on what peripherals you want to use.
For touchscreen, some have been supported
by hid-multitouch drivers, some may not.
For camera, uvcamera is supported.

allankliu

unread,
Mar 13, 2012, 11:55:29 PM3/13/12
to Android-x86
Dear Chih-wei,

Thanks for your comments and time. I will go through the ftdi_sio.ko
building......

Yours sincerely

Allan K Liu

On 3月14日, 上午11时09分, Chih-Wei Huang <cwhu...@android-x86.org> wrote:
> 2012/3/14 allankliu <allank...@gmail.com>:
>

allankliu

unread,
Mar 14, 2012, 12:04:30 AM3/14/12
to Android-x86
Dear Chih-Wei

I checked Android-x86 in VirtualBox.

dmesg | grep "usb"

...usbcore: registered new interface driver usbserial
...usbserial: USB Serial Driver Core

lsmod | grep "usb"

usbserial 23303 2 option, usb_wwan, Live 0xd0909000

Does it mean USBserial is supported already? Just not for FTDI?

Yours sincerely

Allan K Liu

On 3月14日, 上午11时09分, Chih-Wei Huang <cwhu...@android-x86.org> wrote:
> 2012/3/14 allankliu <allank...@gmail.com>:
>

Chih-Wei Huang

unread,
Mar 14, 2012, 3:26:17 AM3/14/12
to andro...@googlegroups.com
2012/3/14 allankliu <alla...@gmail.com>:

> I checked Android-x86 in VirtualBox.
>
> dmesg | grep "usb"
>
> ...usbcore: registered new interface driver usbserial
> ...usbserial: USB Serial Driver Core
>
> lsmod | grep "usb"
>
> usbserial 23303 2 option, usb_wwan, Live 0xd0909000
>
> Does it mean USBserial is supported already? Just not for FTDI?

Yes, usbserial is enabled, but no ftdi.

Ketut Putu Kumajaya

unread,
Mar 14, 2012, 3:38:10 AM3/14/12
to andro...@googlegroups.com

Bocar Ndiaye

unread,
Mar 14, 2012, 10:12:12 PM3/14/12
to andro...@googlegroups.com

Glad to see some progress on usb, ftdi features for androids x86. Hopefully I'll be really interested on android x86 ICS interacting with android accessories adk board like the ioio or arduino board. So far ketut work is the closest I know of that goal. Thanks and good work :-)
Bocar

Ketut Putu Kumajaya

unread,
Mar 15, 2012, 7:15:38 PM3/15/12
to andro...@googlegroups.com

Search Slick USB in Market/Play. The demo version can connect to my FTDI serial converter without ftdi_sio kernel module. Not tested to communicate to real serial device yet, will try it soon.

Ketut Putu Kumajaya

unread,
Mar 15, 2012, 11:50:26 PM3/15/12
to andro...@googlegroups.com

Slick USB 2 Serial Terminal confirmed works! Tested using FTDI and Prolific base USB serial converter to access my Wavecom Fastrack modem over serial connection. Android-x86 USB Host API also confirmed works!

20120316103343.png

Bocar Ndiaye

unread,
Mar 16, 2012, 7:52:30 AM3/16/12
to andro...@googlegroups.com

Great!!,
Thanks Ketut for the info and testing. I will test on anduino boards and ioio board and think of some hacking ideas.
Bocar

Ketut Putu Kumajaya

unread,
Mar 17, 2012, 8:40:41 AM3/17/12
to andro...@googlegroups.com

I hope someone create a free or better open source implementation of Slick USB Serial library since Slick cost too high (US$99). I think someday we can access a HART/MODBUS/PROFIBUS device, or a PLC using Android. I have to learn Java and Android programming then :D

allankliu

unread,
Mar 18, 2012, 9:10:56 PM3/18/12
to Android-x86
Hi, Ketut

As the person who pops up the question, I cross-checked this groups as
well as another site dedicated for this topic (android.serverbox.ch).
It states that 'soft'-driver can be implemented based on USB host API
for Android OS v3.1+ without rooting. And they claimed even kernel of
FTDI is loaded, it should be removed before application started,
because app can not get the permission from kernel claimed devices.
(That is another confuse for me, not proved yet. Maybe you can have a
try)

At very beginning, I just confused by 'lsusb' under Android-x86
console. I though lsusb should see every device on bus. However, it
sees nothing at all. I was misguided.

Now I can conclude:
1) USB host API for Android OS 3.1+ can talk devices without hacking,
rooting, JNI and etc. (for CONTROL/BULK so far)
2) 'lsusb' doesn't work anyway in Android-x86, no matter what has been
pluged or removed
3) FTDI is not supported by kernel by default. Although it still
confused me that usbserial should be able to see it.
4) Google's Adbtest/MissleLauncher USB host API demos work on Android-
x86. It is an interesting demo since two Android devices are
connected, which bring up a lot of more ideas for me, such as file
sharing & etc.
5) FTDI and Arduino UNO USB host API demos work on Android-x86.
6) Other devices like PL2302, CDC, custom HID should work. Great news
for embedded programming and automation market.

They are open source projects.

Anyway. Forget hacking kernel, we can use USB host API now.

Yours sincerely
Allan K Liu

On Mar 17, 8:40 pm, Ketut Putu Kumajaya <ketut.kumaj...@gmail.com>
wrote:
> I hope someone create a free or better open source implementation of Slick
> USB Serial library since Slick cost too high (US$99). I think someday we
> can access a HART/MODBUS/PROFIBUS device, or a PLC using Android. I have to
> learn Java and Android programming then :D
> Pada 16 Mar 2012 18:52, "Bocar Ndiaye" <bocar2...@gmail.com> menulis:
>
>
>
> > Great!!,
> > Thanks Ketut for the info and testing. I will test on anduino boards and
> > ioio board and think of some hacking ideas.
> > Bocar
> > On Mar 15, 2012 11:50 PM, "Ketut Putu Kumajaya" <ketut.kumaj...@gmail.com>
> > wrote:
>
> >> Slick USB 2 Serial Terminal confirmed works! Tested using FTDI and
> >> Prolific base USB serial converter to access my Wavecom Fastrack modem over
> >> serial connection. Android-x86 USB Host API also confirmed works!
> >> On Mar 16, 2012 6:15 AM, "Ketut Putu Kumajaya" <ketut.kumaj...@gmail.com>
> >> wrote:
>
> >>> Search Slick USB in Market/Play. The demo version can connect to my FTDI
> >>> serial converter without ftdi_sio kernel module. Not tested to communicate
> >>> to real serial device yet, will try it soon.
> >>> Pada 15 Mar 2012 09:12, "Bocar Ndiaye" <bocar2...@gmail.com> menulis:
>
> >>>> Glad to see some progress on usb, ftdi features for androids x86.
> >>>> Hopefully I'll be really interested on android x86 ICS interacting with
> >>>> android accessories adk board like the ioio or arduino board. So far ketut
> >>>> work is the closest I know of that goal. Thanks and good work :-)
> >>>> Bocar
> >>>> On Mar 14, 2012 3:26 AM, "Chih-Wei Huang" <cwhu...@android-x86.org>
> >>>> wrote:
>
> >>>>> 2012/3/14 allankliu <allank...@gmail.com>:
> >http://groups.google.com/group/android-x86?hl=en.- Hide quoted text -

Bocar Ndiaye

unread,
Mar 19, 2012, 2:34:54 PM3/19/12
to andro...@googlegroups.com
Thanks Allan Ki Lu,
very informative email and links,
will try it and see how its would work out arduino and IOIO board.
Bocar
Reply all
Reply to author
Forward
0 new messages