IOIO-OTG and HP-Slate21

136 views
Skip to first unread message

Lagz Moncs

unread,
Mar 27, 2014, 9:01:41 PM3/27/14
to ioio-...@googlegroups.com
Hello,

I am using a IOIO-OTG with HP Slate 21(Android 4.2.2). Connectivity with Bluetooth works fine. I wanted a more stable connection so I tried to go with USB using cable micro B plug(IOIO-side) to standard A plug(Slate21 side). IOIO-OTG mode switch is set to "A". The IOIO-OTG power light indicates it is being powered by the HP Slate 21 but HelloIOIO(with IOIOLibAndroidDevice) can't control the yellow light on the IOIO-OTG.

Is it possible the Slate 21's Android 4.2.2 is not supporting IOIOLibAndroidDevice's connection with IOIO-OTG? Is there any other IOIO-OTG USB connection option for this android device?

Thank you.

Ytai Ben-Tsvi

unread,
Mar 27, 2014, 10:55:10 PM3/27/14
to ioio-...@googlegroups.com
It is possible that this device does not support the USB device API.

I think that even if you have no IOIO application installed, you should see the USB dialog popping up, but I'm not 100% sure (this is for sure the behavior in IOIO as host mode).

In either case, try using the pre-compiled HelloIOIO.apk from the v5.03 software bundle to eliminate any possibility of something wrong with your build.


--
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.

Lagz Moncs

unread,
Mar 28, 2014, 1:02:14 AM3/28/14
to ioio-...@googlegroups.com
I tried using the pre-compiled HelloIOIO.apk from v5.03 as you suggested. It did show a Hello IOIO dialog box. "Allow the app Hello IOIO to access the USB device?. Checked the box "Use by default for this USB device. Still can't toggle the IOIO yellow status led.

Is it then this android device does not support the USB device API?
Is there any other way to connect aside from Bluetooth?

Ytai Ben-Tsvi

unread,
Mar 28, 2014, 1:47:36 AM3/28/14
to ioio-...@googlegroups.com

You're in good shape. Try upgrading the firmware to v5.00 and my guess is that everything will work fine.

Lagz Moncs

unread,
Mar 28, 2014, 2:48:00 AM3/28/14
to ioio-...@googlegroups.com
The IOIO OTG I have have this ID's

Hardware ID:   SPRK0020
Bootloader ID: IOIO0400
Firmware ID:   IOIO0330

You mean I will upgrade Firmware ID: IOIO0330 to Firmware ID: IOIO0500?

I have not done this but I hope it isn't that sensitive. On my way.

Ytai Ben-Tsvi

unread,
Mar 28, 2014, 2:49:42 AM3/28/14
to ioio-...@googlegroups.com

Yes, that's what I meant. You can always downgrade later if you want, although it's very unlikely that you'll have any reason to do so.

Lagz Moncs

unread,
Mar 28, 2014, 5:05:05 AM3/28/14
to ioio-...@googlegroups.com
I already upgraded the firmware to v0500 and you are right, the 503 HelloIOIO is working. It blinks the LED.

But there is still something I'm missing with my app. I can't get digital outputs. Any idea?

Ytai Ben-Tsvi

unread,
Mar 28, 2014, 11:35:40 AM3/28/14
to ioio-...@googlegroups.com
Start by trying to build HelloIOIO from the source code in the v5.03 bundle.
If anything doesn't go smoothly during the build process (e.g. if you had to modify anything to make things work), note it. In general, this shouldn't happen if you do everything OK.
Once you have this working, you can either incrementally modify HelloIOIO to your own logic or just diff it against your existing app to figure out what you've done wrong.

Lagz Moncs

unread,
Mar 28, 2014, 8:37:07 PM3/28/14
to ioio-...@googlegroups.com
Alright. How about my ADT, it's 20130729 but I have installed software update already. SDK is up to 19. The v5.03 HelloIOIO project is complaining about an R(cannot be resolved to a variable) in MainActivity. Two of them actually.

I'll have to find a way to illiminate this error and maybe I can start troubleshooting my application.

Ytai Ben-Tsvi

unread,
Mar 28, 2014, 9:06:51 PM3/28/14
to ioio-...@googlegroups.com

Please consult the eclipse troubleshooting page on the IOIO wiki.

Ytai Ben-Tsvi

unread,
Mar 28, 2014, 9:07:16 PM3/28/14
to ioio-...@googlegroups.com

And upgrade ADT to latest.

Lagz Moncs

unread,
Mar 28, 2014, 9:31:11 PM3/28/14
to ioio-...@googlegroups.com
Okay. I have to make things up to date.

Lagz Moncs

unread,
Apr 1, 2014, 11:20:42 PM4/1/14
to ioio-...@googlegroups.com
Hello, I think I'm lost here. I'm using adt bundle 20140321, App-IOIO0503. HelloIOIOService503 is working fine.
In my previous application I used a for loop inside the setup() and loop() in HelloIOIOService but now it seems it's freezing HelloIOIOService. I might have missed something. I'm just starting with java.

