HelloIOIOService in open accessory mode

365 views
Skip to first unread message

Peakon

unread,
Jun 22, 2013, 9:49:08 AM6/22/13
to ioio-...@googlegroups.com
Hi Everyone

I have a problem running HelloIOIOService in accessory mode. If I start HelloIOIOService i get a message about using as USB accessory device. I tick the box and apply yes and get connection working OK. 

If I unplug the usb cable to IOIO and plug it back I get the message that no accessory devices found and no connection achieved. If I stop the service and restart it again the connection is working as if I have done it for the first time. 

I use IOIO V1 Bootloader 3.04 Firmware 3.26. The phone Galaxy Nexus - Android 4.2.2. I have USB debugging switched off when connecting in accessory mode. Also connection via Bluetooth work OK when USB debugging is enabled.

If I use IOIOSimle App in accessory mode it works fine with connecting and disconnecting usb cable. 

I guess the problem with HelloIOIOService may be related to the Manifest configuration? Any ideas how to correct that?

Ytai Ben-Tsvi

unread,
Jun 24, 2013, 1:18:33 AM6/24/13
to ioio-...@googlegroups.com
There's a apparent Android bug that prevents an accessory connection from being detected if it's plugged out and then in again too quickly (1 second or so). Could it be that this is what you're actually seeing, or is it happening even if you're waiting a few seconds before reconnecting?
Also, what exactly do you mean by "the message that no accessory devices found and no connection achieved"?


--
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/groups/opt_out.
 
 

Peakon

unread,
Jun 24, 2013, 3:07:55 PM6/24/13
to ioio-...@googlegroups.com
Hi Ytai

I have IOIOSimple app and HelloIOIOService installed on my phone. I have switched USB debugging off an connected the phone to IOIO. I got the message as on the picture 483. I disconnected the cable, counted to 10 and plugged it back in. Connection worked again no problem. I killed IOIOSimple app and started HelloIOIOService I got the message as on the picture 485. I ticked the box Use by default for this USB accessory and OKed it. Connection worked and yellow LED was flashing. I disconnected USB cable counted to 10 and plugged it back and got the message as 483 again. The phone does not recconect to the HelloIOIOService.

Please help.
483.png
485.JPG

Ytai Ben-Tsvi

unread,
Jun 25, 2013, 9:53:44 AM6/25/13
to ioio-...@googlegroups.com
What do you see in logcat after running the failure case?

Peakon

