Search code examples
androidusbarduinoadk

Can't connect arduino mega ADK board using USB host


I tried to connect an Arduino Mega ADK using Demokit sources to several phones in vain.

I compiled and upload the Arduino sketch "Demokit.pde" with arduino 0022. It looks ok as the board sends "start" on its usb client port.

I compiled Demokit app under Eclipse using Google API 10 (for phones running Gingerbread) and Android API 15 (for ICS ones). Everything fine.

On the phone side, I tried these setups :

  • samsung i9000 running CM 7.1 and after pushing android.hardware.usb.accessory.xml and com.android.future.usb.accessory.jar

  • samsung i9000 running ICS

  • nexus S running ICS

And nothing happened. There's only a warning in the eclipse logcat :

W/PowerUI(654): unknown intent: Intent { act=android.intent.action.ACTION_POWER_CONNECTED flg=0x10000010 }

Nothing else. I wonder if the board can have a problem on its usb host...

If anybody has an idea?

Thanks


Solution

  • The problem came from the setup procedure in the Demokit.pde sketch. I used a bread board to run it but I didn't connect all components and the i2c joystick initialization needs the component to be connected otherwise the procedure goes into an infinite loop. So if you try to run Demokit.pde without the demokit board be sure to connect the right joystick, or comment its init procedure call.