Difference between revisions of "Installation/Linux"

From PaparazziUAV
Jump to navigation Jump to search
 
(183 intermediate revisions by 28 users not shown)
Line 1: Line 1:
<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree>
__TOC__
'''<span style="color:red">This page only describes the installation of the prerequisite tools and dependencies on Debian/Ubuntu needed for Paparazzi.</span>'''
'''See the general [[Installation]] page for how to [[Installation#Getting_the_Source_Code|download Paparazzi]] and [[Installation#Launching_the_Software|launching it]] after you followed the instructions here.'''
== Introduction ==
== Introduction ==


Paparazzi is very easily installed on any laptop or workstation running the [http://www.ubuntu.com/ Ubuntu Linux OS] or virtually any [http://www.debian.org/ Debian] based [http://en.wikipedia.org/wiki/Linux Linux].
Paparazzi is very easily installed on any laptop or workstation running [http://www.ubuntu.com/ Ubuntu], [http://www.debian.org/ Debian] (or any of their derivatives).


At a high-level here are the steps required to install Paparazzi:
The steps required to install the software needed to be able to let your UAS fly
<ul>
<ul>
<li>Dedicate a Laptop or PC for Paparazzi. Dedicate means during install you select to use the entire disk for the installation and erase any previous Linux or Windows OS installed.
<li>[[Installation/Linux#Installation_of_dependencies|Install the basic Paparazzi dependencies]] and the [[Installation/Linux#ARM_embedded_toolchain|ARM cross compiling toolchain.]]
<li>Installation takes place with a recent build of Linux using the default options.
<li>[[Installation#Getting_the_Source_Code|Download the source code from the source repository.]]
<li>The Linux package sources file is updated to add the Paparazzi packages (/etc/apt/sources.list)
<li>Allow access to your PC hardware connection by adding appropriate [[Udev]] rules.
<li>The Linux packages are updated from the network with the "update" command
<li>[[Installation#Launching_the_Software|Compile the binaries from the sources and launch the software.]]
<li>The Paparazzi packages are installed (sudo apt-get install paparazzi-dev paparazzi-arm7)
<li>The brltty package is removed to avoid issues (sudo apt-get remove brltty)
<li>Install subversion to get SVN (sudo apt-get install subversion). Don't worry if it's already installed.  
<li>Bring down the sources from the SVN repository: (svn co svn://svn.savannah.nongnu.org/paparazzi/paparazzi3/trunk paparazzi3). Just change the paparazzi3s to paparazzi4s for Booz files.
<li>Allow access to the ports by copying the [http://www.openuas.org/pub/writing_udev_rules.html rules file]: (export PAPARAZZI_HOME=~/paparazzi3; sudo cp $PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules /etc/udev/rules.d/)
<li>Compile the binaries from the sources (cd paparazzi3 && make)
</ul>
</ul>


That's all. For the sources file (sources.list) you only add the line required for your version. Linux names their versions.  
Users of other Linux flavors than a recent Ubuntu or Debian and anyone needing manual control of each individual package can [[Installation/Manual|install them independently]].


=== Operating System ===
===For the impatient===


Paparazzi is very easily installed on any laptop or workstation running the [http://www.ubuntu.com/ Ubuntu Linux OS] or virtually any [http://www.debian.org/ Debian] based [http://en.wikipedia.org/wiki/Linux Linux]. Paparazzi is packaged for Debian as well as all of its dependencies. The [http://paparazzi.enac.fr/debian repository] hosted at ENAC holds their latest version.
For Ubuntu add the [https://launchpad.net/~paparazzi-uav/+archive/ppa paparazzi-uav ppa] <tt>sudo add-apt-repository ppa:paparazzi-uav/ppa</tt> and install the <tt>paparazzi-dev</tt> package.


It is also possible to have your Debian/Ubuntu running in a virtual machine, for instance with [http://www.virtualbox.org/ VirtualBox]. This requires minimal changes to your computer setup, as you can run the VM from all common platforms (Windows, Mac OS X, Linux). The virtual machine image can easily be transferred between different laptops, giving greater flexibility. Unfortunately, the Open-Source Edition of VirtualBox doesn't include the necessary USB support, so you'll need to get the regular version from the website.
Since Paparazzi v5.0 the [https://launchpad.net/gcc-arm-embedded/ gcc-arm-embedded toolchain] is recommended.
Available as of Ubuntu 14.04, on older versions it can be [[Installation/Linux#ARM_embedded_toolchain|installed via tarball]].


If you are new and this is your first time installing it is suggested you keep it simple. Select a system you can dedicate to the Linux installation. No VMs or dual boot configurations. The idea is do a very simple generic installation that is certain to have no issues. This reassures you that the installation process works and you can see and use a working Paparazzi install for some time before you try a more complicated install. The install is well documented below and certain to succeed if followed exactly. Most issues arise when someone unfamiliar with Linux tries a non-standard install that requires special steps not documented here.
Or just use the [[Installation#Quickstart_on_Ubuntu_12.04|Quickstart for Ubuntu 12.04 LTS]].


=== Precompiled Binaries ===
== Installation video Tutorials ==


Precompiled binaries can be downloaded and executed with the ''paparazzi-bin'' package. To enjoy the power and flexibility of open-source code, you will soon want to configure the airborne autopilot and ground station according to your needs and recompile it. Therefore you need to install the compilers and download the source code.
{{#ev:youtubehd|SshFJrBuku8}} {{#ev:youtubehd|eW0PCSjrP78}}


The Paparazzi packages for a Debian based Linux are hosted at the [http://www.recherche.enac.fr/paparazzi/debian ENAC repository].
== Installation of dependencies ==


=== Compilers and Handlers ===
=== Ubuntu ===
'''Binary packages for Ubuntu are available for the ''i386'', ''amd64'' and ''armhf'' architectures.'''


The typical installation contains all of the necessary C and OCaml compilers as well as some XML and [http://www.tls.cena.fr/products/ivy/ Ivy] handlers. These tools are provided by the ''paparazzi-dev'' package. Have no fear, this is all taken care of for you so all you must do is type a few simple commands. Below are those commands and helpful information. Commands can be copied and pasted from these pages to make it as easy as possible.
Add the installation sources for the Paparazzi software packages. Run from a terminal:
sudo add-apt-repository ppa:paparazzi-uav/ppa


=== Source Code ===
Then update the systems package inventory and install the main Paparazzi software dependencies. This will take some time.
sudo apt-get update
sudo apt-get install paparazzi-dev


The Paparazzi source code is hosted by [https://savannah.nongnu.org/svn/?group=paparazzi Savannah]. It is downloaded using [http://subversion.apache.org/ Subversion] or [[git]].
=== Debian ===
'''Binary packages for Debian are available for the ''i386'' and ''amd64'' architectures. ''armhf'' packages seem to be currently not supported by the OpenSUSE build service.'''


== Installation of Compilers and Handlers ==
For Debian Wheezy (7.0), Jessie (8.0), Stretch (9.0) and Buster (10) packages are built using the [http://openbuildservice.org/ Open Build Service (OBS)] on [https://build.opensuse.org/project/show?project=home%3Aflixr%3Apaparazzi-uav OpenSUSE Build Service project home:flixr:paparazzi-uav]


=== From the Command Line ===
[http://software.opensuse.org/download/package?project=home:flixr:paparazzi-uav&package=paparazzi-dev Install paparazzi-dev]
Just add the following lines to your repository list (<b>/etc/apt/sources.list</b>) and then
uncomment the line relevant to your operating system (e.g. one of etch, gutsy or hardy):


Note: Because of the sources.list file permissions maybe you will need to edit it with root access. In Terminal write this:
First add the key:
wget -q "http://download.opensuse.org/repositories/home:/flixr:/paparazzi-uav/Debian_10/Release.key" -O- | sudo apt-key add -


  gksudo gedit /etc/apt/sources.list
Add the appropriate repo, depending on your Debian version to sources.list
  echo "deb http://download.opensuse.org/repositories/home:/flixr:/paparazzi-uav/Debian_10/ ./" | tee -a /etc/apt/sources.list
echo "deb http://download.opensuse.org/repositories/home:/flixr:/paparazzi-uav/Debian_9.0/ ./" | tee -a /etc/apt/sources.list
echo "deb http://download.opensuse.org/repositories/home:/flixr:/paparazzi-uav/Debian_8.0/ ./" | tee -a /etc/apt/sources.list
echo "deb http://download.opensuse.org/repositories/home:/flixr:/paparazzi-uav/Debian_7.0/ ./" | tee -a /etc/apt/sources.list


{{Box Code|/etc/apt/sources.list|
Update the systems package inventory and install the main Paparazzi software dependencies.
# Uncomment just _one_ of the following lines - depending on your OS version
  sudo apt-get update
# deb <nowiki>http://paparazzi.enac.fr/debian</nowiki> etch main
  sudo apt-get install paparazzi-dev
# deb <nowiki>http://paparazzi.enac.fr/debian</nowiki> lenny main
  # deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> gutsy main
  # deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> hardy main
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> intrepid main
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> jaunty main
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> karmic main
# deb <nowiki>http://paparazzi.enac.fr/ubuntu</nowiki> lucid main
}}


Then, update your sources and '''either''' install the precompiled <b>bin</b>aries
== ARM embedded toolchain ==
sudo apt-get update
sudo apt-get install paparazzi-bin
<b>or</b> the dependencies needed for recompiling from the source (<b>dev</b>), and the cross-compiler (<b>arm7</b>) :
sudo apt-get update
sudo apt-get install paparazzi-dev paparazzi-arm7


It is not recommended to install both <tt>paparazzi-bin</tt> <b>and</b> <tt>paparazzi-dev</tt>. While the <b>bin</b> package is self-contained and should be sufficient for users who do not want to patch the code, the <b>dev</b> meta-package provides only the tools to compile the source code which must be separately downloaded, from an archive or the SVN repository.
For current Paparazzi versions (v5.0 and above) the [https://launchpad.net/gcc-arm-embedded/ gcc-arm-embedded toolchain] is recommended, which also supports the STM32F4 with FPU (hardware floating point).


Note: The ivy-python package now among the dependencies of paparazzi-dev is also available in the normal paparazzi repository. [https://launchpad.net/~uce-launchpad/+archive/ppa Allen Ibara] might have some newer versions in his PPA but you should not need them.
=== gcc-arm-none-eabi as Debian/Ubuntu package ===


==== Optional/Obsolete Packages ====
'''This is the recommended method'''
Users of older AVR based boards will also need the paparazzi-avr package.


==== Extra for Ubuntu ====
Note that there are actually two '''different''' toolchains available!
* [https://launchpad.net/gcc-arm-embedded/ ARM gcc-arm-embedded toolchain] with Debian package name ''gcc-arm-embedded''
** includes libstdc++ and newlib-nano
* [https://packages.debian.org/jessie/gcc-arm-none-eabi Debian gcc-arm-none-eabi toolchain]
** does not include libstdc++
** does not include newlib-nano


On older Linux distributions, the Braille TTY driver interferes with FTDI USB Serial adapters. If somehow your FTDI serial adapter does not work, remove the package via:
Both toolchains ''should'' work for most use-cases (if you don't need C++ or nano specs), although the [https://launchpad.net/gcc-arm-embedded/ ARM gcc-arm-embedded toolchain] is better tested.


sudo apt-get remove brltty
==== gcc-arm-embedded toolchain ====


=== Using Synaptic Package Manager ===
'''This is the recommended toolchain'''
* Launch ''Synaptic Package Manager'' (''Applications/System'' Tools Menu)
* In '''Settings/Repositories''', add a new repository on URI = '''<nowiki>http://paparazzi.enac.fr/debian</nowiki>''', Distribution = '''etch''', Section = '''main''' . For Ubuntu, replace '''debian''' by '''ubuntu''' and '''etch''' by '''gutsy''', '''hardy''', '''karmic''' or '''lucid'''
* Search for <tt>paparazzi-bin</tt>, <tt>paparazzi-dev</tt>, and <tt>paparazzi-arm7</tt> packages (use the ''Search'' button)
* Mark them for installation (right-click on package names)
* Left-click on ''Apply''


=== Manual Installation of Individual Packages ===
On ''most'' Ubuntu versions the [https://launchpad.net/gcc-arm-embedded/ gcc-arm-embedded toolchain] can be installed as a debian package from the [https://launchpad.net/~team-gcc-arm-embedded/+archive/ubuntu/ppa ppa]:
Users of other Linux flavors or anyone needing manual control of each individual package can install them independently.  The list of dependencies of the Debian package is located in the [http://svn.savannah.gnu.org/viewvc/paparazzi3/trunk/debian/control.lenny?root=paparazzi&view=markup <tt> debian/control.lenny</tt>] file and may help users of other distributions.
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt-get update
sudo apt-get install gcc-arm-embedded


The binary packages and some corresponding source tarballs can be downloaded from
<div class="toccolours mw-collapsible mw-collapsed" style="width:800px">
Previously there was a PPA by terry.guo that contained this toolchain under the package name ''gcc-arm-none-eabi''
<div class="mw-collapsible-content">
See https://launchpad.net/gcc-arm-embedded/+announcement/13824 for details on how to switch the newer
PPA and package.
</div></div>


http://paparazzi.enac.fr/debian/dists/etch/main/binary-i386/
==== gcc-arm-none-eabi Debian toolchain ====


For distributions using RPM packaging, the [http://packages.debian.org/unstable/source/alien alien] tool can be used to translate a .deb package into a .rpm package.
Current Debian ('''jessie''') and Ubuntu (14.04 '''trusty''' and later) releases have the gcc-arm-none-eabi package in the official repositories ('''universe'''), and can be installed with:
sudo apt-get update
sudo apt-get install gcc-arm-none-eabi gdb-arm-none-eabi


For Fedora (Core8) users, you can install the following packages from standard repository:
=== ARM gcc-arm-embedded tarball ===
* ocaml.i386
Another way is to download and unpack the tarball and add it to your PATH:
* ocaml-camlimages-devel.i386
* ocaml-lablgtk-devel.i386
* ocaml-xml-light-devel.i386
* boa.i386
* libgnomecanvas-devel.i386
* libusb-devel.i386
* pcre-devel.i386
* arm-gp2x-linux-gcc.i386
* arm-gp2x-linux-binutils.i386
* glade2.i386
* and gcc, make, subversion, gnuplot, imagemagik...


Then you need [http://packages.debian.org/unstable/source/alien alien] tool to convert packages from the paparazzi repository:
* Download gcc-arm-none-eabi-*-*-linux.tar.bz2 from [https://launchpad.net/gcc-arm-embedded/+download External Downloads] section of ARM gcc-arm-embedded project
* ivy-c
* Unpack it to a directory of your choice
* ivy-c-dev
* Add the bin folder in to your PATH
* ivy-ocaml (WARNING: debian and fedora have different path for ocaml (/usr/lib/ocaml/<version> vs. /usr/lib/ocaml), so you need to move by hand the files in /usr/lib/ocaml/<version> to /usr/lib/ocaml)
* lpc21isp


== Downloading the Source Code ==
e.g.:
'''Important:''' If you use paparazzi-bin you need not to download the source code.
cd ~
wget https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q2-update/+download/gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2
sudo tar -vjxf gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2 -C /opt
rm -r gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2
exportline="PATH=$PATH:/opt/gcc-arm-none-eabi-4_7-2013q2/bin"
if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
source ~/.profile


After the <tt>paparazzi-dev</tt> package is installed the complete source code should be downloaded from one of the software repositories.
The file .profile will be sourced in every bash after logging out and in again. Until then,
=== Subversion ===
  source ~/.profile
See the [http://savannah.nongnu.org/svn/?group=paparazzi project page] at Savannah for more details. From the directory of your choice type:
can be used for every bash individually.
  svn co svn://svn.savannah.nongnu.org/paparazzi/paparazzi3/trunk paparazzi3
or if you are behind a firewall with an http proxy available:
svn co http://svn.savannah.gnu.org/svn/paparazzi/paparazzi3/trunk paparazzi3
after configuration of your proxy in the <tt>~/.subversion/servers</tt> file


This will download all of the code and install it into <tt>paparazzi3/</tt>
If you can not access your toolchain with PATH working, look a the [[Installation/Linux#Troubleshooting]].


If you cannot use the Subversion install, daily updated tarballs can also be fetched from the [[Downloads|Downloads]] page.
=== Old toolchain for Paparazzi v4.x and earlier ===


=== Git ===
'''For Paparazzi v4.x''' and earlier you need to install the <tt>paparazzi-arm-multilib</tt> package. It has support for both ARM7 (i.e. Tiny,TWOG,YAPA autopilot boards) as well as STM32F1 (i.e. LISA boards).<br>
You can also get the source code via [[git]].
'''This toolchain does not properly support STM32F4 based autopilots!!'''


== Launching the Software ==
You can install it explicitly with:
sudo apt-get install paparazzi-arm-multilib


=== Using paparazzi-bin ===
== Optional Packages ==


If you are using the <tt>paparazzi-bin</tt> package or the Live-CD, just launch the <tt>paparazzi</tt> binary application and you will be guided through the installation of your personal configuration files.
The packages <b>lpc21isp</b> and <b>openocd</b> are normally '''automatically installed''' as they are recommended packages of paparazzi-dev, '''if not''' you can manually install them via:
 
=== Using Source Code ===
sudo apt-get install lpc21isp openocd
 
If you are using the source code, the first step is to compile it. From the <tt>paparazzi3</tt> directory (<tt>cd paparazzi3</tt>), run
 
make
 
You will have to run this command after each update of the source (<tt>svn update</tt> command).
Launch the software from the <tt>paparazzi3</tt> directory with
 
./paparazzi
 
From the [[Paparazzi_Center|Paparazzi Center]] interface, select the ''MJ5'' aircraft, select the ''sim'' target and ''Build'' it. Then ''Execute'' the ''Simulation'' session. The prcedure is detailed in the [[Simulation]] page.


=== Quick Launch Icon ===
<tt>lpc21isp</tt> is needed to serially flash the LPC2148 based autopilots (e.g. bootloader for tiny, twog, umarim), <tt>openocd</tt> is for flashing via JTAG (e.g. for Lisa boards) and debugging.


To create an icon on the desktop so you don’t have to manually type codes into the Terminal each time you want to start the GCS follow these steps:
== Installing and running Paparazzi ==


#Save [[Media:Paparazzi_logo.gif‎|this image file]] to your /paparazzi3 folder
Please see [[Installation#Getting_the_Source_Code|Getting the Source Code on the general Installation page]] for details on downloading the Paparazzi source code, compiling and running it.
#Right click anywhere on the Ubuntu desktop and click Create Launcher.
#Enter the following in the fields provided:
#*Name: Paparazzi GCS
#*Command: /home/YOUR_USER_NAME/paparazzi3/paparazzi
#*Comment: Runs the Paparazzi GCS
#*Then click the icon image in the top left on the dialog box and select the Paparazzi logo you just downloaded.
#Click the OK button and that’s it! Your icon should appear on the desktop and you are ready to go.


=== Agents ===
== Udev rules ==


If ('''and only if''') you want to directly launch some Paparazzi agents (the ''Tools'' of the [[Paparazzi_Center|Paparazzi Center]]), without using the Paparazzi Center, you must have the Paparazzi source and home environment variables set correctly in your shell. These variables can be automatically set in your shell by adding the following lines to your .bashrc file:
Add the appropriate [[Udev]] rule (available in fhe file ''50-paparazzi.rules'') to the USB handlerSimply copy as root <tt>conf/system/udev/rules/50-paparazzi.rules</tt> to <tt>/etc/udev/rules.d/</tt>, e.g in a terminal:
{{Box Code|~/.bashrc|
  export PAPARAZZI_HOME<nowiki>=</nowiki>''your paparazzi3 directory''
export PAPARAZZI_SRC<nowiki>=</nowiki>''your paparazzi3 directory''
}}


=== env Variables ===
cd <your paparazzi directory>
sudo cp conf/system/udev/rules/50-paparazzi.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules


If you wish to manually set the env variables (i.e. when compiling a backup copy of your code in a different folder) execute the following command from the folder you wish to set as your active paparazzi folder:
See the [[Udev]] page for more details.
export PAPARAZZI_HOME=`pwd`;export PAPARAZZI_SRC=`pwd`
Verify that your variables are set correctly with the following command:
env | grep PAPARAZZI
which should return the following:
PAPARAZZI_HOME<nowiki>=</nowiki>''your paparazzi3 directory''
PAPARAZZI_SRC<nowiki>=</nowiki>''your paparazzi3 directory''


== Setting access rights for USB download ==
== Troubleshooting ==


This may be required to flash the Paparazzi-boards directly thru USB. For flashing details, see [[Compiling]].
=== No access rights for USB devices ===


Default linux rights may not allow standard (non root) users to directly access the USB bus. You will need to make yourself a member of the plugdev "group" and then create a "rule", associated with that "group". <br>
Some Linux distributions, don't allow standard (non admin) users to directly access the USB bus by default. On recent Ubuntu/Debian versions the first/main user is already a member of the ''plugdev'' group which should be sufficient for most cases.<br>
Make yourself a member of the ''plugdev'' group:
If you have problems, make yourself a member of the ''plugdev'' and ''dialout'' groups:


  sudo adduser <your login> plugdev
  sudo adduser <your login> plugdev
sudo adduser <your login> dialout


Logout and login again. Then add the appropriate rule (available ine fhe file ''10-paparazzi.rules'') to the USB handler.  Simply copy as root <tt>$PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules</tt> to <tt>/etc/udev/rules.d/</tt>
Logout and login again.


sudo cp $PAPARAZZI_HOME/conf/system/udev/rules/10-paparazzi.rules /etc/udev/rules.d/
=== arm-none-eabi-gcc: Command not found ===
Appeared on Debian Wheezy 7 (gcc-arm-none-eabi-4_8-2013q4 installed via tarball)<br/>
If this error occurs, maybe the [https://packages.debian.org/de/wheezy/ia32-libs ia32-libs] are missing.


== Software Updates ==
Enable multiarch and install ia32-libs:
Paparazzi is a very rapidly evolving project and as such, you will find that variables and functions are frequently added, changed, or removed. Update your software with care and caution, and always test the functionality on the ground and in the air as some updates will affect tuning parameters. Your airframe file will not be updated by the Subversion (SVN) system and therefore any new or modified variable names will need to be added manually.  The compiler will usually identify the problem variables at which point you can look at some of the most recent airframe files on SVN to find the proper syntax.  See the [[Compiling]] page for more help if needed.
  dpkg --add-architecture i386
<br>
  apt-get update
That said, keeping your software up to date is easy with the Subversion system. The system will compare all source code files with the server and update any that are needed, automatically merging any minor changes that you have incorporated along the way.
  apt-get install ia32-libs


To download and automatically merge any updated source files, run the following command from your Paparazzi directory
=== arm-linux-gnueabi-gcc cross-compiler not found ===
svn update


After any SVN update or source code modification the code can be recompiled from ''your paparazzi3 directory'' with the following command:
=== Ubuntu ===
apt-get install gcc-arm-linux-gnueabi


make
=== Debian ===
Starting with jessie, there were [https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771496#41 some changes] to the way cross-compilers are set up. To make it work you will have to add armel architecture and pick up some crossbuild tools.


The ''make'' command will only recompile portions of the software where changed have been detected. If it does not behave as expected you can deleted all compiled files and recompile from scratch with the following commands:
First edit your /etc/apt/sources.list and add the following line, to enable the emdebian repo:
deb http://emdebian.org/tools/debian/ jessie main


make clean
Run the following command in your terminal to add the keys for it
  make
  curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | sudo apt-key add -


See the [[Compiling]] page for more info.
Then you could add armel architecture and fetch the missing cross-compiler packages
dpkg --add-architecture armel
apt-get update
apt-get install crossbuild-essential-armel


Users making changes to their code structure may prefer to have more control over the updating and merging process and may wish to install and use '''tkdiff''' instead which provides highlighted comparisons of any files that differ between your code and the SVN server and allows for a file by file update.
You could find out more about cross-toolchains in jessie on debian [https://wiki.debian.org/CrossToolchains wiki page].


To update your Linux distribution as well as any dependencies of Paparazzi (seldom necessary), run the following:
Note that some of your repos might not mirror embedded architectures, which would give you an error when you try to update the sources. In that case you will have to specify which architecture you do want from them by editing the corresponding entry in your sources.list file, in a way described [https://wiki.debian.org/Multiarch/HOWTO here]. Like in this example with the crunchbang repo you could specify it by adding [arch=amd64,i386] to the line, so you only enable amd64 and i386 architectures:
deb [arch=amd64,i386] http://packages.crunchbang.org/waldorf waldorf main


sudo apt-get update
===arm-none-eabi-gdb: error with libncurses.so.5===
sudo apt-get upgrade
Appeared on Xubuntu 14.04 LTS (gcc-arm-none-eabi-4_8-2013q4 installed via tarball)<br/>
Terminal output: arm-none-eabi-gdb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory


== Using the Live CD==
If this error occurs, maybe [http://packages.ubuntu.com/search?keywords=lib32ncurses5 lib32ncurses5] is missing. <br/>
Found on [https://answers.launchpad.net/gcc-arm-embedded/+question/226680 launchpad q&a]


[[Image:Lightscribe_CD_Cover_1.JPG|thumb|320px|LightScribe CD Cover]]
=== FTDI serial adapter not working on old Ubuntu version ===


The LiveCD is an easy way to test Paparazzi: no installation is required and no changes are made to your computer.  Simply burn the image as a boot CD and reboot!  The LiveCD includes Linux and the complete paparazzi binary package (code source, tools and cross compilers).  It is intended for demonstration only and not frequently updated but it contains the complete system and can store changed files on a pen drive or compressed file on your hard drive so that it can compile, flash, and operate any aircraft, albeit slowly. 
On older Linux distributions (not needed for lucid and later), the Braille TTY driver interferes with FTDI USB Serial adapters. If somehow your FTDI serial adapter does not work, remove the package via:
The CD image and a howto on [[Using the Boot CD]] is available from the [[Downloads|Downloads]] page.
 
The Paparazzi demo is launchable on the Live CD from the Paparazzi icon.
 
Knoppix allows for all the user data to be saved on a hard disk partition (most file systems are supported) or on a removable device (typically a USB pendrive). Note that this action is not destructive: the user data tree is compressed and stored on your file system as a single file (<tt>knoppix.img</tt>).
* From the Knoppix menu (second from bottom left), choose '''Configure''', '''Create a persistent KNOPPIX disk image'''
* Choose your media (be sure to connect your USB pendrive before booting!)
* Choose if you want an encrypted filesystem (to protect your flight plan designed for the next MAV competition :-) )
* Choose the size of your home directory (100Mb is recommended)
On the next reboot, this saved state will be automatically located and loaded.
 
Using this persistent feature, the Paparazzix Live CD can really be used to configure, simulate and fly an aircraft with the Paparazzi system.
 
The Live CD can also be used to install a Debian system on the hard disk, using the <tt>knoppix-installer</tt> command. Be sure to backup the hard disk before trying ...


sudo apt-get remove brltty


A LiveCD needs some looks... In color or in LightScribe format, your CD will always look cool.
=== Code not starting on autopilot after changing gcc ===
* Get the PDF version for download here [http://paparazzi.enac.fr/wiki_images/Lightscribe_CD_Cover_1.pdf LightScribe CD Cover 1].


* The LightScribe version is in Nero Cover Design format (.ncd) and it's here for download [http://paparazzi.enac.fr/wiki_images/Lightscribe_CD_Cover_1.zip LightScribe CD Cover 1]
If you changed the toolchain (e.g. installed a new one for having FPU-Support for the F4), you need to run


* Better is of course to use it on an OpenSource OS, some Linux software to be found here: [http://www.lightscribe.com/downloadSection/linux/index.aspx?id=814 Lightscribe for Linux]
make clean && make


== From Scratch==
in sw/ext in order to rebuild the libs. Otherwise the embedded code can behave strange (most likely not start)


In very rare occasions one needs to install the tools used, third-party libraries used by Paparazzi all from scratch. There are are the moment no 64Bit Linux repositories, that is a very good reason to install from scratch. Sometime one just wants to be able to use all the latest and greatest compilers, or source code of everything to improve something. Then there is no other way than to install from scratch. To help you out getting it all smoothly working [[install_paparazzi_and_everything_from_scratch | a special page is created just click here]]. If you do not understand what that all means, do not panic, then the information on that page is not important to you. Just pretend you never read this part of the Wiki. You are advised just to follow the regular step as described on the install page.
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]

Latest revision as of 09:55, 5 February 2020

This page only describes the installation of the prerequisite tools and dependencies on Debian/Ubuntu needed for Paparazzi.

See the general Installation page for how to download Paparazzi and launching it after you followed the instructions here.

Introduction

Paparazzi is very easily installed on any laptop or workstation running Ubuntu, Debian (or any of their derivatives).

The steps required to install the software needed to be able to let your UAS fly

Users of other Linux flavors than a recent Ubuntu or Debian and anyone needing manual control of each individual package can install them independently.

For the impatient

For Ubuntu add the paparazzi-uav ppa sudo add-apt-repository ppa:paparazzi-uav/ppa and install the paparazzi-dev package.

Since Paparazzi v5.0 the gcc-arm-embedded toolchain is recommended. Available as of Ubuntu 14.04, on older versions it can be installed via tarball.

Or just use the Quickstart for Ubuntu 12.04 LTS.

Installation video Tutorials

EmbedVideo does not recognize the video service "youtubehd".
EmbedVideo does not recognize the video service "youtubehd".

Installation of dependencies

Ubuntu

Binary packages for Ubuntu are available for the i386, amd64 and armhf architectures.

Add the installation sources for the Paparazzi software packages. Run from a terminal:

sudo add-apt-repository ppa:paparazzi-uav/ppa

Then update the systems package inventory and install the main Paparazzi software dependencies. This will take some time.

sudo apt-get update 
sudo apt-get install paparazzi-dev

Debian

Binary packages for Debian are available for the i386 and amd64 architectures. armhf packages seem to be currently not supported by the OpenSUSE build service.

For Debian Wheezy (7.0), Jessie (8.0), Stretch (9.0) and Buster (10) packages are built using the Open Build Service (OBS) on OpenSUSE Build Service project home:flixr:paparazzi-uav

Install paparazzi-dev

First add the key:

wget -q "http://download.opensuse.org/repositories/home:/flixr:/paparazzi-uav/Debian_10/Release.key" -O- | sudo apt-key add -

Add the appropriate repo, depending on your Debian version to sources.list

echo "deb http://download.opensuse.org/repositories/home:/flixr:/paparazzi-uav/Debian_10/ ./" | tee -a /etc/apt/sources.list
echo "deb http://download.opensuse.org/repositories/home:/flixr:/paparazzi-uav/Debian_9.0/ ./" | tee -a /etc/apt/sources.list
echo "deb http://download.opensuse.org/repositories/home:/flixr:/paparazzi-uav/Debian_8.0/ ./" | tee -a /etc/apt/sources.list
echo "deb http://download.opensuse.org/repositories/home:/flixr:/paparazzi-uav/Debian_7.0/ ./" | tee -a /etc/apt/sources.list

Update the systems package inventory and install the main Paparazzi software dependencies.

sudo apt-get update 
sudo apt-get install paparazzi-dev

ARM embedded toolchain

For current Paparazzi versions (v5.0 and above) the gcc-arm-embedded toolchain is recommended, which also supports the STM32F4 with FPU (hardware floating point).

gcc-arm-none-eabi as Debian/Ubuntu package

This is the recommended method

Note that there are actually two different toolchains available!

Both toolchains should work for most use-cases (if you don't need C++ or nano specs), although the ARM gcc-arm-embedded toolchain is better tested.

gcc-arm-embedded toolchain

This is the recommended toolchain

On most Ubuntu versions the gcc-arm-embedded toolchain can be installed as a debian package from the ppa:

sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt-get update
sudo apt-get install gcc-arm-embedded

Previously there was a PPA by terry.guo that contained this toolchain under the package name gcc-arm-none-eabi

See https://launchpad.net/gcc-arm-embedded/+announcement/13824 for details on how to switch the newer PPA and package.

gcc-arm-none-eabi Debian toolchain

Current Debian (jessie) and Ubuntu (14.04 trusty and later) releases have the gcc-arm-none-eabi package in the official repositories (universe), and can be installed with:

sudo apt-get update
sudo apt-get install gcc-arm-none-eabi gdb-arm-none-eabi

ARM gcc-arm-embedded tarball

Another way is to download and unpack the tarball and add it to your PATH:

  • Download gcc-arm-none-eabi-*-*-linux.tar.bz2 from External Downloads section of ARM gcc-arm-embedded project
  • Unpack it to a directory of your choice
  • Add the bin folder in to your PATH

e.g.:

cd ~
wget https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q2-update/+download/gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2
sudo tar -vjxf gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2 -C /opt
rm -r gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2
exportline="PATH=$PATH:/opt/gcc-arm-none-eabi-4_7-2013q2/bin"
if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
source ~/.profile

The file .profile will be sourced in every bash after logging out and in again. Until then,

source ~/.profile

can be used for every bash individually.

If you can not access your toolchain with PATH working, look a the Installation/Linux#Troubleshooting.

Old toolchain for Paparazzi v4.x and earlier

For Paparazzi v4.x and earlier you need to install the paparazzi-arm-multilib package. It has support for both ARM7 (i.e. Tiny,TWOG,YAPA autopilot boards) as well as STM32F1 (i.e. LISA boards).
This toolchain does not properly support STM32F4 based autopilots!!

You can install it explicitly with:

sudo apt-get install paparazzi-arm-multilib

Optional Packages

The packages lpc21isp and openocd are normally automatically installed as they are recommended packages of paparazzi-dev, if not you can manually install them via:

sudo apt-get install lpc21isp openocd

lpc21isp is needed to serially flash the LPC2148 based autopilots (e.g. bootloader for tiny, twog, umarim), openocd is for flashing via JTAG (e.g. for Lisa boards) and debugging.

Installing and running Paparazzi

Please see Getting the Source Code on the general Installation page for details on downloading the Paparazzi source code, compiling and running it.

Udev rules

Add the appropriate Udev rule (available in fhe file 50-paparazzi.rules) to the USB handler. Simply copy as root conf/system/udev/rules/50-paparazzi.rules to /etc/udev/rules.d/, e.g in a terminal:

cd <your paparazzi directory>
sudo cp conf/system/udev/rules/50-paparazzi.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules

See the Udev page for more details.

Troubleshooting

No access rights for USB devices

Some Linux distributions, don't allow standard (non admin) users to directly access the USB bus by default. On recent Ubuntu/Debian versions the first/main user is already a member of the plugdev group which should be sufficient for most cases.
If you have problems, make yourself a member of the plugdev and dialout groups:

sudo adduser <your login> plugdev
sudo adduser <your login> dialout

Logout and login again.

arm-none-eabi-gcc: Command not found

Appeared on Debian Wheezy 7 (gcc-arm-none-eabi-4_8-2013q4 installed via tarball)
If this error occurs, maybe the ia32-libs are missing.

Enable multiarch and install ia32-libs:

dpkg --add-architecture i386
apt-get update
apt-get install ia32-libs

arm-linux-gnueabi-gcc cross-compiler not found

Ubuntu

apt-get install gcc-arm-linux-gnueabi

Debian

Starting with jessie, there were some changes to the way cross-compilers are set up. To make it work you will have to add armel architecture and pick up some crossbuild tools.

First edit your /etc/apt/sources.list and add the following line, to enable the emdebian repo:

deb http://emdebian.org/tools/debian/ jessie main

Run the following command in your terminal to add the keys for it

curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | sudo apt-key add -

Then you could add armel architecture and fetch the missing cross-compiler packages

dpkg --add-architecture armel
apt-get update
apt-get install crossbuild-essential-armel

You could find out more about cross-toolchains in jessie on debian wiki page.

Note that some of your repos might not mirror embedded architectures, which would give you an error when you try to update the sources. In that case you will have to specify which architecture you do want from them by editing the corresponding entry in your sources.list file, in a way described here. Like in this example with the crunchbang repo you could specify it by adding [arch=amd64,i386] to the line, so you only enable amd64 and i386 architectures:

deb [arch=amd64,i386] http://packages.crunchbang.org/waldorf waldorf main

arm-none-eabi-gdb: error with libncurses.so.5

Appeared on Xubuntu 14.04 LTS (gcc-arm-none-eabi-4_8-2013q4 installed via tarball)
Terminal output: arm-none-eabi-gdb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

If this error occurs, maybe lib32ncurses5 is missing.
Found on launchpad q&a

FTDI serial adapter not working on old Ubuntu version

On older Linux distributions (not needed for lucid and later), the Braille TTY driver interferes with FTDI USB Serial adapters. If somehow your FTDI serial adapter does not work, remove the package via:

sudo apt-get remove brltty

Code not starting on autopilot after changing gcc

If you changed the toolchain (e.g. installed a new one for having FPU-Support for the F4), you need to run

make clean && make

in sw/ext in order to rebuild the libs. Otherwise the embedded code can behave strange (most likely not start)