4

I've been working on developing an Android application that will act as a host to an Arduino based Digispark development board. One of the problems with the board is that it doesn't have a dedicated USB controller, instead it uses a software implementation of the low speed USB bus.

That being said, when I connect the Digispark to my Droid Bionic, I am able to see the device using both enumeration in my own application, and also through the use of the USB host controller application. This seems to be half of the battle.

What I'm stuck on right now is this the following. When I connect the Digispark and try to run my application, the enumeration comes back with multiple devices matching the same VID and PID. I don't see how it's possible, but here is an example of my code and the output I've been getting:

Code

UsbDevice anyDevice;
while(deviceIterator.hasNext()){
    anyDevice = deviceIterator.next();
    if(anyDevice.getVendorId() == 5824 && anyDevice.getProductId() == 1503){
        device = anyDevice;
        Log.d(TAG, "vid and pid " + anyDevice.getVendorId() + " " + anyDevice.getProductId());
        Log.d(TAG, "? " + anyDevice.getDeviceName());
        Log.d(TAG, "? " + anyDevice.getDeviceId());
        Log.d(TAG, "? " + anyDevice.getInterface(0).getEndpoint(0));
        Log.d(TAG, "DIGI FOUND");
    }
}
Log.i(TAG," No more devices connected.");

Eclipse Log Output

03-28 19:32:40.773: D/USBTest(6228): vid and pid 5824 1503
03-28 19:32:40.773: D/USBTest(6228): ? /dev/bus/usb/003/003
03-28 19:32:40.773: D/USBTest(6228): ? 3003
03-28 19:32:40.773: D/USBTest(6228): ? UsbEndpoint[mAddress=129,mAttributes=3,mMaxPacketSize=8,mInterval=10]
03-28 19:32:40.773: D/USBTest(6228): DIGI FOUND
03-28 19:32:40.773: D/USBTest(6228): vid and pid 5824 1503
03-28 19:32:40.773: D/USBTest(6228): ? /dev/bus/usb/003/005
03-28 19:32:40.773: D/USBTest(6228): ? 3005
03-28 19:32:40.773: D/USBTest(6228): ? UsbEndpoint[mAddress=129,mAttributes=3,mMaxPacketSize=8,mInterval=10]
03-28 19:32:40.773: D/USBTest(6228): DIGI FOUND
03-28 19:32:40.773: D/USBTest(6228): vid and pid 5824 1503
03-28 19:32:40.773: D/USBTest(6228): ? /dev/bus/usb/003/015
03-28 19:32:40.773: D/USBTest(6228): ? 3015
03-28 19:32:40.773: D/USBTest(6228): ? UsbEndpoint[mAddress=129,mAttributes=3,mMaxPacketSize=8,mInterval=10]
03-28 19:32:40.773: D/USBTest(6228): DIGI FOUND
03-28 19:32:40.773: I/USBTest(6228):  No more devices connected.

Is this a software issue with the Digispark and Android combination, or an error thanks to my poor software skills?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • AFAIK the Digispark like all other virtual USB devices has a period where it acts in one mode, then switches to a different mode, perhaps this is the issue? – unknowndomain Nov 28 '13 at 01:10

0 Answers0