Go Down

Topic: Arduino Due and ADK (Read 22585 times) previous topic - next topic


Hi everyone!

I hope someone can offer some guidance ... I am trying to run the Arduino Due ADK sample sketch from the Arduino Studio 1.5. My Setup is:
- Samsung Galaxy S with MIUI (Android version is 4.1.2)
- Arduino Due board -> ADK sample sketch uploaded
- The apk file mentioned in the sketch http://labs.arduino.cc/uploads/ADK/ArduinoTerminal/ThibaultTerminal_ICS_0001.apk uploaded to the phone
- home made USB cable (Micro USB to Micro USB, wired one to one (VCC to VCC, D+ to D+, D- to D-, GND to GND)

I cannot get the sample to work. Do I need a special cable (OTG)? Can something else be the reason?

Thanks, Tomaz


Did you cut two standard A to micro B cables in half and connect the micro B halves to each other? Then you have a B to B cable which does not work. You need a micro A to Micro B cable. The difference is that in the micro A end a fifth "ID" pin is connected to ground so that an otg capable device (here the due) can sense that it should start acting as a host. If it saw the B end of the cable with ID pin unconnected it would start acting as a device.

There are tutorials around there showing how you can open the plasic plug and connect the the ID pin to the adjacent GND pin, but that is a kludge. Best is to find a suitable cable.

The B to B cable could work too if you pull the the ID pin low from the due board, but someone from the developers should advise whether provisions are made to do this. The pin mapping mentions the ID pin is connected to PB11 on the sam, but is not broken out. Maybe it can be pulled down from software?


That is exactly what I have tried. Thank for pointing me in the right direction. I'll get an OTG cable and try it out.


If you get it working, do please report back -- Details would help future attempt-ers like me! Really looking forward to trying out ADK with the Due.


I have bought a few cables similar to these http://www.amazon.com/SANOXY-Female-On-The-Go-Adapter-Samsung/dp/B005GI2VMG/ for 1USD more or less and I used it to connect a few USB devices to the Due including my Nexus phone.

I know David cuartielles tried it with the Samsung tabled and he was able to try the ADK protocol on it.

so it's working if you have the right cable :)



I tried the ADK sample with the OTG cable with no luck.

The phone starts charging, but nothing else happens. The app on the phone states: No USB device found. And the Arduino Code does not go into if(adk.isReady()) { ... } section.


what code are you using?


The sample sketch for ADK from Arduino IDE 1.5 and the APK mentioned in the sketch.


I have the Due working with ADK using both the example sketch and an application I wrote originally for the Mega ADK. The example sketch was just to compile and upload, then the phone would pop up a window on connection, giving me the option to open the URL given by the accessory code.
I used a simple OTG cable connected to a normal USB charging cable to connect the Due to the phone.

It only worked on my HTC Desire S with CyanogenMod on it (Android 2.3.7 I think), the Google phone with Android 4 just started charging.

I'm having some trouble in my application too, spontaneous packet loss that I haven't had the time to figure out yet..


I'll try to get my hands on an Android 2.3.* phone and test it. Maybe this could be the reason?


Nov 06, 2012, 05:32 pm Last Edit: Nov 06, 2012, 05:35 pm by Sebastian Vik Reason: 1
It never occurred to me to try all of them before, but here goes:

HTCDesire S2.3.7, CyanogenMod 7.1Works
AsusTransformer Prime TF2014.1.1Works
SamsungGalaxy Tab 7"4.1.1, CyanogenMod nightlyOnly charging
SamsungGalaxy Tab 2 10.1"4.0.4Works
SamsungGalaxy Note 24.1.1Only charging
Google/SamsungGalaxy Nexus4.?Only charging

EDIT: I don't think it's an Android version issue. I've heard the manufacturers can choose to disable the ADK feature (of course they can). I just never thought they would. Why?


Nov 07, 2012, 08:08 am Last Edit: Nov 07, 2012, 08:15 am by whitewater Reason: 1
Only tried Samsung Galaxy S (i9000)
- MIUI (Android version 4.1.2)
- CyanogenMod 9 (Android version 4.0.4)
- CyanogenMod 7.2 (Android version 2.3.7)

None of them worked. Can anyone confirm a working ADK mode on Galaxy S on any firmware? Unfortunately I don't have access to any other Android device at the moment ...

Edit: the following command on the phone returns android.hardware.usb.accessory
pm list feature | grep accessory


Does the phone get power from the Due, or nothing? How do you power the Due?
I think it might be a power problem because my Desire S doesn't connect (only charge) when I'm powering the Due over computer USB while charging another phone from the same USB hub.

Another power problem: the USB host port doesn't seem to power up at all when I'm running the Due on 12V external power. Is there a call I need to make to enable the USB host power?
And it gets better: while the host port appears to be dead, the programming port is powered; I can charge my phone over it! It's not supposed to power the programming port, right?


...the programming port is powered; I can charge my phone over it! It's not supposed to power the programming port, right?

It should not even be possible to make such a connection: the usb spec only defines these cables for this use:
1. micro B plug to standard A plug (the regular pc to phone cable).
2. micro A plug to standard A receptacle (what massimo referred to)
3. micro A plug to micro B plug (never seen this for sale)

You can plug cable 1 into cable 2, then you end up with the same thing as cable 3. So you always end up with an A plug on one end and a B plug on the other. The B plug goes in the phone. The A plug has  a rectangular section and should only fit in the native usb port (micro AB connector) of the due. It should not fit in the programming port (micro B connector, trapezium shaped section)

So how did you make the connection?
- did you put the A end in the (otg capable?) phone?
- do you have a non std cable? (on ebay I saw cables that look like standard A receptacle to micro B shaped plug, but it is difficult to tell from the pictures)
- does the due have a micro AB connector (rectangular shape) for the programming port? (I am still waiting for my due, so I can't see for myself)


Nov 07, 2012, 10:23 pm Last Edit: Nov 07, 2012, 10:26 pm by Sebastian Vik Reason: 1
I use a cable like this one on the Due side: http://www.ebay.com/itm/Micro-USB-Host-OTG-Cable-W-USB-power-Samsung-phone-i9100-i9300-i9220-9250-/150928276246?_trksid=p2047675.m1850&_trkparms=aid%3D222002%26algo%3DSIC.FIT%26ao%3D1%26asc%3D11%26meid%3D3299974227435379446%26pid%3D100011%26prg%3D1005%26rk%3D1%26sd%3D110931117836%26
It plugs into either the programming port or the native port. On the other end I use a normal USB charging cable (#1 in your list).

Is it simply because I'm using the wrong cable? But the host port powers up when the programming port is connected to the PC!

EDIT: The special cable acts like a normal OTG cable with the option of external power supply (not used in this case)

Go Up