From PaparazziUAV
Revision as of 20:44, 15 November 2013 by Scdwyer (talk | contribs) (tweak binary install and uninstall instructions)

Jump to: navigation, search

Update on OS X installation: Currently, only launching agents from paparazzi center in 10.8 and arm-none-eabi-gdb on 10.6 should be broken (gcc-arm-embedded can be compiled by hand if required without python support, or installing python2.7 as a framework from a dmg might work). The simulator should be working again. The binaries are still unavailable as there has not been time to set up a new build server. (June 4, 2013)

(Nov. 15, 2013) Current OS X limitations:


Would it not be great to also be able to run Paparazzi from your shiny Apple Mac? Well, this page explains how you can manage to do just that.

The task of supporting Paparazzi on Apple MacOS X is ongoing as the project evolves and the more people adapt it the process will be streamlined. Presently it is known that Paparazzi will install on OSX versions 10.6.*, 10.7.*, 10.8.*, and 10.9.*. Support on 10.6.* requires some additional effort.

Basic Install (Binary Installer) (Support: 10.7.*)

If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.

    The steps you need to take to enjoy Paparazzi are:
  1. Install the latest available Xcode development tool for your OS, we had good success with Xcode v4.2 on Snow Leopard and v4.3.2 on Lion. For Snow Leopard, Xcode 3.2.6 also works and is still available as a free download with an Apple ID (search for xcode 3.2.6).
    1. With Xcode 4.3 and above you need to install the command line tools. Xcode --> Preferences --> Downloads --> Components --> Command line tools
    2. Check that the correct version of Xcode is being used for compilation
      /usr/bin/xcodebuild -version
      It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal:
      sudo /usr/bin/xcode-select -switch /Applications/
  2. Install the Paparazzi Tools installer for your OS version from
  3. That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.
    1. In spotlight type Terminal and then open the Terminal App
    2. then type:
      cd ~/paparazzi && make && ./paparazzi


  • the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.
  • the binary installer will add a few lines to your ~/.profile for PATH modification and for default PAPARAZZI_HOME and PAPARAZZI_SRC env vars. If you have something other than the default ~/paparazzi installation, please edit your ~/.profile and comment out the env var exports.
  • the binary installer creates a symbolic link between the available /opt/paparazzi/bin/python2.7 and /opt/paparazzi/bin/python. Combined with the PATH modification, this will cause
    to call /opt/paparazzi/bin/python2.7 instead of any system pythons.

Basic Uninstall

In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:

Warning This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.

rm -rf ~/paparazzi
sudo pprz-env-setup -u
sudo rm -rf /opt/paparazzi

Note that pprz-env-setup -u removes the entry from ~/.profile and also removes the /opt/paparazzi/bin/python symlink.

Using Luftboot and PyUSB

UPDATE: The lastest binary installer should have PyUSB included by default, no need to install it separately.

If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with PyUSB installed for that version.

To install PyUSB, execute

sudo python install

from inside the unzipped PyUSB source directory.

To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:


To start the default Python. At the Python prompt (>>>) type:

import usb

If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.

MacPorts and PyUSB

If you have MacPorts installed, you can install either py26-pyusb, py26-pyusb-devel or py27-pyusb-devel, depending on which Python(s) you have installed already, or wish to install. For example:

sudo port selfupdate
sudo port install py27-pyusb-devel

To find out what versions of Python are available on your system (via MacPorts):

port select --list python

Default Apple Python versions have a -apple ending.

Select a different version of python to be the active version if desired. For example:

sudo port select --set python python27

A good, working configuration would be to have MacPorts installed, and install py27-pyusb-devel, then ensure that python27 is the active version.


There are sometimes path issues with OS X if you have MacPorts or a similar (Homebrew, Fink) system installed. The reason for this is there may be multiple copies of a binary required for Paparazzi in different places, and depending on the path, the desired instance is not correctly called. This often presents itself as an error when building the main Paparazzi source code. A typical error may involve the pkg-config program. This can often be corrected by checking and adjusting your PATH environment variable.

To check the currently configured default PATH:

echo $PATH

