-
Notifications
You must be signed in to change notification settings - Fork 791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usb android open accessory connection not stable #236
Comments
@GivenMojapelo can you test if this issue solves your problem: #238? |
Hi @Lauszus. I tried that and I am not getting anything. The android device still goes straight to media device mode. |
@GivenMojapelo https://github.com/felis/USB_Host_Shield_2.0/blob/master/adk.cpp#L256 @Lauszus I think this is better. /* send ADK string */
uint8_t ADK::sendStr(uint8_t index, const char* str) {
char tmpstr[256]; //ID string is upto 256 bytes.
strncpy(tmpstr, str, 255);
tmpstr[255] = '\0';
return ( pUsb->ctrlReq(bAddress, 0, bmREQ_ADK_SEND, ADK_SENDSTR, 0, 0, index, strlen((const char *)tmpstr) + 1, strlen((const char *)tmpstr) + 1, (uint8_t*)tmpstr, NULL));
}; USB packet captureDebug log
|
Thank you @YuuichiAkagawa and @Lauszus. Both your answers helped. I also tried @YuuichiAkagawa 's reconnection method but it's also not working. I have to reset the board everytime I reconnect. |
Reopening this issue, as we should investigate #236 (comment) at some point. |
Hi! I got the same problem. I've tried all the above suggestions, but still didn't solve. By the way, this problem doesn't happen to some smartphones or tablets I have here, but just in one model I am having problem. |
Educated guess here... could be the device has a bug. Get the Android Development Kit (ADK) installed, and find where the adb tool is. Now you will be able to watch what happens during connections, and a whole lot of other stuff. |
To be honest the ADK driver has very low priority, as it is pretty much abandoned by Google at this point. |
Thanks, @xxxajk and @Lauszus for the answer! Actually I've already done what you suggested, @xxxajk and still have not found the problem out. And as the @Lauszus said,ADK is pretty much abandoned by Google, I will find another alternative to communicate Arduino and Android. |
I am not sure how relevant this is, but I did run into a problem where the term_test example failed to connect to the phone using an usb a to usb c cable, but connected just fine using an usb a to usb c reduction, followed by an usb c to usb c cable. |
Hi.
I have been trying to connect to android in an open accessory mode to run the BlinkLed example provided. Sometimes I am able to connect and control the led but sometimes I connect and my blinkLed example only communicates with the Serial monitor. There are also times when I just can't connect and my android activates media device connection mode. I changed the delay times in adk.Init() and I still got nothing. I tried different android os versions as well
Any ideas what the problem can be and how I can solve it will be appreciated.
Thank you!
The text was updated successfully, but these errors were encountered: