Re: Is it possible to use IOIO-OTG as a USB slave device to an Android Tablet?

674 views
Skip to first unread message

Ytai Ben-Tsvi

unread,
Mar 19, 2013, 11:18:44 PM3/19/13
to ioio-...@googlegroups.com
This has been asked and answered many times...
It is possible, but the current Android-side software doesn't support it.
On my plate to add sometime (unless someone else does it sooner).


On Tue, Mar 19, 2013 at 6:41 PM, Adam Siegel <acsi...@gmail.com> wrote:
Hey Ben,

I looked through the forum, but can't find a good answer to this question.

Last week I purchased the IOIO-OTG and a brand new Google Nexus 7 and finally got the helloIOIO program working. I was able to do this by plugging in the IOIO to an external fixed power source.  Unfortunately, this configuration makes portable applications difficult (unless I want to invest in a battery :P)

Instead, what I really want to do is use the IOIO as a "slave" peripheral to the Nexus... that is, you plug the IOIO into the Nexus, after which: (i) the Nexus powers it and (ii) the Nexus recognizes it as a USB-OTG accessory (just like a keyboard or a mouse).  However, based on what I have been reading, it looks like the only way for IOIO-OTG to interface with an Android device is (counterintuitively) as a master device, with the Android device acting as slave. Apparently the IOIO-OTG has slave capability, but only when plugged into a computer running OSX or Windows.  Is this correct?  Is there any way to run the helloIOIO app on my Nexus 7 and have the Nexus 7 *also* power IOIO?

Thanks!

Adam

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ioio-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gareth West

unread,
Jul 25, 2013, 9:27:03 AM7/25/13
to ioio-...@googlegroups.com
I am also looking for this feature.

I have an Android media player (that does not have BT) that I want to connect 2 IOIO boards to.

At the moment Phidgets is a solution. They have Android libraries.

Ytai, I would like to try and write the Android capabilities for this, but where do I start?

Ytai Ben-Tsvi

unread,
Jul 26, 2013, 1:54:08 AM7/26/13
to ioio-...@googlegroups.com
Great!
I would start by writing a simple Android app (no IOIOLib) that would use the Android USB host APIs to support a CDC/ACM (a fancy way of saying virtual serial port over USB) driver and print data coming in from the IOIO.
You don't need to write the driver. There are already some that have been implemented, e.g. for FTDI or Arduino. Just write a simple app that uses this driver and writes whatever it is getting to the screen or log.

Once that is done, the rest is just some glue code for IOIOLib, roughly speaking, an additional implementation of the IOIOConnection interface (see existing ones as examples) and IOIOConnectionBootstrap (should be trivial).


--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.

Gareth West

unread,
Sep 6, 2013, 9:46:50 AM9/6/13
to ioio-...@googlegroups.com
Thank you, Ytai.

All makes sense.

Just finishing off some other work that pays the bills and then I will get into this.

Ytai Ben-Tsvi

unread,
Sep 6, 2013, 11:28:48 AM9/6/13
to ioio-...@googlegroups.com

You probably missed the thread by Misha. This has been implemented and demonstrated to work and is now on a pending pull request that you can try right now until I actually merge it in.

--

Gareth West

unread,
Sep 12, 2013, 1:22:45 AM9/12/13
to ioio-...@googlegroups.com
I did indeed. Thank you for repeating it. It seems that happens a lot.

Gareth West

unread,
Sep 12, 2013, 1:29:56 AM9/12/13
to ioio-...@googlegroups.com
Actually, Ytai, I have seen Misha's post, but thought it to be some kind of reverse USB power trick. (Now that I think that over that doesn't even make sense.) So what Misha actually demonstrated was the IOIO in accessory mode?

I will check out the new code as soon as I am able. Thanks again.

Ytai Ben-Tsvi

unread,
Sep 12, 2013, 3:23:21 AM9/12/13
to ioio-...@googlegroups.com

Not sure what you call accessory mode, but what's shown in the video is the android acting as USB Host and the IOIO as USB device.

On Sep 11, 2013 10:29 PM, "Gareth West" <gar...@redshift.co.za> wrote:
Actually, Ytai, I have seen Misha's post, but thought it to be some kind of reverse USB power trick. (Now that I think that over that doesn't even make sense.) So what Misha actually demonstrated was the IOIO in accessory mode?

I will check out the new code as soon as I am able. Thanks again.

--

Thanos Fisherman

unread,
Jan 14, 2015, 11:38:20 AM1/14/15
to ioio-...@googlegroups.com
Hey,
Is this possible nowadays using the current software?

