Companion: Pi 2/3/Zero

A discussion page to allow me to add my experiences using a Raspberry Pi 2/3/Zero V1.2/1.3 as a companion computer for Ardupilot/APM/Pixhawk flight boards. I will update my experiences as I learn, feel free to comment and offer tips, it's all free here.



I'm building a github for my experiments:

Drone Unit: Raspberry Pi Zero V1.3 + Pi Camera Module
img file:

Ground Unit: Raspberry Pi 2

img file: <to be added>

Goggles Unit: Raspberry Pi Zero V1.3

img file:

Ardupilot Technical Questions:

Also, if you have any technical code/hardware questions which you feel may take ongoing contributions and help over an extended timeframe, feel free to ask over on technical discussion page here

I will update as I get by, please contribute by offering your 'plug & play' wifi adapters using Raspbian Jessie. Also, if you happen to pick up this project, and are working faster than me, then please send us your own .img file experiments. Thanks.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –


  • Hi Glenn Gregory

    When I had it running back early June my Alfa did not randomly turn off. I did however have the Raspberry Pi 2 powered via a HiModel 5 Amp UBEC. I managed to change the rc.local file so that Mavproxy & the camera worked automatically with Tower. (Just had to press the connect on Tower). At the time I was running it for periods of up to 15 minutes or more with no problems.

    Since then I've been tinkering with a Sony QX100 and an Ubiquiti Loco M2 so I have not progressed further with the Pi.

    I bench tested the Pi/Alfa/UbiquitiM5 system today to to see whether the Alfa turned off. The only difference from early June is that I've taken the case off the Alfa and the black plastic off the aerial.

    I managed to connect the Pi to Tower but it dropped the connection after approx 5 seconds. I could reconnect immediately but every time it would drop after 5 seconds. The camera image would not display, probably because it was dropping connection. It did exactly the same on both my Nexus 7 tablet and mobile phone.

    On the Alfa board once the Pi boots up the blue led comes on then after a while the green led is displayed, at this stage I can connect to Tower. The green led remains steady whilst the blue led flashes. At no time as far as I'm aware did the Alfa turn off during my testing today.

    I suspect my problem isn't the Alfa but at the phone/tablet end. There may have been an android update which is causing my current problem.

    At your end how long does your Alfa work before turning off?

    Glenn Gregory said:

    Hi Jon, I am using the same Alfa USB wifi unit with a Raspberry Pi 2 and find the Alfa unit randomly turns off when running for a while. Have you seen similar issues?

  • Chances are it's trying to draw too much current from the raspberry.  If the raspberry uses too much power itself (cpu/camera draw), it might find itself without the power to power the alfa, which has a whacking big amplifier.  Try reducing the tx power of the alfa and see if it stabilises.

    Glenn Gregory said:

    Hi Jon, I am using the same Alfa USB wifi unit with a Raspberry Pi 2 and find the Alfa unit randomly turns off when running for a while. Have you seen similar issues?

  • Hi Jon, I am using the same Alfa USB wifi unit with a Raspberry Pi 2 and find the Alfa unit randomly turns off when running for a while. Have you seen similar issues?

    Jon said:

    Pi2 Pi camera & Tower - it works as per below, but I need to add the Pi video command to rc.local. I haven't managed to get it to work yet with both commands in the rc.local file

    rc.local file:

    echo $PATH


    export PATH

    cd /home/pi

    screen -d -m -s /bin/bash --master=/dev/ttyAMA0 --baudrate 115200 --aircraft MyCopter --out=

    ) > /tmp/rc.log 2>&1

    SSH in:

    raspivid -n -t 0 -w 640 -h 360 -fps 24 -b 6000000 -o - | gst-launch-1.0 -e -vvvv fdsrc ! h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host= port=9000


  • Hi Thomas

    Feel free to add your own PI camera geotagging thread here on the Companion Computer working group. you can also add a thread on the Ardupilot site. 

    Ideally the program would be setup to allow connection to a range of different GPS (incl RTK) and camera types (like pi camera, gopro etc), and should of course read mavlink (probably via mavproxy) to get its GPS info from a Pixhawk.

    These might help if you are starting out:


  • New tiny camera mount I made:


    Pi camera mount_tiny.stl

  • Code / Hardware / Wiring 

    If you have technical questions that may need ongoing discussion from other developers then help can be found here on technical forum, it might be a good thing to post here so this informal group chat area doesn't get consumed on a single issue, and also there are some skilled coders on who are active and capable of professional advice and discussion.

    But of course feel free to add your photos and success here :) :)


  • Testing the gopro dummy models, I found the top one was too big for my gimbal, so I measured a gopro 3+ and made this box (bottom) for mounting the pi camera. It has a single 2mm hole for a screw, you can add more holes easily using ingenuity. The box is hollow, and has a lid - you can fill the box with material to add weight to help balance your gimbal


    Gopro Pi Camera Dummy Mk2.stl

    • 3702635158?profile=original

      Fits nicely inside the G-2D

  • Woop! we have a pi Zero V1.3 working on Jessie Lite. Camera & Mavproxy working.

    # Download Link:

    # APMpi_Jessie_Lite_V1_0 - Tested on Pi Zero V1.3 - Also (probably) working for pi2/3 by Benbojangles (27/05/2016)
    - This .img file is V1 of a project I am working on. It is available under creative Commons License.

    - This .img file is a custom raspbian image created for the Raspberry pi, it includes:
    - Raspbian Jessie Lite (version from 24/05/2016)
    - Gstreamer
    - Mavproxy
    - SSH Enabled
    - Pi Camera enabled
    - Disabled O/S control of Serial port
    - Custom config.txt for performance
    - Static IP enabled

    File fits on 8gb sd card, and has 70% free space. Also fits on larger sd card (you can expand filesystem if wish to)

    # How to burn to SD card:
    - 1)Burn .img to sd card using win32diskimager.exe
    - 2)Boot pi Zero
    - 3)Jessie Lite is Command Line, so you plug in monitor & keyboard to setup wifi for ssh
    - 4)Connect to your wifi by typing in & then editing: sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
    - 4)Guide here:
    - 5)Input your wifi SSID & Password, then writeout file by <shift> + o, then exit by shift + x.
    - 6)Check you IP, type: ifconfig. it should show as (remember for ssh connection)
    - 7)Shutdown pi 2/3/Zero and unplug keyboard/mouse/screen, restart pi 2/3/Zero
    - 8)SSH connect: port:22 - username:pi password:raspberry
    - 9)run mavproxy & gstreamer with settings as you wish (or use my settings)

    - I hope to add more features in future once the groundpi 2/3/Zero is complete, there will not be a need to setup IP.

    - Thanks, suggestions/future .img versions to

    • That's very useful, thank you. I'm going to download it now.

This reply was deleted.