Ideally, the Paparazzi binary paths (/opt/paparazzi/bin and /opt/paparazzi/sbin) should come first. To move the Paparazzi paths to the highest search priority:

export PATH=/opt/paparazzi/bin:/opt/paparazzi/sbin:$PATH

This will only be active in the current terminal session. If you wish to manually modify the path permanently, you can edit ~/.profile and add the above line to the bottom of the file.

Installing from source

The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.

In case you already have MacPorts installed, it is advised to run the following steps before proceeding:

  1. check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command
  2. env
  3. Then give the following command to make sure your ports are up-to-date
  4. sudo port selfupdate && sudo port upgrade outdated

    ..great, you now can run the installation steps starting from step 3 below.

If you don't already have MacPorts installed run the following steps:

  1. Install the latest XCode
  2. If you are using Mountain Lion, X11 is no longer included by default, use the XQuartz project to install it.
  3. Install MacPorts
  4. Edit the file
    and above the
    line add
    It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus:
    sudo nano /opt/local/etc/macports/sources.conf
  5. Now update the available ports with the command:
  6. sudo port selfupdate
  7. To install all of the paparazzi prerequisites:
  8. sudo port install paparazzi-tools
  9. ...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.
  10. After installation, we need to set the correct python to override the default OS X python:
  11. sudo port select --set python python27
  12. You can also change the GTK theme

Now you can follow the generic instructions for installing the paparazzi source.

NOTE: If you had previously used MacPorts to install Paparazzi, you may need to manually uninstall arm-none-eabi-binutils, arm-none-eabi-gcc-linaro, and arm-none-eabi-gdb prior to upgrading paparazzi-tools. libcmsis, libopenstm32 and libopencm3 ports may need to be uninstalled as well. For example:

sudo port uninstall -f libcmsis libopenstm32 libopencm3 arm-none-eabi-gdb arm-none-eabi-gcc-linaro arm-none-eabi-binutils

Lion and XCode 4.3 or newer notes

After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for isnstallation. Otherwise you will not find GCC in your unix path.

Also if macports is complaining about xcodebuild and that you should run

  1. sudo xcode-select -switch /Applications/

You should actually run

  1. sudo xcode-select -switch /Applications/

so that xcodebuild can find the needed executables for you.


If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.

One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts

  1. sudo port -f uninstall installed
  2. sudo port clean --all uninstalled
  3. sudo port selfupdate
  4. sudo port install paparazzi-tools

This was in fact the process used to check that the code installed on a clean machine.

Upgrading to Lion

If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example) To remedy this situation you need to do the following:

  1. Upgrade Xcode to the Lion version. (App Store --> Search for Xcode and install)
  2. Install the Lion version of MacPorts
  3. sudo port -f uninstall installed
  4. sudo port clean --all uninstalled
  5. sudo port selfupdate

Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:

  1. sudo port install paparazzi-tools

If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.

  1. Start console
  2. Plug in your USB to serial converter
