Can't connect arduino mega ADK board using USB host - android

I tried to connect an Arduino Mega ADK using Demokit sources to several phones in vain.
I compiled and upload the Arduino sketch "Demokit.pde" with arduino 0022. It looks ok as the board sends "start" on its usb client port.
I compiled Demokit app under Eclipse using Google API 10 (for phones running Gingerbread) and Android API 15 (for ICS ones). Everything fine.
On the phone side, I tried these setups :
samsung i9000 running CM 7.1 and after pushing android.hardware.usb.accessory.xml and com.android.future.usb.accessory.jar
samsung i9000 running ICS
nexus S running ICS
And nothing happened. There's only a warning in the eclipse logcat :
W/PowerUI(654): unknown intent: Intent { act=android.intent.action.ACTION_POWER_CONNECTED flg=0x10000010 }
Nothing else. I wonder if the board can have a problem on its usb host...
If anybody has an idea?
Thanks

There are couple of places where things go wrong.
First to check the board, try running a simple blink program, to make sure that the board itself is working.
Next when you connect your to the board, does your phone starts to charge? This will show whether there are any issues with the phone-board connectivity.
Out of the 3 phones, I would suggest you to try with nexus S, with stock ROM, since CM (even after pushing the jars) has issues enabling ADK.

The problem came from the setup procedure in the Demokit.pde sketch. I used a bread board to run it but I didn't connect all components and the i2c joystick initialization needs the component to be connected otherwise the procedure goes into an infinite loop. So if you try to run Demokit.pde without the demokit board be sure to connect the right joystick, or comment its init procedure call.

The demokit example is actually rather complex for an initial test. I would suggest after running the blink program to make sure your Arduino Mega ADK is working to try a simpler first test.
There are a couple of good examples that are much simpler than demokit.
http://allaboutee.com/2011/12/31/arduino-adk-board-blink-an-led-with-your-phone-code-and-explanation/
http://digitalhacksblog.blogspot.com/2012/05/arduino-to-android-turning-led-on-and_29.html
Neither of these target an Arduino Mega ADK so some changes will be necessary but they should be a good place to start.

Related

Ping doesn't work on Samsung Devices

I wanna use a library from GitHub named "Android Network Tools", but actually I have a complex issue when using that. I tested the ping of this library on different type of devices and Android versions, and it worked correctly and was perfect, but when I tested it on my Samsung Galaxy S8 with android 8 I saw pinging external IP(like google.com) didn't work! at the first, I thought it happens in Android 8 and tried to solve it, but I launched it in Android 8 with the emulator that was ok! after that, I decided to test it on my friend's Samsung J7, you can guess that what happened, it didn't work again!
Right now, I'm really really confused because of I don't know why it happens just on Samsung devices, do you have any idea?
The problem is not with your code , the problem is occurring because of Device manufacturers They change the Os according to there need which causes issue with ping , see
Why does ping works on some devices and not others?
Finally, I found the problem, this was about control running apps in the background! when that feature be enabled some methods and ping doesn't work correctly in real-time.
power saving mode
Yes this is correct. With any power saving mode active, on at least some Android o/s versions, ping will not function. I'm guessing icmp echo reply packets are dropped. A sniffer app would confirm this. It is possible icmp echo (outbound) packets aren't even generated. Crazy in my view. Most ping utilities are very lightweight and I would have thought consume minimal power. I'm running a Samsung J5 / Android v.7.0. Ping started working once I disabled power saving mode

Connect USB Device to Bluestack

I have drone( DJI Phantom 3), and in order to fly it correctly DJI provides an App for IOS and Android("DJI Go"). The thing is that I have a Kolina k100 android phone(a cheap chineese one), and I can install the app perfectly, and it runs quite well with an only exception. When I put the Drone on video-recording mode, I loose the live-video and I can not see what my drone sees. Obviously DJI has told me that he doesn't support my chinese phone so they do nothing. So I was thinking that maybe is a problem of how powerful my phone is.
So I wanted to check if the App works well in my laptop so I downloaded the app in Bluestacks, but I realised that to make the app work I have to connect the drone's RC controller by USB (as I do with my phone). But when I connect the controller to the laptop, Windows recognizes it. But Bluestack doesn't care so the app doesnt work. How can I make Bluestack recognize the USB connection of the controller?
Thanks in advance, any help will be appreciated.

