Over the past few weeks, I’ve been working hard on the drone side of things for The PiDrone. Right now, I have a CherryPy Web Server running on the onboard RaspberryPi that displays information about the drone and allows you to do basic interactions with it.

On The Drone

The Raspberry Pi is currently connected through a Telemetry Port of the Pixhawk. I took a 6 pin DF13 cable that came with the Pixhawk and stripped of one end to attach the Raspberry Pi friendly connectors. Extra DF13 Cables can be easily purchased on ebay or from 3DR Robotics.

I used this tutorial to set it up.



The Raspberry Pi is powered using a LM2596 DC Adjustable Step-Down Converter that steps the 11V of the LiPo battery down to the 5V required to the Raspberry Pi. I had to set the voltage at 5.25 volts since as the Raspberry Pi drew more current, the voltage would sometimes drop. I discovered that when the voltage drops below approximately 4.96V, the Raspberry Pi will complain with a mini rainbow gradient icon that is usually seen as the splash screen.  Even with the rainbow icon at the corner, the Pi will continue to work, but operation may become unstable and the red power LED will no longer stay on.



I have ordered a nicer 3-amp 12V to 5V module that will hopefully solve the power problems I have encountered. Although the current module is advertised to be able to provide 2 Amps, I think the big gap between 11V to 5V is causing it issues.

To communicate between the Pi and the Pixhawk Flight Controller, I am using 3DR’s brand new open source DroneKit-Python library (installation). Currently, I have a python program that has both CherryPy (web server) and DroneKit code. They seemed to conflict at first, but I solved the issue by initializing the CherryPy server manually with:

To set up the communications with the drone, heres what I did:

Download the full code: pyserver

To start the code, first execute

sudo mavproxy.py –master=/dev/ttyAMA0 –baudrate 57600 –aircraft MyCopter

This starts a MAVProxy (command line ground station) connection between the Raspberry Pi and the drone. After a few seconds, the basic information for your drone should be displayed and you should be prompted with something like this when you press enter


If you see something like MAV>, the connection has not been established yet. Try checking the connection wires or restarting the system. Then, type:

module load droneapi.module.api

and to start the server:

api start drone.py

The Pi now starts a server at the location

<pi’s ip adress>:9090

To find the pi’s ip address, check out my ssh tutorial. I set up some really simple HTML code (No CSS yet) to control the drone and see stats coming back from it.

Screen Shot 2015-04-25 at 4.04.14 PM