Click here to Skip to main content
15,884,353 members
Articles / Web Development / HTML
Tip/Trick

Create a Parrot Drone Web Control Panel: Sound On/Off, Lights On/Off

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
17 Aug 2017CPOL2 min read 10.2K   30  
How to create a web control panel for sound and lights for your Parrot drone (Wi-fi connected)

Introduction

With the provided scripts, you can control:

  • lights
  • sound

of your Parrot drone. This should work for all Parrot Drones, that are connected via wifi, as they are run a HTTP, FTP and telnet server by default.

If you put further work into scripts and dig deeper into your drone, you might be able to control almost everything.

I also uploaded a video, so you can see what's happening before you do it:

Background

I have a Parrot drone (Max), that makes annoying sounds and has lights, that I want to control (to light up dark rooms). And I just found out, that Parrot drones offer:

  • telnet
  • FTP
  • HTTP

servers by default. So why not use them? :)

Using the Code

To create the web-interface for control, follow the steps given below:

  1. Connect your drone via wifi to your mobile device (in my case, that was necessary to keep up the wifi of the drone)
  2. Connect your computer to the drones wifi
  3. Connect via ftp to the drone (this should be the IP by default)
    • ftp://192.168.2.1/
  4. Copy the provided www folder to the root directory of your FTP server
  5. If you want to use it, copy the provided sampleScriptForCopy.sh
  6. Connect via telnet to the drone (the FTP connection can stay up)
    • telnet 192.168.2.1
    • (no authentication required. You can use anonymous if you connect via putty)
  7. Run the sampleScriptForCopy.sh script on the drone
    • Bash
      sh /data/ftp/sampleScriptForCopy.sh
    • You can also do everything by hand:
      • Copy the content inside the provided www folder inside /www on the drone
      • Make all scripts in /www/cgi-bin executable
      • Maybe create a link to /www/control.html inside the /www/index.html to reach it more easily
      • and don't forget to make all scritpts inside /www/cgi-bin executable :)
  8. Open http://192.168.2.1/control.html inside a browser of a device (any) that is connected to the drone

Points of Interest

Almost all the software for the drone is written as bash scripts. Therefore, almost everything is understandable and changable. Always be careful though, to not stop the wrong scripts. You might end up with expensive garbage.

What Happens Inside the Scripts (Backstage)

The control.html calls on cgi-scripts, that are simple shell scripts. The whole interface is pretty easy. Turn of the sound:

Bash
gpio_out "nAMP_PWDN" "0"

Turn on right red LED:

Bash
source /bin/leds_lib.sh
led_set red right 1

Note: All the cgi-scripts don't return any value. Therefore your browser will always think that the site was unreachable, even, if it was.

How I Found Out About All This / My Source of Information

This is a Defcon talk, that gave me the idea about what you could do with a Parrot drone:

History

  • Reference added

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer Telefonica Germany
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --