Demo Projects

Loading...

Monday, October 31, 2011

3 possible ways for Android to control the outside world using WiFi

In our last post about the Top 10 Android Hardware Interface Tools, we have already been concentrating too much on the low-speed high-delay Bluetooth connectivity; we have also been hacking too hard (the ROM or the Android Debug Bridge) to ask the little micro USB port to give us serial Rx/Tx and prepared some Android libraries to avoid programming the microcontrollers; we have even been dying to get some low rate serial characters or PWM signals through the poor 3.5mm audio jack on the phone.

What haven't we tried? Due to the seemingly high-price issue, we haven't tried much those WiFi modules or dongles. But finally we ask: why not! WiFi means easier configuration (UDP/TCP/WiFi direct), secured connection, NO annoying cables, high speed data transmission (video streaming possible), smoother control (less delay), and the Internet of things.

What are the possible WiFi connection modes with an Android phone? The DIY Phone Gadgets community has drawn such a conclusion so far:

1.    Classic mode: WiFi router+Android+external WiFi device:

Thanks to the router, the Android device has full Internet connection, and can control multiple external WiFi devices within this local network. The inconvenience is that the LAN is not mobile (limited by the router's WiFi range).

Sample application or ideas:

Well, we haven’t seen something using WiFi and Android but we would love to test those good-looking arduino-compatible WiFi boards and shields very soon.
DomoticHome uses Android, Arduino and an Ethernet shield to provide simple home automation protocol. Based on that, it is hyper-easy to use WiFi shields to quickly realize the same thing. To port the project using a WiFi shield, we don’t even have to change anything on the Android side. Here is how it works:



2.    Ad Hoc P2P mode: Android+WiFi device, without WiFi router, where there are two types :

a) P2P Android Client mode:

The external device is the AP. The Android device is the client.

Sample application or ideas:

The AR Drone from Parrot. The AR Drone mother board is a WiFi AP.

b) P2P Android AP mode:

The Android device is the AP and the external WiFi device is the client.

Sample application or ideas:

There is no mature application of this type now in the market. But we do see pretty much potential. Unlike the P2P type A that is limited to be connected to one AP, the Android AP can control multiple external WiFi client devices. Shown in the Open World Forum 2011 in Paris, Yan’s “Chicken Haha Telepresence Robot” is the first prototype based on P2P WiFi Android AP solution. Multiple android devices can control multiple robots and get live video feedback, without needing a router.




FAQs: 

In P2P Ad Hoc mode, do we still have Internet access?

Nowadays, each Android device has only one WiFi module. Once configured to work in Ad Hoc P2P Android client mode, the phone will no longer have internet access unless the external AP can provide an Internet content (which is difficult). In P2P Android AP mode, more luckily, the Android device will have Internet access if it has a 3G connection.

How to enable Android WiFi tethering hotspot AP?

You don’t have to root the phone. The WiFi tethering hotspot (AP) is natively supported on Android 2.2 Froyo or above. One interesting thing that we noticed is that on all Android devices we have tested so far, the IP address of the Android AP is always 192.168.43.1. That makes it so easy to develop client applications without considering the server's IP address. What's more, we can even programmatically enable tethering mode and define the AP name in the Android code. It needs some hack because one of the pains to develop P2P Adhoc applications is that Android SDK doesn't provide explicit APIs to configure the network). In our next post, we will give you a tutorial to enable and configure P2P AP mode, both manually and programmatically.


4 comments:

  1. Check out the link below for a cheap way to connect your Android to your arduino with your pc receiving the command over WiFi and relaying it to the arduino over usb.

    http://shazsterblog.blogspot.com/2011/11/arduino-google-voice-activated-servo.html?m=1&utm_medium=referral&utm_source=pulsenews

    ReplyDelete
  2. Hey everyone, I'm new to the group.

    I'm a computer engineering student working on a project for my senior design lab. My team is trying to develop an android app that will control a DIY Drones QuadriCopter via a Digi Xbee Wifi module. It seems like I'm in the right place to starting bringing more people in on our progress.

    I'm curious if anyone has done anything similar? (seen a few apps, mostly for the AR.Drone) Is anyone interested in keeping up to date with our project? I'll leave all my code completely open. I'm struggling to get back into Java, and currently charging through tutorials to get an app up and running.

    Our team website is www.peregrineengineering.com (though it doesn't get updated when we get busy).

    Thanks everyone.

    ReplyDelete
  3. Great job!!! Thanks for this post. I really enjoyed reading your post. Keep up the good work......

    ReplyDelete
  4. haloo, can i have android source code ???

    ReplyDelete

Disqus for DIY Phone Gadgets