ytai / ioio

Software, firmware and hardware of the IOIO - I/O for Android
Apache License 2.0
750 stars 355 forks source link

IOIO OTG not recognized by Android 5.x devices #119

Open griggheo opened 8 years ago

griggheo commented 8 years ago

I am trying to connect via USB to a IOIO OTG board from Android devices running Android 5. I haven't yet been succesful. Here is what I have:

IOIO board:

Hardware version: SPRK0020 Bootloader version: IOIO0401 Application version: IOIO0506

Moto X phone running Android 5.1 Galaxy Tab A tablet running Android 5.0.2

I tried different USB cables, and I also tried putting the IOIO board in host mode. I also tried enabling/disabling USB debugging mode on the phone. All to no avail so far.

Any suggestions would be greatly appreciated!

ytai commented 8 years ago

I'm using the IOIO regularly with a Moto X. I don't think what you're seeing is a systematic issue. Some basic questions:

griggheo commented 8 years ago

Thanks for replying, Ytai. I have been trying to recognize the board (official, from Sparkfun) using the IOIO Hardware Explorer app and the Hello IOIO app. Both apps can see the board just fine in Android 4.x but not in Android 5.x. I don't have the charge limiting pot fully turned clockwise so I will try that.

ytai commented 8 years ago

Also: did you turn USB debugging off? Does the OpenAccesory dialog pop whenever you're connecting the IOIO? Are you getting the charging indicator to show?

hbmartin commented 8 years ago

I'm having the same problem on Nexus 7, regardless of whether USB debugging is turned on or off. I've tried requiring it to run only in OTG, and only in AOA. In neither case does the looper's connection handler ever get called.

hbmartin commented 8 years ago
mohsenpashna commented 8 years ago

Have you tried and is it working with BT dongle?

ytai commented 8 years ago

Nexus 7 works for me. You should disable USB debugging. Enabling ADB over WiFi is NOT sufficient.

On Mon, Feb 1, 2016 at 11:14 PM, Mohsen Pashna notifications@github.com wrote:

Have you tried and is it working with BT dongle?

— Reply to this email directly or view it on GitHub https://github.com/ytai/ioio/issues/119#issuecomment-178416255.

lattyak commented 8 years ago

I having the same problem on an S4 running 5.0.1. Same app works fine an S2 (4.1.2). Tried all combinations of H/A switch, USB debugging on/off, Developer options on/off. BT works on both. I recompiled the IOIO Libs to add debugging.

UsbManager.getAccessoryList() always returns null, as if the IOIO is either not recognized as an Accessory device, or not matching the filter. Is there a change in 5.x related to AOA filters? The filter in the IOIOLib is <usb-accessory model="IOIO"/>.

For Device connection, the app is listening on port 4545, but no connection is made from the IOIO. Did 5.x add a firewall?

sibomots commented 8 years ago

Similar problem on IOIO-OTG

Specs:

C:\code\IOIODude-0102>ioiodude --port=COM3 versions
IOIO Application detected.

Hardware version: SPRK0020
Bootloader version: IOIO0402
Application version: IOIO0506

Host platform:
Windows 10
Android Studio ( Version 2.2.2)
Android handset Moto G (OS = Android 6.0.1)
JDK 7 and JDK 8 (both tried)

Process:

Built HelloIOIO and IOIOSimpleApp directly from sources on Github. Very nice. Slick.

Success after gradle/InteliJ reporting needing to upgrade stale versions of the SDK. All sucessful, builds cleanly.

Am able to provision the hanset with the app. App runs on the handset.

Issue/bug:

