Hacker Guide
The guide will help you to get started with NodeCopter hacking in any programming language.
The Drone
All NodeCopter hacking is done using the Parrot AR Drone 2.0. Features include:
- Wifi
- 1 Ghz CPU, 125 MB Memory
- HD Front camera, Low res bottom camera
- Linux (BusyBox)
- Automatic hovering at a fixed position (using altitude sensor and optical flow tracking)
The AR Drone 1.0 may also be supported by some libraries, but most of the community uses 2.0 drones.
We are not married to the Parrot drones, but so far we have not found any alternatives that offer competitive pricing, automatic hovering, global distribution, easy repairs and are shipped fully assembled.
Buying a drone
In most countries the best place to buy a drone is your national version of Amazon.com. You won’t get a discount, but shipping is usually very fast and they often also carry the repair parts you may need.
If Amazon is not a viable option for you, you should consider the manufacturers online shop: http://www.parrotshopping.com/. Shipping can be slow, but they can deliver all parts to almost any country in the world.
For those willing to go the extra mile for a good deal, we recommend Ebay or similar sites. You can often find used drones or drones with minor damage. Repairing the drones is easy, so unless the damage is much bigger than advertised, you should be able to save a decent amount of money.
Last but not least, there are several brick and mortar retailers, you can find them here.
The Basics
Important Information
Before starting your drone for the first time, you may want to know about this:
- You can grab the drone while flying and turn it around which will cause it to enter an emergency mode which shuts down the motors. This is great for self-defense, as well as stopping a drone that is out of control. You can see a video of this maneuver here.
- The emergency mode can be disabled via the mobile app, a library that supports it, or reconnecting the battery.
- Being a flying robot costs energy. Watch this video to see how to replace your battery.
Getting Started
Make sure that you have Node.js installed.
First off, you should get the FreeFlight app for your iOS or Android device if you don’t have it already.
Now connect to the drone’s WiFi with your smartphone, start the FreeFlight app and make a test flight with it’s Piloting feature to learn how the drone behaves. It’s also a good time to check if the firmware of the drone is up to date. See setup the drones for exact instructions.
But controlling the drone with the phone is boring, let’s program it! Connect to the drone’s WiFi with your laptop and install the ar-drone module:
$ npm install ar-drone
Once you’ve done that, save this to a file:
var arDrone = require('ar-drone');
var client = arDrone.createClient();
client.takeoff();
client
.after(5000, function() {
this.clockwise(0.5);
})
.after(3000, function() {
this.animate('flipLeft', 15);
})
.after(1000, function() {
this.stop();
this.land();
});
and execute it. See how your drone takes of, rotates clockwise and even does a flip! Amazing. Now you’re set, go ahead and get crazy!
Troubleshooting
Drone is not flying high / flying very slow
Per default, the drone will only fly very slowly and won’t fly higher than 3m. These limits can be lifted via the mobile app or a library that supports it.
Here is an example for setting the limit to 100m using the node-ar-drone library:
client.config('control:altitude_max', 100000);
All my LEDs are red and I cannot take off.
Looks like the emergency mode is in effect. To easy ways to fix this:
- disable emergency mode with the client
- Reboot the drone by removing the battery and putting it in again
Tips & Tricks
Connect the drone to an access point
Normally, if you’re connected to your drone’s WiFi you don’t have connection to the internet. This is not very convenient, so an easy way out is letting the AR drone connect to a WiFi accesspoint.
Connect to an open network
If you have access to an open network (no WPA or similar), you can simply:
- Telnet into the drone:
telnet 192.168.1.1
- Execute the following command (replacing [ssid] and [wanted ip] with their values):
killall udhcpd; iwconfig ath0 mode managed essid [ssid]; ifconfig ath0 [wanted ip] netmask 255.255.255.0 up;
Thank you @karlwestin for this gist.
Connect to a network secured with WPA
In order to connect to a secure network, you need to install WPA support on your drone. The good news is that @daraosn took the time to cross-compile wpa_supplicant and write some handy install scripts.
Just checkout the ardrone-wpa2 repo on githbub and follow the instructions there.
How to connect an Arduino to the drone
Check out this gist so see how to connect an Arduino to a drone!
Modules
Have you written a nodecopter module? Add it by editing this page.
- node-ar-drone: The main AR Drone library for controlling your drone.
- node-dronestream: Renders the drone h264 video stream in your browser using Broadway.js.
- ar-drone-png-stream: Streams
png images into an image tag using
multipart/x-mixed-replace
. - drone-browser: Control your drone via your browser
- wii-drone: Control your drone with a Wii Classic Controller and arduino.
- Asterisk Control: Control your drone with Asterisk.
- copterface: Have your drone detecting faces using node-opencv.
- qwertyhancockcopter: Control your drone with a web based music keyboard.
- nodecopter-tennis: Use your drone as a tennis ball!
- ipad-ardrone-controller: Control your drone with an iPad and gestures.
- qrar: Decode QR codes found by your drone.
- node-drone-joystick: Control AR.Drones using any SDL-compatible Joystick (PS3 Sixaxis, etc.)
- drone-kinect: Control AR.Drones using your body (with a Kinect)
- xbox-controller: Interface for Wired Xbox 360 game controller into node
- ardrone-webflight: Browser based remote control environment easily extensible via plugins
- ardrone-autonomy: Library to support autonomous flight (state estimation and PID control)
- ardrone-panorama: Autonomously fly your drone to take 360° panoramas at desired height
- node-gamecontroller: Interface for several game controllers, such as PS2, SNES, XBOX
NodeCopter Modules on npm
Loading modules...
Might take some time on first load
Module must be on npm with `nodecopter` in the name or description.