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

Community
  • 1
  • 1
mustang
  • 151
  • 3
  • 9

3 Answers3

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,

Anders R. Bystrup
  • 15,729
  • 10
  • 59
  • 55
  • 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! – mustang Nov 09 '12 at 23:05
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.

Sudar
  • 18,954
  • 30
  • 85
  • 131
  • 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. – mustang Nov 08 '12 at 20:06
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

Joe Speed
  • 106
  • 1
  • 3