Ytai Ben-Tsvi

unread,
Apr 2, 2014, 12:20:56 AM4/2/14
to ioio-...@googlegroups.com
Is this a question?

Lagz Moncs

unread,
Apr 2, 2014, 12:41:20 AM4/2/14
to ioio-...@googlegroups.com
It is supposed to be a question but not completed, sorry. Is it the loops inside setup() and loop() that's really preventing HelloIOIOService from talking to the IOIO? When I remove the loops, controlling the IOIO is fine. This loop setup worked before.

Lagz Moncs

unread,
Apr 2, 2014, 12:42:44 AM4/2/14
to ioio-...@googlegroups.com
I mean worked before with bluetooth and OA with IOIO as host.

Ytai Ben-Tsvi

unread,
Apr 2, 2014, 11:38:04 AM4/2/14
to ioio-...@googlegroups.com
There's no problem using loops inside setup() or loop(). You probably have some other problem, such as an infinite loop or doing something inside the loop that's invalid.
If you provide more details about what's happening and/or your code and/or logcat output I can try to help.
Be warned that there's a problem with the IOIOService approach using OA, as the service will not get notifications of the IOIO connecting. Apparently an Activity can forward the Intents to the Service to overcome this problem, but I've never actually verified that.

Peakon

unread,
Apr 2, 2014, 3:33:15 PM4/2/14
to ioio-...@googlegroups.com
Sorry, Ytai can you explain how can Activity can forward Intent to a Service. I would like to try it.

Ytai Ben-Tsvi

unread,
Apr 2, 2014, 8:10:45 PM4/2/14
to ioio-...@googlegroups.com
I don't remember off the top of my head. Consult the Android documentation. In principle, one of the Activity methods will get called with an intent if you register the activity for receiving this intent in the manifest (like HelloIOIO does). Then, there's a method you can call to send this intent elsewhere. This may require some messing around with to cover all the cases, I'm mostly guessing here.

Lagz Moncs

unread,
Apr 3, 2014, 4:38:09 AM4/3/14
to ioio-...@googlegroups.com
I noticed onStart is not executed in HelloIOIOService503 example. I get no notification.

In my application I cannot pass values from onStart() to loop(). What am I missing?

Ytai Ben-Tsvi

unread,
Apr 3, 2014, 1:42:19 PM4/3/14
to ioio-...@googlegroups.com

The simplest way to pass data between the main thread and the IOIO thread is to define member variables in your activity class that get shared between the two. All the example apps do that.

Eddie Latuta

unread,
Apr 4, 2014, 6:36:12 AM4/4/14
to ioio-...@googlegroups.com
I use eventbus from greenrobot: https://github.com/greenrobot/EventBus to pass data between Service and Activity with  Fragments

Lagz Moncs

unread,
Apr 6, 2014, 9:12:26 PM4/6/14
to ioio-...@googlegroups.com
Although this is more on java and am just starting to learn it, I hope you can give some advice and/or corrections.
I am doing these tests using a USB connection to a host Android 4.2.2 with IOIO as device.

I define boolean array in IOIOService class.

public class HelloIOIOService extends IOIOService {
    boolean[] pinState = new boolean[3];
...

I then use those array as .write parameter for IOIO io pins in loop().

@Override
public void loop() throws ConnectionLostException,
             InterruptedException {
        for(int i=1; i<3; i++)
        {
         i_o[i].write(pinState[i]);
        }
}

When I set pinState[1] to "true" in onStart() I get no corresponding IOIO output on pin#1.

@Override
    public void onStart(Intent intent, int startId) {
        super.onStart(intent, startId);
                pinState[1] = true;
}

But if I set it in IOIOLooper it will set IOIO output pin#1.

@Override
protected IOIOLooper createIOIOLooper() {
                pinState[1] = true;
...

When I run the original version of HelloIOIOService503 in the same environment, I also noticed that no notification appears on the
Android device although the IOIO status led is blinking.

I have tried this code setup before with App-IOIO330 and IOIO as host and it's working. What did I possibly miss?

Ytai Ben-Tsvi

unread,
Apr 6, 2014, 10:06:25 PM4/6/14
to ioio-...@googlegroups.com
Maybe your onStart() doesn't get called when you think it does, which is what might explain why the pinState setting doesn't work from onStart.
I don't know about the notification. You're getting quite deep into the "generic Android question" territory, for which you might have a lot better luck reading the Android developer docs or searching/posting on stackoverflow.

Lagz Moncs

unread,
Apr 6, 2014, 11:11:30 PM4/6/14
to ioio-...@googlegroups.com
Okay i'll try stackoverflow, thank you.
Reply all
Reply to author
Forward
0 new messages