Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using 3.1's USB host mode with Arduino

Is there a good tutorial for using an Arduino with an Android where the Android device is the USB host? (The Android device has OS version 3.1 (Honeycomb) or later). The only host program on the developer site is the missile launcher, which seems far simpler than interfacing with an Arduino would be.

Specifics: I'm trying to make an Asus Transformer host an Arduino Uno, but since there is very little information on how the Android host mode works, I'm lost on where to start. I just need the Android to be able to read data values out of the Arduino's memory. The Arduino is being used to count the frequency of a signal, that value then needs to be passed to the Android. If I've missed some simple way of doing this, feel free to let me know.

(There is a lot of information floating around about using the ADK to make the Arduino the host, but with the Transformer, that isn't an option - see Stack Overflow question Is it possible to get the Android ADK working on an ASUS Eee Pad Transformer running 3.1?.

The information doesn't really need to be Transformer or Uno specific, I just can't seem to find examples of people using the new host mode on their tablets.

like image 280
Joe Avatar asked Aug 02 '11 15:08

Joe


People also ask

Can Arduino be USB host?

The USBHost library allows an Arduino Due board to appear as a USB host, enabling it to communicate with peripherals like USB mice and keyboards. USBHost does not support devices that are connected through USB hubs. This includes some keyboards that have an internal hub.

What is host mode in USB?

In USB host mode, the Android-powered device acts as the host. Examples of devices include digital cameras, keyboards, mice, and game controllers. USB devices that are designed for a wide range of applications and environments can still interact with Android applications that can correctly communicate with the device.


2 Answers

We got FTDI communcations working, without a kernel driver, using this code: http://android.serverbox.ch/?p=370

Note that the Samsung Galaxy Tab 10.1 seems to lack the proper USB code to even detect USB devices (aside from mouse, keyboard, hub, and storage, which are detected by the OS and not passed to applications).

However, we got this working on an Acer A500.

like image 62
Taylor Alexander Avatar answered Oct 15 '22 23:10

Taylor Alexander


The arduino uno drops the FTDI or similar usb-rs232 chip used on previous designs in favor of a re-programmable USB interface based on the LUFA stack.

With a normal linux you would use USB CDC drivers - so a question would be if the honeycomb tablet ships with these.

The Honeycomb USB host support seems to provide a means of writing low-level usb drivers in 3rd party userspace android applications, so presumably if the functionality is not already in the kernel it could be added in userspace.

Another idea would be to change the LUFA installation on the arduino, reconfiguring it to one of the many other modes supported by the LUFA project so that it looks like something an unmodified honeycomb tablet already knows how to talk to, such as a mass storage drive, or a keyboard, or a mouse, etc. You might however need root-level access on the honeycomb tablet if you want to do low-level (especially write) access to this system peripheral.

like image 36
Chris Stratton Avatar answered Oct 16 '22 01:10

Chris Stratton