1

I have an ADK Kit from Google I/O 2011 and I am trying to get the example application to work (Available here: http://developer.android.com/tools/adk/adk.html).

I have programmed the firmware and device as instructed, but cannot get the demo to work. The application starts, and detects the ADK board when plugged in, but then enters a loop in which the device connects then disconnects very rapidly, causing the UI Activity to keep restarting.

I have been debugging this for a few days, and have verified that the device gets an IOException in the run() method of DemoKitActivity.java which causes the thread to terminate, although I am unsure if this is caused by or the cause of the device disconnecting.

The exception thrown is:

06-27 23:21:51.284: E/DemoKit(13573): There was an IO Exception
06-27 23:21:51.284: E/DemoKit(13573):   at libcore.io.IoBridge.read(IoBridge.java:435)
06-27 23:21:51.284: E/DemoKit(13573):   at java.io.FileInputStream.read(FileInputStream.java:179)
06-27 23:21:51.284: E/DemoKit(13573):   at java.io.InputStream.read(InputStream.java:163)
06-27 23:21:51.284: E/DemoKit(13573):   at com.google.android.DemoKit.DemoKitActivity.run(DemoKitActivity.java:278)
06-27 23:21:51.284: E/DemoKit(13573):   at java.lang.Thread.run(Thread.java:841)
06-27 23:21:51.284: E/DemoKit(13573): Caused by: libcore.io.ErrnoException: read failed: EIO (I/O error)
06-27 23:21:51.284: E/DemoKit(13573):   at libcore.io.Posix.readBytes(Native Method)
06-27 23:21:51.284: E/DemoKit(13573):   at libcore.io.Posix.read(Posix.java:127)
06-27 23:21:51.284: E/DemoKit(13573):   at libcore.io.BlockGuardOs.read(BlockGuardOs.java:149)
06-27 23:21:51.284: E/DemoKit(13573):   at libcore.io.IoBridge.read(IoBridge.java:425)

One possible quirk is that my device is set to communicate over PTP (Settings > Storage > Menu > USB Computer Connection > Camera (PTP).

I don't yet have much more information. I am hoping that someone can confirm that the example code provided by Google still works with the ADK, or can provide some insight into where to look next to debug the disconnections.

plexer
  • 4,542
  • 2
  • 23
  • 27

1 Answers1

0

I can confirm that the example ADK code works with both a Nexus 4 running 4.2.1 and a Galaxy Nexus running 4.0.4.

I've tried both using the Gingerbread compatibility API and using the API 12 classes on the Android DemoKit app successfully.

The ADK 2011 board that I have hasn't been used recently so while it worked with a ICS (4.0.4) device it wasn't working with the Nexus 4 with JB.

The following SO topic covers the issue with JB: ADK 1.0 devices fail to work with Jelly Bean, why?

Also the CapSense libraries have been renamed in the most recent download from the Arduino site. CapSense.h becomes CapacitorSensor.h and so on.

Otherwise I was able to install the new code onto the Arduino ADK board, install the app on the Android device and run the DemoKit app.

The Nexus 4 was also in PTP mode during my test so I don't that that is your problem.

I'm also assuming you got your logs via adb over wi-fi and not connecting it over usb as that cable should go into the ADK board. Other than making sure the ADK code is correct and perhaps trying it with a different USB cable or PC I don't have anything to suggest. While I did see some errors in the log for one test session, a reset of the ADK and app cleared it up. For reference here is my logcat from a working session hope it can help.

07-06 23:01:02.364 I/ActivityManager(  575): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.google.android.DemoKit/.DemoKitLaunch} from pid 899
07-06 23:01:02.404 I/ActivityManager(  575): Start proc com.google.android.DemoKit for activity com.google.android.DemoKit/.DemoKitLaunch: pid=8715 uid=10110 gids={50110, 1028}
07-06 23:01:02.495 I/DemoKitLaunch( 8715): starting phone ui
07-06 23:01:02.925 D/DemoKit ( 8715): accessory opened 
07-06 23:01:03.185 I/ActivityManager(  575): Displayed com.google.android.DemoKit/.DemoKitPhone: +692ms (total +795ms)
07-06 23:01:35.690 D/UsbDeviceManager(  575): entering USB accessory mode: UsbAccessory[mManufacturer=Google, Inc., mModel=DemoKit, mDescription=DemoKit Arduino Board, mVersion=1.0, mUri=http://www.android.com, mSerial=0000000012345678]
07-06 23:01:35.690 I/ActivityManager(  575): START u0 {flg=0x10000000 cmp=com.android.systemui/.usb.UsbConfirmActivity (has extras)} from pid 575
07-06 23:01:35.860 I/ActivityManager(  575): Displayed com.android.systemui/.usb.UsbConfirmActivity: +64ms
07-06 23:01:37.782 I/ActivityManager(  575): START u0 {act=android.hardware.usb.action.USB_ACCESSORY_ATTACHED flg=0x10000000 cmp=com.google.android.DemoKit/.UsbAccessoryActivity (has extras)} from pid 748
07-06 23:01:37.912 I/DemoKitLaunch( 8715): starting phone ui
07-06 23:01:37.912 I/ActivityManager(  575): START u0 {flg=0x14000000 cmp=com.google.android.DemoKit/.DemoKitPhone} from pid 8715
07-06 23:01:38.022 D/DemoKit ( 8715): accessory opened
Community
  • 1
  • 1
Morrison Chang
  • 11,691
  • 3
  • 41
  • 77