Ytai Ben-Tsvi

unread,
Jan 14, 2015, 12:35:46 PM1/14/15
to ioio-...@googlegroups.com
Yes, it is.

On Wed, Jan 14, 2015 at 8:38 AM, Thanos Fisherman <psar...@gmail.com> wrote:
Hey,
Is this possible nowadays using the current software?

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Thanos Fisherman

unread,
Jan 14, 2015, 2:59:21 PM1/14/15
to ioio-...@googlegroups.com

Yes, it is.

Do I have to do something to IOIO in order for this to act as a slave? Or just plug the usb from android to ioio and that's all? 

Ytai Ben-Tsvi

unread,
Jan 14, 2015, 10:14:16 PM1/14/15
to ioio-...@googlegroups.com
The role is determined by the cable. Whomever has the "B" side is the device, and whomever the "A" side is the host. So make sure your "B" side is on the IOIO. Otherwise, you'd have to compile your app with the IOIOLibAndroidDevice library and add a bunch of manifest boilerplate. See HelloIOIO as an example.

On Wed, Jan 14, 2015 at 11:59 AM, Thanos Fisherman <psar...@gmail.com> wrote:

Yes, it is.

Do I have to do something to IOIO in order for this to act as a slave? Or just plug the usb from android to ioio and that's all? 

--

Thanos Fisherman

unread,
Jan 15, 2015, 4:00:25 AM1/15/15
to ioio-...@googlegroups.com
Ah you just answered another question of mine about what IOIOLibAndroidDevice library is. I just purchased my ioio and I am new to this. I tried to run HelloIOIO but nothing happens (Ui is disabled) for now I used the classic connection as you can see on the attached Image.

So what do I have to do to run this example successfully? Maybe Do I have to flash the newest firware to ioio?
ioio.jpg

Ytai Ben-Tsvi

unread,
Jan 15, 2015, 9:16:22 PM1/15/15
to ioio-...@googlegroups.com
If this is an Android >= 4.2.2:
  • Make sure USB debugging is off. Does the Open Accessory dialog pop-up when the IOIO is connected?
Otherwise:
  • Make sure USB debugging is on. Does the USB debugging icon pop-up when the IOIO is connected?
Keep in mind that this is independent of the application.

Message has been deleted

Thanos Fisherman

unread,
Jan 16, 2015, 9:17:52 AM1/16/15
to ioio-...@googlegroups.com
Thanks for the really useful tips Ytai yes i'm using androids 4.4.4 and 4.3 and i didn't know i had to disable usb debugging. 

OK I guess I'm a noob. At first I used a 9V power supply to ioio but nothing seem to happen to the phone (like usb connection was not present at all). Then I tried 5V adapter and a dialog popped up prompting me to open the HelloIOIO app (No Open Accessory dialog though) so I opened it but then a toast message appeared saying that i have wrong firmware or something so I guess I have to update the firmware first? 

(Perhaps I should create a new thread for my noobish questions)
Screenshot_2015-01-16-13-40-23.png

Mark Melvin

unread,
Jan 16, 2015, 9:21:14 AM1/16/15
to ioio-...@googlegroups.com

Thanos Fisherman

unread,
Jan 16, 2015, 4:52:51 PM1/16/15
to ioio-...@googlegroups.com
Thank you Ytai and Mark I updated the firmware and it works perfectly :) Now Back to my original question. How can I power the ioio from my android phone I don't quite understand that A-B usb cable I just tried to connect usb from ioio to phone as you can see in the above image. (with no external power supply of course) Do I have to get a usb cable that is micro to micro usb like in this video?

Mark Melvin

unread,
Jan 16, 2015, 5:15:09 PM1/16/15
to ioio-...@googlegroups.com
Hi Thanos,

I just went through this.  Have a look at this wiki page:


Unless your phone has a micro-A connector (the tiny, rectangular one so you can plug the red cable that came with the IOIO into your phone), which is likely doesn't, you're going to need one of these:


Combine that with a standard USB charging cable, plugging the above adapter into your phone and the standard cable from that adapter to the IOIO and you are good to go.  Make sure the switch on the IOIO is set to "auto" mode, not "host" mode.

Regards,
Mark.


To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+unsubscribe@googlegroups.com.

Thanos Fisherman

unread,
Jan 16, 2015, 6:44:25 PM1/16/15
to ioio-...@googlegroups.com
Wow thanks so much Mark I really wasn't aware of those subtle differences. I guess I'll have to buy that OTG cable. I found another one here if you are interested
Reply all
Reply to author
Forward
0 new messages