Navit on raspberry pi


8 posts
by cowasaki » Fri Oct 11, 2013 8:07 pm
After a bit of messing about from several sources and playing with the xml file I have come up with the following install routine:

>>This is with a fresh installation of raspian os. I'm using noobs 1.3 for this set of instructions. We will be downloading the maps etc on the same computer used to get noobs. Remember linux is case sensitive….


You can ignore the fresh install section and installing EMAPs if either of these is already done.


>>Download noobs install SDFormatter.
goto http://www.raspberrypi.org/downloads
download latest Noobs package
format your SDcard using SDFormatter
copy contents of zip file to SD card
install into Raspberry PI and switch on
Select Raspbian OS and install
In initial setup I select 800MHzsudo



>>Download maps
goto navit map extractor http://maps5.navit-project.org
click "navigate"
zoom in to the area you want e.g. UK
click "select"
select the area you want to download
click "GET MAP"
when this is downloaded goto the download directory on your computer
locate the file which should be called something like "osm_bbox_-5.7,49.9,1.8,55.6.bin"
change the map's name to something relevant such as "map_England.bin"
repeat the above until you have any/all of the maps that you want
copy map file(s) to memory stick



>>Install GPSD for the GPS module:
sudo apt-get install gpsd gpsd-clients python-gps


>>Start and test the GPS module
sudo killall gpsd {reports error first time}
sudo gpsd /dev/ttyUSB0 -F /var/run/gpsd.sock
cgps -s {ctrl-C to exit}


>>Install NAVIT
sudo apt-get install gpsd gpsd-clients navit


>> Test Navit runs and create the xml file/.navit
run navit from "others" folder and you should get a blank screen with a circle due to lack of a map
exit navit


>> Copy setup folder to your home directory
cp /etc/navit/navit.xml ~/.navit/navit.xml
cd /home/pi/.navit
ls
this should list at least the files "navit.xml" & "centre.txt"


>Install EMAPS (the text editor so that you can edit the config files)
sudo apt-get install emacs



>Copy maps to .navit folder
Click second icon from left i.e. file manager
Open .navit folder by changing address in address box from /home/pi to /home/pi/.navit
Open a second file manager window
Copy map(s) from the memory stick to the .navit folder



>>Edit the navit config file: {Note line numbers based on xml version 1.0}



Adjust the zoom from default of 256 to 8 [approx line 34]

DEFAULT:
<navit center="4808 N 1134 E" zoom="256" tracking="1" orientation="-1" recent_dest="10">

CHANGE TO:
<navit center="4808 N 1134 E" zoom="8" tracking="1" orientation="-1" recent_dest="10">

---------------------------------------------------------------------------------------------------------------

Remove the default map and replace with our map [approx line 612]

DEFAULT:
<!-- If you dont want to use the sample map, either set enabled="no" in the next line or remove the xml file from the maps directory -->
<mapset enabled="yes">
<xi:include href="$NAVIT_SHAREDIR/maps/*.xml"/>
</mapset>

<!-- Mapset template for openstreetmaps -->
<mapset enabled="no">
<map type="binfile" enabled="yes" data="/etc/???????????.bin"/>
</mapset>


CHANGE TO:
<!-- If you dont want to use the sample map, either set enabled="no" in the next line or remove the xml file from the maps directory -->
<mapset enabled="no">
<xi:include href="$NAVIT_SHAREDIR/maps/*.xml"/>
</mapset>

<!-- Mapset template for openstreetmaps -->
<mapset enabled="yes">
<map type="binfile" enabled="yes" data="/home/pi/.navit/map_UK.bin"/>
</mapset>

---------------------------------------------------------------------------------------------------------------

Add compass

approx line 101

DEFAULT:
<osd enabled="no" type="compass"/>

CHANGE TO:
<osd enabled="yes" type="compass"/>

---------------------------------------------------------------------------------------------------------------

Add zoom buttons

approx line 113

DEFAULT:
<osd enabled="no" type="button" x="-96" y="-96" command="zoom_in()" src="zoom_in.png"/>
<osd enabled="no" type="button" x="0" y="-96" command="zoom_out()" src="zoom_out.png"/>

CHANGE TO:
<osd enabled="yes" type="button" x="-96" y="-96" command="zoom_in()" src="zoom_in.png"/>
<osd enabled="yes" type="button" x="0" y="-96" command="zoom_out()" src="zoom_out.png"/>
Posts: 16
Joined: Tue Jan 10, 2012 5:55 am
by cowasaki » Fri Oct 11, 2013 8:12 pm
Having got Navit up and running I have now found (initially) that it will only actually navigate to an AREA rather than a street. I haven't actually got it navigating at all yet but it only accepts areas rather than streets.


Has anyone got it working to a street level?

Has anyone got an alternative navigation system working on RPI? If so do they have a comprehensive install procedure?


Thanks.
Posts: 16
Joined: Tue Jan 10, 2012 5:55 am
by Bob_Tee » Fri Oct 18, 2013 3:14 pm
Once you have chosen a town then you can select a street. Where I have found a problem is selecting a house number as this seems to enter a nonsense long/lat and fail. Still getting the right street is usually good enough. If messing with the OSD I recommend this tip http://wiki.navit-project.org/index.php/OSD_Layouts#Tip as the navit.xml is large and unforgiving of syntax errors.
added :
On re-reading, I note that you have installed the version from the Raspbian Distro which is quite old and I followed these instructions http://astrobeano.blogspot.co.uk/2012/1 ... ry-pi.html to build the latest version.

My comment about house number problems was based on experience with the standard Android distribution. I have not yet moved the Pi version into a vehicle, still tinkering with the display and wanting to have sound working first.
Posts: 7
Joined: Sun Mar 04, 2012 12:23 pm
by ShaneMachine » Wed Nov 12, 2014 1:45 am
Will this work with Raspbmc?
Posts: 1
Joined: Wed Nov 12, 2014 1:44 am
by stvnford » Sat Aug 15, 2015 2:43 am
Using EMACS23 the files I need to edit are grayed out.

Any help / suggestions would be appreciated.
Posts: 1
Joined: Sat May 17, 2014 12:37 am
by erpezoa » Mon Oct 05, 2015 9:20 pm
To get a USB GPS working
This is what you need to edit, it works for Navit and other GIS software.

sudo nano /etc/default/gpsd

START_DAEMON="true"
# Use USB hotplugging to add new USB devices automatically to the daemon
USBAUTO="true"
# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES="/dev/ttyUSB0"
# Other options you want to pass to gpsd
GPSD_OPTIONS="/dev/ttyUSB0"
GPSD_SOCKET=”/var/run/gpsd.sock”

--------------------------------------------------------------------------------------------------------------------------------------------------
Feel free to download my configurations

wget http://aztelephony.com/raspiconfigs/gpsd
wget http://aztelephony.com/raspiconfigs/navit.xml
User avatar
Posts: 4
Joined: Wed Dec 28, 2011 4:43 pm
by lvt213 » Mon Feb 01, 2016 7:06 am
Hello,

how do you fix the river show only 1 line ?
Thanks
Posts: 7
Joined: Wed Nov 18, 2015 10:15 am
by varsismaname » Wed Feb 17, 2016 2:43 pm
Hello guys I am new here... So I have successfully installed navit and it is working fine. Now I am trying to get a button that call Kodi or toggle/switch and vice versa because I want Kodi for play my music basically.
Do I have to add lines in the XML file? Can someone give me a hint/hand. I don't know how to call in a program using xml. Let me know thanks :)
Posts: 2
Joined: Wed Feb 17, 2016 2:38 pm