Thursday 27 October 2011

First Arduino and Android setup

Had a bit more of a play with the Arduino, and managed to get it connected to a handset after a few days of frustration. It appears that even with the correct version of Android, the Samsung Galaxy S2 doesn't pass the correct Vendor ID to the Arduino, meaning it's not currently possible to connect the two (at least without doing some deep firmware modifications).

Using a HTC Sensation worked perfectly first time however, as shown in this video:



The source code I used is available here;

It's basically a trimmed down version of Google's DemoKit app, which will only work with a very limited edition demonstration board. It was helpful in showing me the basic construction of an App and a Sketch that will work together though.

I have ordered a second-hand HTC Desire, which will hopefully work the same as the Sensation, as I can't borrow that for the duration of the project. I'm a little annoyed with Samsung, and the complete lack of documentation of this problem on the net.

I'm still waiting on the arrival of my servos, the next step will hopefully be connecting them to the dish and having a basic prototype operational pretty soon. I've also started work on the Look Angle Algorithms I'll be using to direct the dish.

9 comments:

  1. Could you post "accessory_filter.xml"?

    ReplyDelete
  2. http://pastebin.com/F2iycTvH

    I think this is what I used...

    ReplyDelete
  3. I somehow fallowed the same steps as you had with discovering the ADK secrets... :) I started two weeks ago when my Arduino Mega ADK arrived home :)

    - rooting HTC Wildfire
    - installing Cyanogen Mod (Android 2.3.7)
    - install Eclipse & Android SDK

    I am a newbie in android apps unstead... and I somehow understand the content in Eclipse...

    Can you post the whole "helloADK" folder? I have some errors while trying to build the project with only the main .java and .xml code ....

    ReplyDelete
  4. thx ur reply,
    but that code you share have some problem

    can you pack project and post

    thanks!:)

    ReplyDelete
  5. hello,

    did you know what Vendor ID and what Product ID that SGS2 pass to arduino

    cause i know where modify it in arduino side

    ReplyDelete
  6. There seem to be some bug with one library...
    I can't compile the sketch, I get there errors:

    D:\arduino-1.0\libraries\AndroidAccessory/AndroidAccessory.h:42: error: 'EP_RECORD' does not name a type
    D:\arduino-1.0\libraries\AndroidAccessory/AndroidAccessory.h:55: error: 'EP_RECORD' has not been declared
    D:\arduino-1.0\libraries\AndroidAccessory/AndroidAccessory.h:55: error: 'EP_RECORD' has not been declared
    D:\arduino-1.0\libraries\AndroidAccessory/AndroidAccessory.h:69: error: 'USB_NAK_LIMIT' was not declared in this scope

    What is the problem??? There is no solution on the whole internet about this problem. I can't figure this out... Please respond!

    ReplyDelete
    Replies
    1. update to the latest library or use the arduino-beta http://labs.arduino.cc/ADK/AccessoryMode . i had this issue and once i updated to the latest code the error disappeared

      Delete
    2. This comment has been removed by the author.

      Delete
    3. I actually am using the latest libs..

      Delete