What does Android logcat say when connecting Arduino ADK (ie. an "accessory")

Hi all. I'm connecting my Arduino (Mega ADK) to my Android device (Galaxy Nexus running CyanogenMod 10.1 Nightlies, based on Jelly Bean 4.2.1), and i'm having some issues.

Thus, I would like to ask from someone who actually has this Android USB Accessory stuff working, that is the output of the command

adb logcat -s UsbDeviceManager:*

Mine only says "exited USB accessory mode", and nothing else, when connecting and Arduino. On the Arduino serial monitor, i'm getting first a message that the Android is identified and supports protocol 1 and up, and then setup package error D on acc.isConnected(), when Arduino is trying to setup the file descriptors. I'm using the normal USB Host Shield libraries, not the 2.0 -flavour.

Thanks, i would really appreciate to see the logcat output of a normal, operating Android Accessory (=Arduino) handshake.

After more time spent with google, i can see i should expect to receive an entering USB accessory mode -message from UsbDeviceManager, f.ex. this question on StockExchange lists it.

D/UsbDeviceManager(  163): entering USB accessory mode: UsbAccessory[mManufacturer=Embedded Artists AB, mModel=AOA Board - Nodes, mDescription=Demo - AOA Nodes, mVersion=1.0, mUri=http://www.embeddedartists.com/_aoa/Demo_AOA_Nodes.apk, mSerial=N/A]

Aha, I managed to solve my issue, and now my Jelly Bean logcat gives the entering USB accessory mode -message, Android pops up the dialog for starting the registered app, and i can even confirm (using demo apps) that data is being passed between Arduino ADK and Android.

The core of the issue was that the Arduino USB Host Shield libraries are no longer compatible with new, Android Jelly Bean, and i installed first a beta version of the USB Host Shield libraries from Arduino.cc (which work, after some fiddling), and then I moved to the Circuits@Home USB Host Shield libraries version 2.0. Not a lot of information about the changes in JB accessory mode is available online, unfortunately, I hope someone with the same problem will find this forum and i'm willing to give more details and help out the best I can!

Woohoo!

hi, thank's for the post it's really help me. .
can you sent me an example like turn LED (arduino code and eclipse code)

thank's

Hi, i'm happy my monologue here has helped someone... well it's not a monologue since i feel i was talking to the future via Google and other search tools by publishing it :slight_smile:

Anyhow, my personal strategy has been to skip Android stuff for now, and concentrate on Arduino and electronics for the time being. Besides i ruined my Galaxy Nexus in a massive rain we had here in Helsinki, and haven't got a new Android device yet. Anyhow, what i did personally to

[...] and i can even confirm (using demo apps) that data is being passed between Arduino ADK and Android.

was by using the serial monitor with the AOA Android demo apps, and see stuff there when i was operating the demo app. I haven't built a working Android app that would work with Arduino over AOA, though i tried. I will come back to it at some later point in time.

Do you know how to build Android apps? That's a basic skill to learn, and then learn to use the USB Manager, and serial connection to push/receive data.

Hi Mace,
I read your posts and think what you wnet through can help me.
I have an Arduino(1.0.5 IDE) Mega ADK board and an Android 4.1.2 Sony Xperia Go with a working wifi connection to the internet.

I'm following the book "Professional AOA Programming with Arduino"... and all is fine(uploading sketches, Blinking Arduino's LED) until ... the Temperature sensor project, where the first connection with an Android is supposed to be established. The connection is through an usb cable.
The Android detects the Arduino but displays the message
"TITLE: Temperature Sensor
No installed applications work with this USB accessory. Learn more about this accessory athttp://media.wiley.com/product_ancillary/66/11184547/DOWNLOAD/t.apk"
So nothing happens. Though it is clear that the Arduino has transferred information, namely the Title and the referenced url address.

I thought that perhaps the t.apk could have a problem so I installed it on the mobile through the PC, connected the Arduino, the phone immediatly asked if I wanted to use the Temperature sensor app and proceeded to display the temperatures received from the Arduino!
I've also tried the USB Host version2 libraries and the sketch (USB_Host_Shield_2.0/ArduinoBlinkLED.ino at master · felis/USB_Host_Shield_2.0 · GitHub)
but in this case connecting the Android phone gives me no action at all!

I read that some Android phones do not connect to the Arduino Mega ADK, could this be my case, is this what is meant?
Am I to buy a new Android, or is there still hope for my Sony Xperia?
I hope there is hope!
Greetings!
Rui