Use ttyUSB host in Android Emulator

72 views
Skip to first unread message

Gabriel

unread,
Sep 21, 2016, 3:19:53 PM9/21/16
to android-porting
Hello, I am in the middle of a port of Android 6.0.1_R10 to a new hardware, and since I don't have a physical board yet I am using the emulator to test some features. One of them is sending some commands through a UART to an external chip (a bluetooth radio). I have the chip wired to the host PC through an FTDI converter. I can see it in the host computer as /dev/ttyUSB0, and I was able to send it commands using some linux tools so I know it works ok. Now I am trying to see the ttyUSB0 in the android emulator, according to the documentation starting the emulator with:

emulator -selinux disabled -qemu -serial /dev/ttyUSB0

I should be able to see /dev/ttyS2 in android that will be linked to my FTDI in the host computer, but I am unable to see anything.

I changed /dev/ttyUSB0 ownership to my user and also granted read, write and execution permissions to all groups.

I tried compiling for "aosp_x86_64-eng" and "mini_emulator_x86" both with the same results. As I said I am using android 6.0.1_R10 just downloaded from source.android without any changes.

I read some older threads and sites with people claiming this works, but always with older versions of android, and it was never clear if they changed something else in the code besides adding the qemu serial option to the emulator.
Any help in the right direction would be appreciated.

Ye Roger

unread,
Nov 14, 2016, 10:55:05 AM11/14/16
to android-porting
Suggest you isolate the issue into two piece. 1. Testing a normal serial connection with emulator and make sure it can work. 2. Replace the host interface with your /dev/ttyUSB0. You can refer to the below book for the emulator internal.



Reply all
Reply to author
Forward
0 new messages