Difference between revisions of "Raspberry Pi"

From Navit's Wiki
Jump to: navigation, search
(Raspian)
m (Prefer to install yourself on Raspian?: OpenStreetMap, not Openstreetmaps)
 
(16 intermediate revisions by 4 users not shown)
Line 6: Line 6:
 
(Thanks to Angelus88, who posted it here: [https://forum.navit-project.org/viewtopic.php?f=11&t=405].)
 
(Thanks to Angelus88, who posted it here: [https://forum.navit-project.org/viewtopic.php?f=11&t=405].)
  
==Raspian==
+
= Want the easy way? =
 +
 
 +
You can try out our automated, unattended install : https://github.com/navit-gps/raspbian-ua-netinst
 +
 
 +
https://raw.githubusercontent.com/navit-gps/raspbian-ua-netinst/master/example.gif
 +
 
 +
==Prefer to install yourself on Raspian?==
 
First of all, we will have to deal with the [[dependencies]]:
 
First of all, we will have to deal with the [[dependencies]]:
  
<source lang="bash">sudo apt-get install subversion imagemagick libdbus-1-dev libdbus-glib-1-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libimlib2-dev librsvg2-bin libspeechd-dev libxml2-dev ttf-liberation </source>
+
<source lang="bash">sudo apt-get install subversion git imagemagick libdbus-1-dev libdbus-glib-1-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libimlib2-dev librsvg2-bin libspeechd-dev libxml2-dev ttf-liberation libgtk2.0-dev</source>
  
 
This is for the compiling process:
 
This is for the compiling process:
  
<source lang="bash">sudo apt-get install gcc cmake make zlib1g-dev libpng12-dev libgtk2.0-dev librsvg2-bin </source>
+
<source lang="bash">sudo apt-get install gcc g++ cmake make zlib1g-dev libpng12-dev librsvg2-bin </source>
  
 
This is for the SDL graphics (suggested):
 
This is for the SDL graphics (suggested):
Line 35: Line 41:
 
</source>
 
</source>
  
If you want to use Garmin maps ( Openstreetmaps are natively supported and are really detailed ) :
+
If you want to use Garmin maps ( OpenStreetMap is natively supported and are really detailed ) :
 
<source lang="bash">
 
<source lang="bash">
 
sudo apt-get install libgarmin-dev  
 
sudo apt-get install libgarmin-dev  
Line 42: Line 48:
 
Ok, now let's download the latest version of Navit from the repository (starting from your user's folder like /home/pi):
 
Ok, now let's download the latest version of Navit from the repository (starting from your user's folder like /home/pi):
  
<source lang="bash">svn co  svn://svn.code.sf.net/p/navit/code/trunk/navit/ navit</source>
+
<source lang="bash">git clone https://github.com/navit-gps/navit.git</source>
  
  
Line 53: Line 59:
 
Now the compiling (if you need CSV, keep reading!):
 
Now the compiling (if you need CSV, keep reading!):
  
 +
Note : the freetype library has been updated on raspbian, and this broke cmake's ability to find it.
 +
Until [https://bugs.launchpad.net/raspbian/+bug/1417732 this bug] is fixed ( and cmake is updated to a version > 2.9 ) you will need to add an extra flag to the cmake call :
 +
<source lang="bash">
 +
cmake ~/navit -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/
 +
</source>
 +
 +
Once the above bug has been fixed, you should be able to use only :
 
<source lang="bash">
 
<source lang="bash">
 
cmake ~/navit
 
cmake ~/navit
make
 
 
</source>
 
</source>
  
Line 62: Line 74:
 
<source lang="bash">
 
<source lang="bash">
 
cmake --enable-map-csv ~/navit
 
cmake --enable-map-csv ~/navit
 +
</source>
 +
 +
You are now ready to compile.
 +
For a raspberry A, B or B+:
 +
<source lang="bash">
 
make
 
make
 
</source>
 
</source>
This can take A LOT of time. At the end, you can start Navit (don't forget the configuration! Navit.xml):
+
 
 +
For a raspberry 2:
 +
<source lang="bash">
 +
make -j4
 +
</source>
 +
 
 +
This can take A LOT of time:
 +
- on a raspberry 2, it takes ~4:30 minutes
 +
- on a raspberry b+, it takes ~36 minutes
 +
 
 +
At the end, you can start Navit (don't forget the configuration! Navit.xml):
  
 
<source lang="bash">
 
<source lang="bash">
Line 70: Line 97:
 
./navit
 
./navit
 
</source>
 
</source>
 +
 +
Generating a 3290kms route on the Raspberry pi 2 takes ~ 55s.
 +
 +
 +
Adding Support for UART Serial GPS
 +
 +
connect VCC to pin 1, RX to pin 8 TX to pin 10 and Ground to pin 6 on GPIO for Pi2
 +
 +
Do sudo apt-get install gpsd gpsd-clients python-gps
 +
Then sudo <code>gpsd /dev/ttyAMA0 -F /var/run/gpsd.sock</code>
 +
test with <code>cpgs -s</code>
 +
to autostart gpsd type <code>sudo dpkg-rconfigure gpsd</code> select yes add /dev/ttyAMA0 defaults for everything else.
 +
  
 
[[Category:Ports]]
 
[[Category:Ports]]
 
[[Category:Development]]
 
[[Category:Development]]
 +
[[Category:Linux]]

Latest revision as of 20:42, 29 August 2019

Compiling for the Raspberry Pi[edit]

Compiling for the Pi is (of course) mostly like Compiling for Linux.

(Thanks to Angelus88, who posted it here: [1].)

Want the easy way?[edit]

You can try out our automated, unattended install : https://github.com/navit-gps/raspbian-ua-netinst

example.gif

Prefer to install yourself on Raspian?[edit]

First of all, we will have to deal with the dependencies:

sudo apt-get install subversion git imagemagick libdbus-1-dev libdbus-glib-1-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libimlib2-dev librsvg2-bin libspeechd-dev libxml2-dev ttf-liberation libgtk2.0-dev

This is for the compiling process:

sudo apt-get install gcc g++ cmake make zlib1g-dev libpng12-dev librsvg2-bin

This is for the SDL graphics (suggested):

sudo apt-get install libsdl-image1.2-dev libdevil-dev libglc-dev freeglut3-dev libxmu-dev libfribidi-dev

This is for the OpenGL support:

sudo apt-get install libglc-dev freeglut3-dev libgl1-mesa-dev libfreeimage-dev

This is QT (note that the QT gui is not maintained currently) :

sudo apt-get install libqt4-dev

This is for GPSd support :

sudo apt-get install libgps-dev

This is espeak, TTS (text to speech)(optional):

sudo apt-get install espeak

If you want to use Garmin maps ( OpenStreetMap is natively supported and are really detailed ) :

sudo apt-get install libgarmin-dev

Ok, now let's download the latest version of Navit from the repository (starting from your user's folder like /home/pi):

git clone https://github.com/navit-gps/navit.git


CMake builds Navit in a separate directory of your choice - this means that the directory in which the SVN source was checked out remains untouched.

mkdir navit-build
cd navit-build

Now the compiling (if you need CSV, keep reading!):

Note : the freetype library has been updated on raspbian, and this broke cmake's ability to find it. Until this bug is fixed ( and cmake is updated to a version > 2.9 ) you will need to add an extra flag to the cmake call :

cmake ~/navit -DFREETYPE_INCLUDE_DIRS=/usr/include/freetype2/

Once the above bug has been fixed, you should be able to use only :

cmake ~/navit

If you need the CSV support for POIs, you must use:

cmake --enable-map-csv ~/navit

You are now ready to compile. For a raspberry A, B or B+:

make

For a raspberry 2:

make -j4

This can take A LOT of time:

- on a raspberry 2, it takes ~4:30 minutes
- on a raspberry b+, it takes ~36 minutes

At the end, you can start Navit (don't forget the configuration! Navit.xml):

cd ~/navit-build/navit/
./navit

Generating a 3290kms route on the Raspberry pi 2 takes ~ 55s.


Adding Support for UART Serial GPS

connect VCC to pin 1, RX to pin 8 TX to pin 10 and Ground to pin 6 on GPIO for Pi2

Do sudo apt-get install gpsd gpsd-clients python-gps Then sudo gpsd /dev/ttyAMA0 -F /var/run/gpsd.sock test with cpgs -s to autostart gpsd type sudo dpkg-rconfigure gpsd select yes add /dev/ttyAMA0 defaults for everything else.