Difference between revisions of "Installation/Windows10"

From PaparazziUAV
Jump to navigation Jump to search
(Installing Paparazzi on windows10)
 
(7 intermediate revisions by 2 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__


=Intro=
=Intro=
[[File:Win+papa.jpg|250px|thumb|right]]
This page describes the installation of paparazzi on Microsoft Windows10.<br />
This page describes the installation of paparazzi on Microsoft Windows10.<br />


There are many Windows users who like to use paparazzi on this popular OS. Be-aware it's not so efficient to use paparazzi on Windows OS but it could be helpful in some cases.<br />
There are many Windows users who like to use paparazzi on this popular OS. Be-aware it's '''not so efficient''' to use paparazzi on Windows OS but it could be helpful in some cases.<br />
 
Since Microsoft introduced the possibility of installing Ubuntu on windows 10, you can run Paparazzi on it with some little efforts.<br />
Since Microsoft introduced the possibility of installing Ubuntu on windows 10, you can run Paparazzi on it with some little efforts.<br />
=Installing Ubuntu on windows=
=Installing Ubuntu on windows=
Line 41: Line 44:
After installing Ubuntu, you need to install Paparazzi. The quickest way is to add the Paparazzi repositories, update, and then install the required software.<br />
After installing Ubuntu, you need to install Paparazzi. The quickest way is to add the Paparazzi repositories, update, and then install the required software.<br />
   
   
You can add the repository and install with these commands:
You can add the repository and install with these commands(it's like usual [[Installation#Quickstart_for_Ubuntu_users|ubuntu installation command]]):
 
You can just copy the lines [CTRL+C] and paste it in the Ubuntu command prompt via mouse right click.. then press [enter]


  sudo add-apt-repository -y ppa:paparazzi-uav/ppa && sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa && sudo apt-get update && sudo apt-get -f -y install paparazzi-dev paparazzi-jsbsim gcc-arm-embedded && cd ~ && git clone --origin upstream https://github.com/paparazzi/paparazzi.git && cd ~/paparazzi && git remote update -p && git checkout -b v5.14 upstream/v5.14 && sudo cp conf/system/udev/rules/*.rules /etc/udev/rules.d/ && sudo udevadm control --reload-rules && make && ./paparazzi
  sudo add-apt-repository -y ppa:paparazzi-uav/ppa && sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa && sudo apt-get update && sudo apt-get -f -y install paparazzi-dev paparazzi-jsbsim gcc-arm-embedded && cd ~ && git clone --origin upstream https://github.com/paparazzi/paparazzi.git && cd ~/paparazzi && git remote update -p && git checkout -b v5.14 upstream/v5.14 && sudo cp conf/system/udev/rules/*.rules /etc/udev/rules.d/ && sudo udevadm control --reload-rules && make && ./paparazzi


This step is a little bit slow. Be patient!<br />
Depending on you internet connection this step can take quite a while.... be patient, just let it do it's thing....In some cases even so long that you need to run again<br />
   
 
Ubuntu on windows 10 is only command line and there is no GUI. So after finishing this step, you might get an error like this:<br />
  make && ./paparazzi
 
Ubuntu on windows 10 is only command line and there is no GUI. So after finishing this step, you likly get an error like this:<br />


  Fatal error: exception Gtk.Error(“GtkMain.init: initialization failed\nml_gtk_init: initialization falied”)
  Fatal error: exception Gtk.Error(“GtkMain.init: initialization failed\nml_gtk_init: initialization falied”)
[[File:Gtk error.png|450px]]
[[File:Gtk error.png|450px]]


It is because it wants to run the graphical Paparazzi Center. There is a way to have Graphical interface.  
It is because it wants to run the graphical Paparazzi Center, but there is no GUI on the Ubuntu for Windows at that moment. Lucky us, there is a way to have Graphical interface non the less.


=Graphical Interface=
=Graphical Interface=
* '''Step One: Install an X server'''
* '''Step One: Install an X server'''


There are several different X servers you could install on Windows, [https://sourceforge.net/projects/xming/ Xming] is recommended. Download it and install it on your Windows 10 PC.<br />
There are several different X servers you could install on Windows, [https://sourceforge.net/projects/xming/ Xming] and [https://sourceforge.net/projects/vcxsrv/ vcxsrv] are both recommended. Download it and install it on your Windows 10 PC.<br />


The installation process is simple, You can just accept the default settings. It will then automatically launch and run in your system tray, waiting for you to run graphical programs.<br />
The installation process is simple, You can just accept the default settings. It will then automatically launch and run in your system tray, waiting for you to run graphical programs.<br />
Line 75: Line 82:
This setting only applies to your current Bash session. If you close the window, Bash will forget it. You’ll have to run this command each time you reopen Bash and want to run a graphical application.<br />
This setting only applies to your current Bash session. If you close the window, Bash will forget it. You’ll have to run this command each time you reopen Bash and want to run a graphical application.<br />


After that you can launch Paparazzi. <br />
You can also install [https://wiki.gnome.org/Apps/Gedit gedit], to be able to edit your aircraft files (airframe, flight plan, etc) from within the center, since it is the default app that Paparazzi center uses.
sudo apt-get install gedit
<br />
After that you can launch Paparazzi. (Or use the [[Paparazzi_Center/Evolutions#New_Paparazzi_Center|new Paparazzi center]] which works seamless on windows)
cd ~/paparazzi && ./paparazzi
 


[[File:Paparazzi on windows.png|700px]]<br />
[[File:Paparazzi on windows.png|700px]]<br />
Line 89: Line 101:


[[File:Stop windows.png|700px]]<br />
[[File:Stop windows.png|700px]]<br />


=Programming Autopilot=
=Programming Autopilot=
Line 113: Line 124:
First you need to give it the proper permissions. Run this command
First you need to give it the proper permissions. Run this command
  sudo chmod 666 /dev/ttyS15
  sudo chmod 666 /dev/ttyS15
Replacing 15 with the correct number. Now in the Paparazzi center you can use this port to connect to the aircraft.
Replacing 15 with the correct number. Now in the Paparazzi center you can use this port to connect to the aircraft using Paparazzi link application.
sw/ground_segment/tmtc/link -d /dev/ttyS15
 
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]

Revision as of 11:08, 15 May 2019

Intro

Win+papa.jpg

This page describes the installation of paparazzi on Microsoft Windows10.

There are many Windows users who like to use paparazzi on this popular OS. Be-aware it's not so efficient to use paparazzi on Windows OS but it could be helpful in some cases.
Since Microsoft introduced the possibility of installing Ubuntu on windows 10, you can run Paparazzi on it with some little efforts.

Installing Ubuntu on windows

First you need to install Ubuntu on Windows 10. (Ensure you are using a 64-bit version of windows 10, since it cannot be run on a 32-bit version. Go to “Control Panel-> Programs-> Turn Windows Feature On or Off”.

Enable the “Windows Subsystem for Linux” option in the list, and then click OK button. Click “Restart Now” when you are prompted to restart your computer. The feature won’t work until you reboot.

Or,Instead of the above steps, you can setup your system by executing the following command in the Administrator PowerShell prompt:

Enable-WindowsOptionalFeature –Online –FeatureName Microsoft-Windows-Subsystem-Linux

After that, Ubuntu can be installed from the Microsoft Store:

  1. Use the Start menu to launch the Microsoft Store application.
  2. Search for Ubuntu and select the first result, ‘Ubuntu', published by Canonical Group Limited.
  3. Click on the Install button.

Ubuntu will be downloaded and installed automatically. Progress will be reported within the Microsoft Store application.

Microsoft store.png


First launch

Ubuntu can now be launched in the same way as any other Windows 10 application, such as searching for and selecting Ubuntu in the Start menu.

When launched for the first time, Ubuntu will inform you that it's ‘Installing' and you'll need to wait a few moments.

Installing.png

When complete, you'll be asked for a username and password specific to your Ubuntu installation. These don't need to be the same as your Windows 10 credentials.

New user.png


With this step complete, you'll find yourself at the Ubuntu bash command line.

After installing Ubuntu, you need to install Paparazzi. The quickest way is to add the Paparazzi repositories, update, and then install the required software.

You can add the repository and install with these commands(it's like usual ubuntu installation command):

You can just copy the lines [CTRL+C] and paste it in the Ubuntu command prompt via mouse right click.. then press [enter]

sudo add-apt-repository -y ppa:paparazzi-uav/ppa && sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa && sudo apt-get update && sudo apt-get -f -y install paparazzi-dev paparazzi-jsbsim gcc-arm-embedded && cd ~ && git clone --origin upstream https://github.com/paparazzi/paparazzi.git && cd ~/paparazzi && git remote update -p && git checkout -b v5.14 upstream/v5.14 && sudo cp conf/system/udev/rules/*.rules /etc/udev/rules.d/ && sudo udevadm control --reload-rules && make && ./paparazzi

Depending on you internet connection this step can take quite a while.... be patient, just let it do it's thing....In some cases even so long that you need to run again

make && ./paparazzi

Ubuntu on windows 10 is only command line and there is no GUI. So after finishing this step, you likly get an error like this:

Fatal error: exception Gtk.Error(“GtkMain.init: initialization failed\nml_gtk_init: initialization falied”)

Gtk error.png

It is because it wants to run the graphical Paparazzi Center, but there is no GUI on the Ubuntu for Windows at that moment. Lucky us, there is a way to have Graphical interface non the less.

Graphical Interface

  • Step One: Install an X server

There are several different X servers you could install on Windows, Xming and vcxsrv are both recommended. Download it and install it on your Windows 10 PC.

The installation process is simple, You can just accept the default settings. It will then automatically launch and run in your system tray, waiting for you to run graphical programs.

Xming windows.png


Hint: Every time you want to run a graphical interface from Ubuntu, make sure that Xming is running.


  • Step Two: Set Your Display Environment Variable

Now, you’ll need to set the “DISPLAY” environment variable to point at the X server running on your Windows 10 PC. If you don’t do this, graphical applications will simply fail to launch.

To do this, run the following command in the Bash environment:

export DISPLAY=:0

This setting only applies to your current Bash session. If you close the window, Bash will forget it. You’ll have to run this command each time you reopen Bash and want to run a graphical application.

You can also install gedit, to be able to edit your aircraft files (airframe, flight plan, etc) from within the center, since it is the default app that Paparazzi center uses.

sudo apt-get install gedit


After that you can launch Paparazzi. (Or use the new Paparazzi center which works seamless on windows)

cd ~/paparazzi && ./paparazzi


Paparazzi on windows.png


Right now you can use Paparazzi for Simulation.

Simulation windows.png


When you build for an aircraft, the processes will end, but it may not automatically remove the indicator. You may need to press “Stop/Remove All Processes” button.


Stop windows.png

Programming Autopilot

Right now, to program the autopilot, you should copy the HEX/BIN file manually to your windows OS, You can find your ubuntu home directory files in the following directory:

C:\Users\NAME\AppData\Local\Packages\DISTRO_FOLDER\LocalState\rootfs

DISTRO_FOLDER for Ubuntu is:

CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc

Then use a windows program to upload firmware to the autopilot
(For example DfuSe or STM32 ST-LINK Utility for ST microcontrollers)

Using Telemetry

After you connect your telemetry to the PC, usually it's recognized under COMx in windows. Find the port number first.
In the Ubuntu, you can access it by "/dev/ttySx". For example, COM15 on windows can be accessed on "/dev/ttyS15" on Ubuntu.

First you need to give it the proper permissions. Run this command

sudo chmod 666 /dev/ttyS15

Replacing 15 with the correct number. Now in the Paparazzi center you can use this port to connect to the aircraft using Paparazzi link application.

sw/ground_segment/tmtc/link -d /dev/ttyS15