In both cases, the setup() function in the app never fires, the UI is never enabled. It looks like the call setup() never fires because the handshake/connection between the App and IOIO firmware never takes place ? Or has an error (where would that error be stuffed?

Android handset is running 6.0 Android. Connected between Android handset and IOIO board via USB.

What should I be looking for to troubleshoot the problem of the UI not being enabled in the app (due the connection between the App and IOIO not established)?

Also tried with apps built via JDK 7 and JDK 8 (some older post/wiki mentioned the suggestion to use JDK 7, but this didn't resolve the issue).

Ideas?

-thanks

ytai commented 8 years ago

First things to look at are whether the phone charges and whether the accessory dialog pops up when connecting the IOIO. This is completely independent of anything installed the phone.

sibomots commented 8 years ago

OK. Well that was embarrassing.

I should have checked the power supply. I had a weak battery. Enough to illuminate the power LED, but not enough to drive the system. I'm not entirely sure. This time I'm using a bench power supply instead of a battery.

All is OK. Good. Nice system. Baring my stupid mistakes we may just get this thing off the ground.

AGKhalil commented 7 years ago

Hey all,

I'm running 6.0.1 Android and the phone's not recognizing the IOIO OTG board at all. No accessory dialog shows up and the phone doesn't charge. Do you have any suggestions as to what could be wrong? I always made sure the USB debugging is off and I'm using my Arduino as the power source, 5V.

Any help would be very appreciated.

Thanks, Ahmed

ytai commented 7 years ago

Use a proper power supply?

On Tue, Feb 14, 2017 at 5:55 AM, AGKhalil notifications@github.com wrote:

Hey all,

I'm running 6.0.1 Android and the phone's not recognizing the IOIO OTG board at all. No accessory dialog shows up and the phone doesn't charge. Do you have any suggestions as to what could be wrong? I always made sure the USB debugging is off and I'm using my Arduino as the power source, 5V.

Any help would be very appreciated.

Thanks, Ahmed

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ytai/ioio/issues/119#issuecomment-279712983, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9Y2LU10ESov00xXgQtQgbFBh19PZqoks5rcbJlgaJpZM4HOkfn .

AGKhalil commented 7 years ago

Hey Ytai,

Thanks for responding. I tried a 9.6V RC battery and still nothing. If it helps, I am using Huawei Honor 5X for my phone and I upgraded the IOIO firmware to IOIO0506.

Any thoughts?

Best, Ahmed

ytai commented 7 years ago

I wondering if this is specific to this phone. Have you tried this exact setup with a different phone?

On Tue, Feb 14, 2017 at 10:32 AM, AGKhalil notifications@github.com wrote:

Hey Ytai,

Thanks for responding. I tried a 9.6V RC battery and still nothing. If it helps, I am using Huawei Honor 5X for my phone and I upgraded the IOIO firmware to IOIO0506.

Any thoughts?

Best, Ahmed

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ytai/ioio/issues/119#issuecomment-279793752, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9Y2PBrJYDsYjIl3DNY44lXw_3mbglEks5rcfMxgaJpZM4HOkfn .

AGKhalil commented 7 years ago

Yes and none of the work either. I've tried a different android versions too 4, 5, and 6. Nothing works.

ytai commented 7 years ago

OK, so we have no reason to believe this has anything to do with a particular Android version, but rather something about your specific setup. Can you provide some details about how you're connecting everything, is this a IOIO from an official vendor, etc?

On Feb 14, 2017 11:03, "AGKhalil" notifications@github.com wrote:

Yes and none of the work either. I've tried a different android versions too 4, 5, and 6. Nothing works.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ytai/ioio/issues/119#issuecomment-279802308, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9Y2D9ZUl2IIlOBf-QSMKqUE0wccFVMks5rcfp7gaJpZM4HOkfn .

AGKhalil commented 7 years ago

This is a IOIO I purchased from Amazon, the link is below: https://www.amazon.com/Sparkfun-PID-13964-IOIO-OTG-Headers/dp/B01M7O5Z9N/ref=sr_1_4?s=electronics&ie=UTF8&qid=1485529441&sr=1-4&keywords=ioio+board

The image below should show you how everything is connected. img_4047

Im us running MacOS Sierra 10.12.2. Let me know what you think.

ytai commented 7 years ago

Is the charge current limiter (the little pot on the IOIO) fully clockwise?

On Tue, Feb 14, 2017 at 11:52 AM, AGKhalil notifications@github.com wrote:

This is a IOIO I purchased from Amazon, the link is below: https://www.amazon.com/Sparkfun-PID-13964-IOIO-OTG- Headers/dp/B01M7O5Z9N/ref=sr_1_4?s=electronics&ie=UTF8&qid= 1485529441&sr=1-4&keywords=ioio+board

The image below should show you how everything is connected. [image: img_4047] https://cloud.githubusercontent.com/assets/25755357/22946307/0e33d50c-f2c5-11e6-8873-21bc624d0d75.JPG

Im us running MacOS Sierra 10.12.2. Let me know what you think.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ytai/ioio/issues/119#issuecomment-279816569, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9Y2JHRycgHJ5LF-gm78JkzB5GiaelPks5rcgYOgaJpZM4HOkfn .

lattyak commented 7 years ago

The IOIO sends an extra USB message indicating it supports Accessory Mode. However, this is an optional message, and if it gets corrupted the Android does not ask for it to be resent. And in 5.0 a change was made to ignore all Accessory Mode messages after a timeout. I found older versions of Android it would eventually connect via Accessory, while for >=5.0 if the first Accessory msg was dropped it would never connect. The IOIO code should probably send out extra Accessory Mode messages blindly.

Why did the first Accessory Mode message get corrupted. I found 2 culprits causing this. First was a bad connector. During the insertion, noise can be generated on the data lines because of poor plating on the contact surfaces. Dirt, contact pressure, tolerances and wear can also affect this. I went through lots of different USB cables, and found some worked much better than others. Also phones with a worn USB connector were more problematic. Why does it only affect the Accessory Mode message, well it is the only message the Android side does not ask for a retransmission if there is an error.

The second issue was power supply to the IOIO. The USB charging protocol increases the charging current till the USB voltage drops below something like 4.75V, then it backs off the current till the voltage rises. It's a little more complicated that than, but it's basically testing for a current limit. The IOIO is designed to work on 5V (its DC-DC convertor has a low drop bypass MOSFET when input is 5V), but that makes the system run on ~4.85V -- not much headroom for the charging protocol. Also when it hits the current limit the rest of the system is affected.

I ended up using a 12V supply because it is the most efficient voltage for the IOIO's DC-DC convertor. Also you can buy cheap 12V surveillance camera power supplies that have the same size barrel connector. Anything above 8V will probably work as long as it can supply enough surge current for the charging protocol.

-John

AGKhalil commented 7 years ago

It works now! It was the charge current limiter. Thanks a lot Ytai and John. The HelloIOIO app works flawlessly now too.

pavlik-tikhomirov commented 3 years ago

Hello everyone! I try to connect my IOIO board to my phone Vivo y81 and it doesn’t work. IOIO works normally when it’s connected to PC and managed via PC command line. It also works via bridge. (I launch HelloIOIO app) When I connect my IOIO board to the phone it’s charging but no messages about IOIO appear. I charge it with 9V battery in Vin and Gnd pins. The charge current limiter is fully clockwise. Please, help me

topherbuckley commented 3 years ago

@ocenandor are you using an Android 5.x device? If not, please open a separate issue and include all the details of your phone including OS version, and the steps you take to prior to connecting the IOIO board to the phone. Have you followed the Sparkfun tutorial? If so, mention which steps you have completed and which you are stuck on and hopefully I can recognize some common pitfalls. Regardless, this discussion should be on another issue if it is not particular to Android 5.x devices. Cheers.