You may get a message similar to this
Jul 26 23:14:48 Bernies[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.

If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the Prolific driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.

Keeping source files for debugging

If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.

This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.

For example:

 sudo port -k install paparazzi-tools

This will result in all of the source and build artefact files being left on the hard disk.

Should you later wish to clean up these files you can do so with the clean command.

For example:

 sudo port clean installed

Mavericks Notes

Q: Can not find the command line tools package in XCode any more.

A: Since Mavericks (10.9) it is not necessary to install xcode to install the command line tools package that is needed for macports and paparazzi. Just run in the command line:

 xcode-select --install

Q: libgcc is not compiling with error:

 :info:build The directory that should contain system headers does not exist:
 :info:build   /usr/include

A: You probably upgraded from older OS X and are using old command line tools. Make sure to run xcode-select --install command. This should fix the libgcc compilation error.

Running Paparazzi

Please see Installation for details on running Paparazzi, downloading source code from GitHub and updating software.

Paparazzi can be started in the usual way

cd ~/paparazzi

Changing the GTK look and feel

Run /opt/local/bin/switch2 to select a different theme. More detailed instructions can be found at

Additional themes can be downloaded from

A good choice is:

switch2 /opt/local/share/themes/ClearlooksClassic/

USB Drivers for Telemetry

No drivers need to be installed in order to program either the STM32 based or LPC2148 based autopilot boards (ie TINY, TWOG, Booz, Lisa/L, Lisa/M) using a USB port. However telemetry between the vehicle and ground control station requires a modem. On an Apple Mac this will generally be connected to a USB port. Whatever modem is used it will be necessary to load drivers that allow Paparazzi to communicate with the modem. It is not possible to describe all possible modems and their configuration. However the most commonly used chipset for USB to serial communication is produced by FTDI. Below is described the installation of the FTDI drivers. This can be used as a guide for installing drivers for modems using other chipsets.

FTDI drivers can be downloaded from FTDI

The device will probably become available as something like /dev/tty.usbserial-000013FD when connected. Note that different USB ports get different addresses. When connecting to another port the same device came up as /dev/tty.usbserial-000014FA

Since Paparazzi is currently configured to use /dev/ttyUSB0 it's easiest to just create a link to the required device.

  1. Remove all USB devices from the computer and run the command ls -l /dev/*usb* /dev/*USB* hopefully this will not list anything
  2. Plug in your radio and repeat the command ls -l /dev/*usb* /dev/*USB* this should now list the serial port that the radio has been connected to. In my case I get
        ls -l /dev/*usb* /dev/*USB*
    crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD
    crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD
  3. Next we need to create a symbolic link to the tty.usbserial device listed to /dev/ttyUSB0 in my case the command is sudo ln -s /dev/tty.usbserial-000013FD /dev/ttyUSB0
  4. To check that everything is correct run the first command again ls -l /dev/*usb* /dev/*USB* and you should get something like this
        ls -l /dev/*usb* /dev/*USB*
    crw-rw-rw- 1 root wheel 11, 27 20 Jan 14:38 /dev/cu.usbserial-000013FD
    crw-rw-rw- 1 root wheel 11, 26 20 Jan 14:38 /dev/tty.usbserial-000013FD
    lrwxr-xr-x 1 root wheel 0 20 Jan 14:42 /dev/ttyUSB0 -> /dev/tty.usbserial-000013FD

Once the FTDI driver (kernel extension) is loaded it takes over for all FTDI connections. This means that it will not be possible to program the Lisa/L or Lisa/M boards while the driver is loaded.

To unload the driver use the command

sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext

This should not give an error. if it does then try again a few times after quitting programs that may have used the connection. If the driver still fails to unload then a reboot may be required.

When it comes time to connect the modem again you'll again need the driver loaded. This can be done with the complementary command

sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext

Workaround for Issues with errors (Device busy) when trying to program a Lisa/L

Programming the Lisa on OS X

The problem: The "default" vendor id and product id for the ftdi device on Lisa is the same one used by all the manufacturers of clone usb-serial interfaces. This isn't an issue on Linux because of the udev rules file we use does not load the ftdi drivers for lisas programming interface. Windows and Mac OS X don't use this file so they can only use vendor id and product id. So as soon as you plug in Lisa they load USB->serial port drivers for the two ports they believe are on Lisa causing a conflict. The programming of Lisa happens through a different mechanism and does not want the programming interface of Lisa to be taken by the FTDI driver which has already been loaded. For OS X there is a hack we can do that makes it better until we can get vendor and product ids sorted out. It involves modifying the /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist file. We change it so only the first of the two serial interfaces is loaded. The second is not as it is the programming interface.

The File (edit with a text editor):


Here is a diff between a "vanilla OS X" and one that has been modified (Essentially below was removed):

quadzilla:Contents root# diff ~/Info.plist Info.plist 
< 		<key>FT2232C_B</key>
< 		<dict>
< 			<key>CFBundleIdentifier</key>
< 			<string>com.FTDI.driver.FTDIUSBSerialDriver</string>
< 			<key>ConfigData</key>
< 			<dict>
< 				<key>LatencyTimer</key>
< 				<integer>2</integer>
< 			</dict>
< 			<key>IOClass</key>
< 			<string>FTDIUSBSerialDriver</string>
< 			<key>IOProviderClass</key>
< 			<string>IOUSBInterface</string>
< 			<key>bConfigurationValue</key>
< 			<integer>1</integer>
< 			<key>bInterfaceNumber</key>
< 			<integer>1</integer>
< 			<key>idProduct</key>
< 			<integer>24592</integer>
< 			<key>idVendor</key>
< 			<integer>1027</integer>
< 		</dict>
< 		<key>FT2232H_B</key>
< 		<dict>
< 			<key>CFBundleIdentifier</key>
< 			<string>com.FTDI.driver.FTDIUSBSerialDriver</string>
< 			<key>ConfigData</key>
< 			<dict>
< 				<key>LatencyTimer</key>
< 				<integer>2</integer>
< 			</dict>
<  			<key>IOClass</key>
< 			<string>FTDIUSBSerialDriver</string>
< 			<key>IOProviderClass</key>
< 			<string>IOUSBInterface</string>
< 			<key>bConfigurationValue</key>
< 			<integer>1</integer>
< 			<key>bInterfaceNumber</key>
< 			<integer>1</integer>
< 			<key>bcdDevice</key>
< 			<integer>1792</integer>
<  			<key>idProduct</key>
< 			<integer>24592</integer>
< 			<key>idVendor</key>
< 			<integer>1027</integer>
< 		</dict>

Once you have edited the file

- sudo kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext/
- sudo kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext/

To reload the driver or you can just reboot.

It is expected as Paparazzi moves to supporting more operating systems that unique product and vendor ids will be obtained thus removing the need for this step.

Installing FlightGear

FlightGear has been packaged for use on OS X. This package can be downloaded from:

There are several packages available. Recently, FlightGear 2.6.0 was released. A binary for OS X is available, and seems to work properly on Lion (OS X 10.7.4). Follow the directions here for installation and basic usage. Additional documentation can be found here.

Screenshot of FlightGear launch gui in OS X with options for visualizing Paparazzi simulations

Once FlightGear is installed, the GUI launcher can be used to set common options. By clicking on the Advanced Features arrow, one can gain access to many more options as well as an interface to specify command line options (the Others tab). This is where one can specify the flight dynamics model and network connectivity required for visualizing Paparazzi simulations as described on the Simulation page.

  • In Paparazzi Center, add to the simulator command the -fg option plus the IP address of the machine running flightgear in this case the loopback interace is used as Flightgear and Paparazzi are running on the same machine:
.../sw/simulator/launchsitl -a TJ1 -fg -boot -norc

Note TJ1 is the name of the aircraft you must substitute this with the name of your aircraft.

  • Launch Flight Gear with the following set in the others tab under advanced settings:
--fdm=null --native-gui=socket,in,30,,5501,udp

For Flight Gear visualization, version 2.6 or greater is best. If you wish to use version 2.4 or lower, you must add the following to the firmware section of your airframe file:

  <firmware name="fixedwing or rotorcraft">
     <define name="FG_2_4" value="1"/>
Screenshot of Flightgear visualizing the default Microjet simulation in OS X (not the default Muret, FR location)

If it is night in FlightGear and you wish to view the simulation in daylight, follow the instructions on the Simulation page.

Simulations Using JSBSim

JSBSim is an open-source flight dynamics and control software library. It can provide a more realistic simulation environment over the basic built-in Paparazzi simulator. See the Simulation page for background information and how to run a normal simulation. After this can be done in a satisfactory manner, follow the steps below to utilize the JSBSim flight dynamics model.

Please see JSBSim for installation instructions and Simulation#JSBSim for instructions on how to use the JSBSim FDM in simulations.

Differences with the Linux version

This section is intended to document all the subtle differences between Linux and Mac OS X versions of Paparazzi.

Change of text editor

The default editor in Linux is gedit, but in OS X, it is open, which simply uses whatever the default program for opening .xml files is setup.

Ivy subnet mask

On Linux, the Ivy submask is

On Mac OS X, the Ivy submask is

In C applications, such as tmtc/c_ivy_client_example_1.c, this should be set adaptively by something like:

 #ifdef __APPLE__
  printf("Mac OS, network submask:\n");
  printf("NO Mac OS, network submask:\n");

Is there a better way to do this?