Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => A20 => Topic started by: micropad on February 25, 2015, 12:15:22 PM

Title: A20 tools and gpio/uart on android
Post by: micropad on February 25, 2015, 12:15:22 PM
Hi,

i try to work with the A20-tools but every time i launch the app, it crash..

How i can use the gpio under androd?

thanks

Title: Re: A20 tools and gpio/uart on android
Post by: dave-at-axon on February 25, 2015, 06:45:17 PM
Try these downloads. They give you GPIO and I2C in Android. You need to make some small changes and make sure you have the Android NDK installed.

http://www.axoninstruments.biz/download/gpio/gpio-JavaSource.zip

http://www.axoninstruments.biz/download/gpio/GPIO-JNI.zip

http://www.axoninstruments.biz/download/gpio/sample.zip
Title: Re: A20 tools and gpio/uart on android
Post by: deskwizard on February 25, 2015, 11:15:47 PM
+1 for Dave's implementation, the GPIO works like a charm, I'm sure the I2C works just as well

Don't forget to have your GPIO exported and permissions set to 777 on "value" and "direction" before using it, took me a while... ;)

DW

Edited for clarity.
Title: Re: A20 tools and gpio/uart on android
Post by: deskwizard on February 25, 2015, 11:21:09 PM
As for UART, I often use the APK called "COM port API Sample", so I would have a look at: https://code.google.com/p/android-serialport-api/ if I had to do UART

DW
Title: Re: A20 tools and gpio/uart on android
Post by: dave-at-axon on February 26, 2015, 04:28:02 AM
I'll second the serial port API that DW linked to.

I even have this working with the Modbus Java source I found on the net.
Title: Re: A20 tools and gpio/uart on android
Post by: micropad on February 26, 2015, 01:16:30 PM
thanks, i will try it later,

QuoteI even have this working with the Modbus Java source I found on the net.

Can you give me the link for that? modbus is the next step for me!


Title: Re: A20 tools and gpio/uart on android
Post by: dave-at-axon on February 26, 2015, 03:04:13 PM
Quote from: micropad on February 26, 2015, 01:16:30 PM
Can you give me the link for that? modbus is the next step for me!

http://sourceforge.net/projects/modbus4j/

It's designed for standard Linux so you need to Modify the Serial part to use the SerialPort API. The TCP/IP just works out of the box.
Title: Re: A20 tools and gpio/uart on android
Post by: djdance on July 05, 2016, 11:03:48 PM
Quote from: deskwizard on February 25, 2015, 11:21:09 PM
As for UART, I often use the APK called "COM port API Sample", so I would have a look at: https://code.google.com/p/android-serialport-api/ if I had to do UART

DW

Hello, please can you provide an example of UART, implemented with "COM port API Sample" ? (I also used it, but can not figure how to make UART)