suggested protocol for android-arduino communication
Asked Answered
L

3

8

Using the Android Open Accessory standard, I have an android powered device talking back and forth with an arduino mega ADK microcontroller hooked up via USB. I would like to know what the best communication protocol is at the data link layer level.

From the android & arduino sides, it is simple file based IO e.g. write(buffer[], buffer_length), read(buffer[], buffer_length).

Doing some research, I came across this link entitled "simple serial point-to-point communication protocol" that recommends using the HDLC protocol. Would that be a good protocol to run with or is there something better?

Thank you

Lutenist answered 5/11, 2012 at 1:15 Comment(0)
S
2

It might be completely overkill to you, but I have successfully used MQTT to communicate from an Arduino (over ethernet) to an ActiveMQ broker (this is likely where the overkill would happen in your case).

I will try to dig out some source code later today.

Edit: I found this resource on Android/MQTT, which may be handy to you.

Cheers,

Sisile answered 8/11, 2012 at 11:16 Comment(1)
Thanks Ander. I'm not sure if MQTT is the right fit for me as it is geared high latency networks for multiple devices. QoS isn't really that big a deal to me and a pub/sub based protocol might be too much for point-to-point communication. I appreciate your input though. Cool work too btw!Lutenist
P
1

There are lot of ways by which you can make an Android and Arduino talk to each other. Check out this presentation for some suggested ways.

If you could give your specific requirements, then I can suggested you the best protocol.

Pituri answered 8/11, 2012 at 10:50 Comment(1)
Thanks Sudar. Your presentation talks about communication at the physical layer. I'm interested in a protocol below that now that I have them already connected via USB.Lutenist
C
1

Detailed guide to using MQTT on Aurduino http://www.redbooks.ibm.com/abstracts/redp4929.html

MQTT client for Aurdino http://knolleary.net/arduino-client-for-mqtt/

And there is tons of info re MQTT on Android here http://mqtt.org/wiki/mqtt_on_the_android_platform

Colchicine answered 14/11, 2012 at 6:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.