OK, there is a lot of discussion about this topic. There are also some solutions (dronecell, phonedrone: http://store.diydrones.com/PhoneDrone_Board_p/br-phonedrone.htm ) but for me these solutions did not satisfy my expectations. So I started to develop a more simple set up. But there are still some points for improvement.
1) The philosophic question, should the drone act as server or client?
Thinking a lot, I believe the drone should act as server, so the login procedure is done on the ground. There are other arguments as well.
2) The Protocols TCP or UDP:
In theory the best way is to use UDP. For now, I decided to go with TCP since the components are ready.
3) The Parts:
APM, Bluetooth Modul, Android mobile/handset (xperia / nexus) and a Notebook with Mission Planner and a Browser. That’s all.
4) The Telemetry over 3G Setup:
4.1. Connection between APM and Android:
These problems drove me nuts (the phonedrone board is cool, but for me too expensive). So I decided to use a serial connection with the help of one of these 7$ HC-06 (S) Bluetooth moduls (https://www.google.at/search?q=HC-06+bluetooth).
HC-06 comes in two styles: master or slave. I think the client one fits better. There is a HC-05 as well that could act as Client and as Server (http://cxem.net/arduino/download/HC%20Serial%20Bluetooth%20Products...)
Hooking up HC-06 with the APM I is similar to the xbee connection (http://code.google.com/p/ardupilot-mega/wiki/APM2Wireless). The HC-06 needs a 3,3V input so you have to ad a 1K resistor here (RX, TX, Grnd works without). There is also a mysterious HC-06 v1.04 which should accept the 5V input-power of the APM without resistor as well.
4.2. Android Mobile/Handset:
For my testing I used a sony xperia. A nexus would be better. In the long run it is easier to change the kernel (settings and so on). For Video transmission the camera of the handset is important as well.
4.3. Data Plan:
If the Drone is acting as the Server, a data SIM with open ports is needed (else you has to set up your drone as client). This is difficult to find. In my country 3G internet is common. It is a standard option (big thanks to drei.at). For video you should also use a flat rate SIM.
4.4. Connection APM – Xperia – Internet – Mission Planner:
At first I wanted to write the code myself … but you know:
4.4.1 Bluetooth SSP – android – tcp/ip connection:
I found two APPs in the Android Google Playstore:
GetBlue Demo: https://play.google.com/store/apps/details?id=com.tecit.datareader....
The setup of GetBlue was easier but it is a Demo version and you just can use it for free for 90 days but it should work longer … great piece of software, btw.
a) Configuration/Bluetooth (Pair devices, Connect Automatically)
b) Configuration/Network/TCP server (Port, Integrate with Bluetooth)
Then start server and you are all set. Now you have to figure out the IP address of your handset. You could see it as Local IP on the Dynamic DNS Client.
Dynamic DNS Client:
4.4.2 Optional: Use Dynamic DNS Client to give your handset/drone a Domain Name:
Use one of the common DNS services (http://en.wikipedia.org/wiki/DynDNS eg. http://dyn.com/dns/)
I also use Dynamic DNS Client:
OK, NOW YOUR BIG MOMENT:
… Start your APM
… Start Dynamic DNS Client
… Get your IP address
… Start GetBlue or Connection Terminal
4.4.3 Mission Planner:
a) So your PC/Notebook should be connected with the internet.
b) Then you should check if the TCP Port (which you use in GetBlue or Connection Terminal) of your PC/Notebook is open. If not, you have to check your firewall and/or router.
c) Ping your Mobile/Drone IP or Domain Name.
d) Start Mission Planner, connect over TCP (add the IP and the PORT of your Mobile/Drone) and …
… you should see your MAVLINK over IP data coming in.
5) The Video over 3G Setup:
For Video I also use the Cam-Modul of my Android Handset and an APP of the playstore.
IP Webcam (free):
IPCam Pro (1,49$):
a) Start IP Webcam
b) Start Browser on your PC/Notebook
c) Add your IP and Video Port: e.g. http://xxx.xxx.xxx.xxx:8080 or http://xxx.xxx.xxx.xxx:8000, and …
… you should see the VIDEO of your android mobile/handset coming in.
(Using IPCom on 3g/HSDPA with VLC I have a delay of 1-2 sec but with Browser and building Videocodec only 0.2 - 1.0 sec !!!)
Using UDP and/or Client setup.
… that is it. Hopefully we will see more androids in the sky. best .cj.
christian joachim gruber
Some additional information.
at 1) Drone as server:
I am lucky, because I have a cellular data provider which offers the option for “open Internet” connection (but I have to open it myself in my provider settings”, that means I get a public IP (dynamic) and not a private one (NAT). You could ping your phone from a different network/internet, if it responds you are fine.
If not, the best way is to set up a VPN Network (vpn server on your home-router). This is a little tricky, but very save and future proof …
at 4.1) Serial – Bluetooth modul: HC-06
I smoked my old one, now I got a new one. It was v1.05 with a 3,3-5V input. So I am fine (no soldering) just change the preset to data-rate of 56700.
At 4.2) Android Mobile/Handset
Main reason for this posting. Because I went crazy. I bought a used xperia active, because it is small and waterproof. But I couldn’t set up a BT connection. No problem with my old xperia X10i. WTF.
So I learned the hard way, there are some changes in android for the Bluetooth SPP profile. Maybe a old nexus (but JB 4.2 has also some issues with spp, be aware!). Android 2.3.4 is fine. My Motorola with 4.0 is also working. The big problem is, for VPN is possible without rooting with android 4.x devices.
At) 4.4.1 Bluetooth SSP – android – tcp/ip connection:
So I only use “Connection Terminal” now. It is not so intuitive, but if you got used to it, you will love the simple style. I am just missing an auto Reconnect feature. And you must(!) start BT/Serial before you start Connection Terminal. (I also miss a UDP server) so I had to set up a TCP server.
christian joachim gruber
in order to setup a vpn as you describe we need to consider that even having a private IP the provider allow vpn passthrough?
... good question. I overlooked my provider profile and did find a vpn option, which was activated by default (buisness-user). So maybe provider handle this diffrent. Data-only sim are mostly more open, because they are often used as a full internet-landline replacement. So it is usefull to doublecheck with your provider.
... but i will start to invest some time in testing the new androplot app and UDP (host), so there could be another possibility ;)
did you see how the whole connection reacts in case of lost signal for a moment from both sim and/or bluetooth (case of faillure) ?
... for now. i don't use it for controlling, it would be too dangerous(!), but for telemtry, it should be ok. In my opinion, there are too many risky components involved.
I don't realy like the BT connection, maybe the great andropilot of Kevin will change this in the near future. For BT e.g. "Connection Terminal" has NO auto REconnect option, GetBlue Demo has it. I contacted the dev of "Connection Terminal" for this and TCP/Server, and he is thinking about to add this feature. I am also using a very clean android-base (less apps) for testing and had only one time an connection issure ...
... for 3G, i like the option to run the drone/android as server, because i could reconnect manually more easy. A provider reconnect, that means a new IP adress, is a timing thing, dyndns needs sometimes 5-10 Minutes ... but my dyndns hoster shows the new IP-number realy fast ...
In general, i would recomment this setup just for testing the possibilities, if you own most of the stuff ... 9$ for the BT Modul is OK, but not to get into new contracts/phones, this is too risky e.g. BT is 2,4GHz, TX/RX is 2,4GHz ...
you suggest the slave module? this is clear.
i am sorry but i want to add something...."there is no need for extra code in firmware, only pairing the devices and then the software?"
Yes, i think the slave is the better choice. Maybe you do a double ckeck, arduino-projectsoften use the modul aswell ...
"there is no need for extra code in firmware, only pairing the devices and then the software?" if i understand, right, the only thing you have to do is to change the default baud rate of the module to 57K. c.
Now there is another app in the market, which offers a simple "BT SPP (serial) to TCP" function, called "Serial Mirror". There is an auto-reconnect option for BT. So, one concern less.
thank you very much. very useful informations.
Do you believe that through the BT the devices can cooperate on air for improve the calculations or any similar work? i mean that using the powerful arm processor and android os, could assist the whole project offering goods like failsafe storage, advanced calculation e.t.c. and act as a medium step between APM and your GCS. All of that considering that a new application or shell script run on android device.
my Intension at the beginning, was to setup a system which has a camera, telemetry and video downlink, gps-failsafe tracking (without a full FPV functionality)… functions I used linux and android/phone before in some other projects. For your question I am not shure, if it could be done now. It could be easily implemented, that your vehicle-android/phone set new waypoints for your vehicle. E.g. “Following Mode” of two vehicles without interaction of the gcs. Next step could be overruling control-commands e.g. for obstacle avoidance. APM is responsible for the flight to the next waypoint(s), the android/phone will do the obstacle avoidance and interact only if necessary (the realtime part should be kept on the apm). I am thinking about easy commands similar to waypoints but without gps (e.g. go 3m to the left, and than go ahead) and not about a full control. And for failsafe, it is not a bad idea to have two brains on board … but I would avoid a setup where both brains need each other for 100%.
i will test in two weeks! have ever checked with UDP connection?