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 –


    • For experiment purposes, try connecting the pixracer to pi zero uart only (no powering using usb or other power). So just using UART 5v GND TX RX. Also eliminate that TX RX are correctly connected.

      I use APM 2.X board for testing, if you have one to also test.

      Then if still errno x, I reckon it's mavlink/Jessie Lite issue on the pi zero/2. I have found jessie lite a bit of a pain in the rear for running mavproxy. Lots of permission problems. 

      I may try compiling an image again, and seeing if I can get a smoother running img going. Was my first 'working' attempt with Pi Zero V1.3 & Jessie Lite. Also feel free to start making your own img files and sending me links to post on Github if you are successful. 

    • I've read that Debian Jessie does not use inittab which was part of sysvinit. It's been replaced by systemd. In raspi-config I changed the serial back to what it was originally. I've modified /boot/cmdline.txt by swapping around ttyAMA0 and tty1. It still doesn't work.

    • @Benbojangles

      I've got the APM powered by USB and the Zero powered by the APM.

      Just tried connecting - --master=/dev/ttyAMA0 --baudrate 57600 -- aircraft MyCopter.

      same error message. swapped rx/tx, same problem. I don't think it's Jessie Lite.

      I think it all centres around the serial port so I'm going to do a bit of reading up.

    • @Glenn Gregory

      Just tried & ls /dev/ttyAMA*

      pi@raspberrypi:~ $ sudo -s
      Using MAVLink 1.0
      Using MAVLink 1.0
      Auto-detected serial ports are:
      Connect source_system=255
      Log Directory:
      Telemetry log: mav.tlog
      MAV> Waiting for heartbeat from

      root@raspberrypi:/home/pi# ls /dev/ttyAMA*
      ls: cannot access /dev/ttyAMA*: No such file or directory

    • @Glenn Gregory

      I did /dev last night and could not see ttyAMA0 listed. Also the error message refers to the file - Failed to connect to /dev/ttyAMA0 : [Errno 2] could not open port /dev/ttyAMA0: [Errno 2] No such file or directory: '/dev/ttyAMA0'

      I've just made up a cable for the APM telemetry socket (forgot it was 5 pin instead of 6 pin) When I've connected it all up, powering the zero from the APM I'll try and see what happens.

    • @Jon the no such file or directory may be referring to not finding if you run just that command alone do you get same error?
      It is strange that /dev/ttyAMA0 is disappearing. You confirmed this with ls /dev/ttyAMA*?
    • Your image is most likely fine, I don't think it's a Jessie Lite issue.

      I also tested with a Pi2 running an earlier version of Noobs, connected to a Pixhawk clone. This time I followed the tutorial here: and loaded pymavlink & mavproxy - same result.

      I think it is most likely that I'm missing something due to my lack of knowledge in this area. Before I disable the OS use of serial there is a ttyAMA0 file in /dev. After I disable it disappears. The command line from the tutorial 'sudo -s' then, ' --master=/dev/ttyAMA0 --baudrate 57600 --aircraft MyCopter' results in no such file or directory, which is correct because ttyAMA0 is no longer in /dev. I'm assuming that the ttyAMA0 is the name of the rx/tx serial port and it may now be called something else or I need to set it up somehow.

      I have an APM board, I will redo the test as you have suggested. It certainly keeps my old brain going!

      Thank you very much for your help.

      Communicating with Raspberry Pi via MAVLink — Dev documentation
  • Here's my latest PI companion drone, it's a DJI Inspired 3-D printed copy.  I modified it extensively to use the companion setup with the PixFalcon flight controller and a high-power WiFi adapter.  It uses the RPI3 with the version 2 camera.  


    PI is mounted on the bottom, protective cover not showing.  


    You need a long camera cable to make this work, but fortunately these are available online.  This was a very fun build!

This reply was deleted.