Arduino Mega ADK not recognized by Samsung Galaxy S3

I have been using the Arduino board successfully, uploading sketches without any problem. I've got most of my project running - Stepper Motor shield and motor, IR LED, everything. I just can't get my Galaxy S3 to recognize that it is connected to the board so that I can complete my project.
I am using a 9Volt battery as logic power for the board and to provide power to the G S3. I have uploaded the proper drivers to the board using the demokit sketch distributed by Google.
I have the ADK 2012 App installed from the Play Store on my G S3.
When I plug in the usb cable from my Arduino ADK to the phone the phone acts like nothing is plugged in. When I execute the ADK 2012 app on my phone I get a message stating "Your ADK is not connected".
This is both with the stock Samsung microUSB cord and with a USB OTG cord.
This is a Model SCH-I535 Verizon Phone. Not Rooted. Running Android 4.1.2
I understand that there are potentially 2 problems with my combination of board and phone:
adequate power to supply both board and phone.
using the proper cord.
I think I've addressed both issues. I have searched for months for an answer to this problem. I'd hate to break down and get a tablet as I really want to get this to work with my phone.
Has anyone found a solution to this problem?

How do I connect the Samsung Galaxy Tab 10.1 to the Android IOIO Microntroller Board?

I am trying to run the Android IOIO development board on the Samsung Galaxy Tab 10.1. I am so far unable to do so. My Droid X starts up on the IOIOSimpleApp on plug in. However, when I plug in my Tab, the whole screen remains disabled and does not work. I have the Build to be Google API 2.3.3 API Level 10. I do not know what else to mention but that when I run the app it doesn't "see" the IOIO board.
Another problem I am having is my application changes data on a server. The phone is able to make changes but the same app on the tablet doesn't make changes to the server. I think it may be with the app compatibility with the tablet but I am not sure. Any help/suggestions?
Thanks ahead of time.
The normal sequence for checking IOIO connection problems:
Is the charging icon on your Android on? If not: power supply problem. Check that the trim pot on the IOIO is all the way clockwise. Check that your power supply is 5V-15V, 10W or greater, connected between Vin and GND with the correct polarity. Check that nothing on your IOIO gets hot. Move to step 2 only if you're getting charging icon, or else you'll be wasting your time.
Enable USB debugging on the Android and connect IOIO over USB. Are you getting the debug icon (little Android bug)? If not, your IOIO may be running an old version of the firmware, which is known to have had a few USB bugs that are now fixed. Specifically, any bootloader < V3.03 and app firmware < V3.23 may be suffering from this bug. If you have an Android on which the IOIO does work, you can figure out your firmware version by running any IOIO app (e.g. HelloIOIO) and checking the logcat output for a message with all the IOIO version numbers. Unless you have V3.03 bootloader and V3.23 app, an upgrade might help. Move to step 3 only if you're getting the debugging icon.
You're getting the debug icon but your app doesn't work. Try one of the stock apps, preferably the HelloIOIO.apk (precompiled) version that comes with the software bundle. Run it and then search the logcat for IOIO related messages. If HelloIOIO works, this may be a problem with your application or build environment. Again, check logcat for clues.
If none of this works, start a thread on the ioio-users list and give as many details as possible on your problem (what you've tried, which Android model and OS version you have, what you're seeing).

Can I test Arduino Mega ADK using an emulated Android environment?

I want to play around with using an Android device to control hardware on an Arduino Mega ADK. At the moment I don't have an actual Android device so I'm wondering ... is it possible to use the Android emulator and still talk to an actual ADK board. I went through the "Getting started" tutorial and things built and installed as expected but when I run the DemoKit software from the emulated Android environment (GoogleAPI) it doesn't seem to detect the ADK board. I tried unplug/plug, restart, close Arduino programmer to free up the USB connection ... none of which made any difference.
I'm completely new to Android programming so not too familiar with the environment. I have gone through the basic "Hello, world" tutorial using an emulator, but other than that the only thing I've done is build and install the DemoKit app.
I am pretty sure that this is not possible. I don't think the Emulator can actually acccess your USB ports on your personal computer, and thus this will not work.

Categories

Resources