Android ADB and the Due - my home HVAC project

Hello,

I've been working on an interpretation of the common arduino project: the home thermostat / HVAC control. I am inspired by many projects of this nature, especially the one over at http://androidthermostat.com which uses the IOIO board. I really like that project and originally intended to just implement it as-is. I have four old, unused android devices and two of them have front-facing cameras. When used as the thermostat control device, I also gain the ability to use that front-facing camera as a security camera. The more I thought about it though, one thing kept bugging me: the android device is a pretty large point of failure. Not only will I be using older devices which could theoretically have expiration dates coming up any day... but streaming camera data over wifi at a semi-constant rate just adds to the potential for device failure. Perhaps not a permanent failure... but I don't want to rely on it to directly control the HVAC. That said, I really like the interface capability, the built-in wifi and BT radios, and of course the camera of the android device, so moving to an arduino-only solution isn't a good option.

So, I need an autonomous device that can handle switching on/off the HVAC without relying on the Android device but still takes commands from the Android. Enter the Due. It has native USB capability and some other fancy new features for a price point that is right on par with an Uno + USB host shield. Since I'll be stacking a custom relay/temp sensor board as part of the HVAC control, having the USB host onboard means the Due fits a lot better in my planned enclosure than an Uno + host shield would. It also doesn't hurt that Google picked the Due as the base for their new ADK device. Although it's currently immature, I expect support for the new Due-based ADK to really blossom over the next year or two. It's exactly that immaturity, however, that is making this a tough project. To add to the pain, the devices I'm using are Samsung Epic 4G (not touch) and do not natively support USB accessory mode. That limits what I can do when communicating with the arduino.

I found a project called Microbridge which enables arduino devices to communicate over USB with nearly all android devices, without respect to USB accessory mode support. It uses ADB instead, and works on just about every Android device out there. Of course, it was developed in 2011 and targets the USB host shield and AVR based arduinos specifically. The libraries include the old wiring.h (and does not use the core USB Host libraries/API) so it's not even compatible as-is with the new 1.0+ Arduino core. It does not appear to be actively maintained and even if it was, the Due is so new that I wouldn't expect its new style of USB host libraries to be supported any time soon.

Now, the reason for this post: Has anyone had success implementing anything like this? Specifically, ADB using the new USB Host libraries? I've done lots of searching but come up dry... I figured that before I go reinvent the wheel I should at least ask and see if someone else is already going down this path. Crossing my fingers and hoping someone has :slight_smile:

If nobody has specifically worked on ADB with the Due (yet), then perhaps someone has some better documentation on the core USBHost library?