Android & UART

15 1389
Hi everyone and thanks for this board that helped a lot.

I'm a proud new owner of LeMaker Guitar Rev B running Android.

Now, I have some issues regarding the communication through UART with a Raspberry Pi running Raspbian.

On Raspbian, UART is working (tested with an Arduino, too many eval boards on one table!).

I can't get the pins 8 & 10 to work.

I tried to install WiringLMK but it doesn't work on Android. I tried sysfs, but couldn't find the proper tty related to those PINs.

I don't want to use the DEBUG UART on the 6 pins next to Ethernet.

Can I have a bit of help or something that could guide me ?

More precisions :

I have a Lemaker Guitar Package A : Basic Developer including :
- Lemaker Guitar + Lemaker Guitar Base Board Rev. B
- Android 5.1.1 with Kernel 3.10.37

SSH is working if needed.

Thanks everyone!

Best regards,
Gautier  here is something about how to use GPIO, SPI, I2C on Guitar under Android. But it do not tell how to use UART.

I do not know if you can change code to enable the UART.
Here is the source code for the JNI library:

Hi tony_zhang, and thank you for your answer

I actually have been through all the wiki I think.

I don't want to use Java because at the end, this code will be a kernel module in Android as a driver for a UART Touchscreen that I am developing during my internship.

In fact, the link you just gave me will work in an app, and I want it to work in the whole Android system. I may not have been clear about that point.

Anyway, thanks for your answer, I really appreciate that.


OK. To make the pin8 & 10 work, please first check the sex file in the source code: ... aker/sys_config.fex
It seems it do not open the part function.

Hi tony,

Thanks for your answer.

How can I use this file ? It is not present in the source code in android-actions on your github (

Thanks again for your answer.

Here what I found so far :

I was wondering why is it enabled on linux and not android.

In /proc/device-tree :

serial@b0120000 is "okay" for Linux but "disabled" on Android.
But in .dts, both of them are okay : ... aker_guitar_bbb.dts (line 404).

For those who are looking for it - and since Lemaker has not answered any of my calls and emails regarding this issue.

The device tree compiled on the prebuilt Android image provided by Lemaker disabled the ttyS0 - UART0.
(I still don't know why...).

In order to solve it, you need to change the device-tree.
It is located at /misc/kernel.dtb.

You need to uncompile it, export it (using device-tree-compiler, ie. dtc).
And then change the "disabled" to "okay" behind serial@0b120000.
Then compile it again and send it back to /misc (you might need to remount the partition in read-write, don't forget to remount in read-only afterwards).

Hope it helps.

GautierD replied at May 27, 2016 08:19
Hi tony,

Thanks for your answer.

OK. Sorry, you use the Guitar plateform. So you need modify the DTS file of the guitar. I do not know the exact file name of the guitar dts for android.

Yes, as I said just above you, I finally found that.

Thank you for your (late) help.

May I know why Android is installed on eMMC by default ?

Edited by GRAVITY at Dec 02, 2016 13:18

Hi everyone.
I need to use uart on ttyS0.
I use simple uart to test uart communication and whats the problem:

receive is already working good - bytes successfully received.
but transmit is not working - no bytes sends from board.

i try to use and everything is pretty work on receive, but not working on send bytes from guitar.

i try to use usb to ttl: and everything is pretty work on receive, but still not working on send bytes from guitar.

can you help me, please ?

i use last android builded from last sources from git.

You have to log in before you can reply Login | Sign Up

Points Rules