1

I'm just starting on some development using the android accessory protocol. I have sourced a starters kit (microchip) to get familiar with the environment. I should note that I' have a solid background in embedded C, but not really in Android / Java.

The kit connects using USB, so I have configured my phone to use ADB over Wifi, which works great. I compile the app and can debug in the phone just fine. However, it will not recognize when the accessory is connected to the USB port. When I stop the wireless ADB, the app will recognize the accessory just fine and works as it should.

I have a hard time finding out whether this is expected behavior or not, but as it would stop any debugging on an app communicating with a USB accessory I doubt it and suspect I am doing something wrong.

I use a Galaxy S3 I9300 rooted, and microchip's Accessory Development Starters Kit and provided samples.

David
  • 15,894
  • 22
  • 55
  • 66
johans
  • 11
  • 3
  • http://stackoverflow.com/questions/14791583/android-adb-wireless-debugging-with-usb-accessory/14884359#14884359 – TronicZomB May 30 '13 at 20:19
  • I found the link above before, but it does not answer the question. The debugger is still running, it just does not connect to the USB accessory. – johans Jun 05 '13 at 01:07
  • http://android.stackexchange.com/questions/46342/using-usb-peripherals-with-hardware-debug/46343#46343 – TronicZomB Jun 05 '13 at 01:12
  • I'm sorry, maybe my question is confusing. But the links you provide show how to get an ADB connection running over TCPIP, but that's not my problem. My problem is that when I'm debugging my application (over TCPIP), it did not connect to the USB accessory that I plug into the phone. Correct me if I'm wrong though? – johans Jun 05 '13 at 01:26
  • That seems to be a problem with your manifest or broadcast receiver then... – TronicZomB Jun 05 '13 at 13:29

2 Answers2

1

ADB-over-wifi does disconnect after an accessory is connected. To mediate that, switch the phone to accessory mode and after that connect the ADB-over-wifi. That way eclipse can reconnect to the debugging session. Another way is to run a shell a shell script in the background that will infinitely connect the ADB-over-wifi. I did not find more elegant ways to solve this problem.

user3913439
  • 396
  • 1
  • 10
0

Ok. it seems to be related to the "USB Debugging" option in the developer options. When I disable it, it works as expected.

I have not been able to try it on lots of different phones but on the 2 I have access to this seems to be consistent (Galaxy S3 and HTC One).

I can't find any specifics on this behavior on the net though.

johans
  • 11
  • 3