unread,
Jun 25, 2013, 2:19:51 PM6/25/13
to ioio-...@googlegroups.com
06-25 19:06:56.860: I/ActivityManager(391): Start proc ioio.examples.hello_service for service ioio.examples.hello_service/.HelloIOIOService: pid=16036 uid=10081 gids={50081, 3003, 3002}
06-25 19:11:40.899: D/UsbDeviceManager(391): entering USB accessory mode: UsbAccessory[mManufacturer=IOIO Open Source Project, mModel=IOIO, mDescription=IOIO Standard Application, mVersion=IOIO0326, mUri=https://github.com/ytai/ioio/wiki/ADK, mSerial=N/A]
06-25 19:12:52.642: D/UsbDeviceManager(391): entering USB accessory mode: UsbAccessory[mManufacturer=IOIO Open Source Project, mModel=IOIO, mDescription=IOIO Standard Application, mVersion=IOIO0326, mUri=https://github.com/ytai/ioio/wiki/ADK, mSerial=N/A]
06-25 19:13:10.087: D/IOIOConnectionRegistry(16510): Successfully added bootstrap class: ioio.lib.impl.SocketIOIOConnectionBootstrap
06-25 19:13:10.095: D/IOIOConnectionRegistry(16510): Successfully added bootstrap class: ioio.lib.android.bluetooth.BluetoothIOIOConnectionBootstrap
06-25 19:13:10.110: D/IOIOImpl(16510): Waiting for IOIO connection
06-25 19:13:10.110: D/IOIOImpl(16510): Waiting for IOIO connection
06-25 19:13:14.095: I/IncomingState(16510): IOIO Connection established. Hardware ID: SPRK0016 Bootloader ID: IOIO0304 Firmware ID: IOIO0326
06-25 19:13:14.095: I/IOIOImpl(16510): IOIO connection established
06-25 19:13:24.298: I/IOIOProtocol(16510): IOIO disconnected
06-25 19:13:24.626: D/IOIOImpl(16510): Waiting for IOIO connection
06-25 19:13:25.657: D/IOIOImpl(16510): Waiting for IOIO connection
06-25 19:13:25.712: D/IOIOImpl(16510): Waiting for IOIO connection
06-25 19:13:30.009: D/UsbDeviceManager(391): entering USB accessory mode: UsbAccessory[mManufacturer=IOIO Open Source Project, mModel=IOIO, mDescription=IOIO Standard Application, mVersion=IOIO0326, mUri=https://github.com/ytai/ioio/wiki/ADK, mSerial=N/A]

Peakon

unread,
Jun 25, 2013, 2:30:22 PM6/25/13
to ioio-...@googlegroups.com
I also uninstalled IOIOSimple app and now when I plugin the cable I get the following message see file 488.jpg. If I cancel this message and than start IOIOService I get the same message as before about using Accessory mode for IOIOService and connection works OK as before and reconnection does not work as before.
488.JPG

Peakon

unread,
Jun 25, 2013, 3:39:41 PM6/25/13
to ioio-...@googlegroups.com
Sorry I've just added unfiltered logcat in case I missed something with the previous one
log3.txt

Peakon

unread,
Jun 27, 2013, 4:31:16 AM6/27/13
to ioio-...@googlegroups.com
Dear Ytai and All

I have tried prebuild HelloIOIOService apk from 3.26 archive and this one app have given the same problem - no connection on reconnect. I have also tried this on different phone running Gingerbread and still the same problem. I wonder if anyone tried runnign HelloIOIOService and if it worked on reconnect?

Ytai Ben-Tsvi

unread,
Jun 28, 2013, 12:35:36 AM6/28/13
to ioio-...@googlegroups.com
Hmmmm....
I'm suspecting it is something to do with the AndroidManifast.xml file and with the fact that the intent-filter is used with a service instead of an activity. What seems to be happening is that the Android OS doesn't pass the accessory connection event to a service, only to an activity. I'm wondering if this is indeed not supposed to work or maybe I just did it wrong. It would be great if you can spend some time looking into this, or otherwise, feel free to open a bug on the IOIO repo, so that I'll eventually do it.

Peakon

unread,
Jun 28, 2013, 10:15:38 AM6/28/13
to ioio-...@googlegroups.com
Thanks Ytai

I suspected that it may be something to do with the fact that open accessory assigned to a service rather than main activity but wanted to make sure that I have not messed something up. Of cause until 4.2 I always used ADB connection and Bluetooth for debugging. I will try to figure out the way to get it working but I am pretty new to Android so probably chances of finding solution quite low.

Thank you for your help again. 

Nicolas Girardin

unread,
Jun 9, 2014, 6:53:41 AM6/9/14
to ioio-...@googlegroups.com
Any progress?

Seems that <intent-filter><action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" /></intent-filter> is still not recognized when put inside the <service> tag.

Ytai Ben-Tsvi

unread,
Jun 10, 2014, 3:08:00 AM6/10/14
to ioio-...@googlegroups.com
This is an Android issue.
A workaround has been discussed on another thread that  involves registering an activity for this event and forwarding it to the service. I haven't tried this personally, but I believe this should be the right approach.


For more options, visit https://groups.google.com/d/optout.

Nicolas Girardin

unread,
Jun 10, 2014, 10:12:10 AM6/10/14
to ioio-...@googlegroups.com
Yes, I came to the same conclusion, I'm using an Activity that starts a IOIOService, seems like the only solution.


--
You received this message because you are subscribed to a topic in the Google Groups "ioio-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ioio-users/WCafpUtRF_w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ioio-users+...@googlegroups.com.

Craig Shultz

unread,
Dec 15, 2014, 6:25:14 PM12/15/14
to ioio-...@googlegroups.com
Hi Nicolas, were you able to get this workaround working? I've been trying to figure out how to get an activity to launch the service correctly as well.

Craig
Reply all
Reply to author
Forward
0 new messages