Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

suggested protocol for android-arduino communication

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

like image 470
mustang Avatar asked Nov 05 '12 01:11

mustang


1 Answers

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,

like image 88
Anders R. Bystrup Avatar answered Sep 30 '22 00:09

Anders R. Bystrup