Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Navit install on OAP for iphone users
#1
This is a short help for those who, like me, like OAP, but are iphone users and therefore have no Android Auto functions. I installed Navit for my navigation and it seems to be working well. Here's how I did it.

Firstly, I have a rpi4b running the latest Buster kernel, with the latest OAP beta, 3.3.2 b2. I have also connected the Adafruit Ultimate GPS Breakout board, Adafruit, added a gps antenna, and have it configured and functioning.

after booting, you should do the initial configuration via raspbian's GUI and then update your operating system. The current raspbian image still gives an error when trying to update via their gui, so open a terminal and update as follows:

sudo apt-get update
sudo apt-get upgrade

Let those finish. If you are running an rpi4b, like I am, you should then run

sudo rpi-update

to update the firmware

After you have done your initial configuration and rebooted, open raspbian's "Preferences" and select "add/remove software."
Enter "Navit" in the search box. Select all the files indicated below, then click "Apply" and let it install. You can also install manually through github or by following the tutorial on theRaspberry Pi Wiki, at https://wiki.navit-project.org/index.php/Raspberry_Pi, however, doing it by the add/remove function in Preferences, it will automatically be added to the raspbian menu and place the software in logical directories, so you don't have to figure all that out on your own.

You will need to install the following:
navit-0.5.3+dsfg.1-1
navit-data-0.5.3+dfsg.1-1
navit-graphics-gtk-drawing-area-0.5.3+dfsg.1-1
navit-gui-gtk-0.5.3+dfsg.1-1
navit-gui-internal-0.5.3+dfsg.1-1

These will give you a variety of configuration options once you start configuring Navit.

After installing, you must configure the navit.xml file, located at /etc/navit/navit.xml. According to instructions in that file, you should not modify that file, but should create a copy of it at /home/pi/.navit/navit.xml (notice the "." in front of navit makes that directory a hidden directory). Now you can do your configuration in that directory and it will persist through updates and upgrades.

I used a tutorial at Ozzmaker, Navigating... for the configuration settings, as I like the way his gui looks. Ozzmaker provides downloads and links for his configuration files as well as good explanations.

There are several initial settings that must be set before you will get anything out of Navit.

sudo nano .navit/navit.xml

Now look for the line that begins with

<navit center="

Use Google Maps on your iphone to get the gps location where you want Navit to set a starting location point. By default it is set somewhere in Denmark, I think. Enter that location between the quotation marks in place of what's there (no comma between the long/lat).

Next, find the line that begins with:

<gui type="

It should read:

<gui type="internal" enabled="yes"><![CDATA[

Now find

<vehicle name="Local GPS"

This is where you tell Navit where to get GPS information for navigation. For my configuration it reads:

<vehicle name="Local GPS" profilename="car" enabled="yes" active="1" source="gpsd://localhost" gpsd_query="w+xj" follow="2">

If, after you get Navit started and you don't get any gps location, or your map shows blank, the "source" setting is probably where the problem is. Different gps devices will have different settings. Took me quite a while poring over various tutorials before I finally found the right setting for mine.

The last critical setting is the map source. I recommend maps from Openstreetmaps.org. They have several formats from which you may choose. You can also use Garmin maps, as well as a sample map in Navit (normally useful only for setup and testing). I have had trouble downloading and unpacking the large files from OSM, but you can download smaller maps or sections of maps and use them simultaneously. Check the various tutorials on the Internet for "how-to" on this.
Create a convenient "Maps" directory somewhere convenient, like maybe /home/pi/Maps. Download and unpack your maps package into this directory.

Now find the line in .navit/navit.xml that starts with

<!-- If you have the reiseplaner maps...

That option should be set to "no".  Farther down, also disable the sample mapset. Keep going down to the openstreetmaps option and enable it, by replacing "no" with "yes". Now you have to tell Navit where to find your maps. The setting should look something like this:

<mapset enabled="yes">
                <map type="binfile" enabled="yes" data="/home/pi/Maps/yourmapfile.bin"/>

Make sure the Garmin mapset option is also set to "no" as you can use only one kind of mapset at a time in Navit. That is, unless you are using the Garmin maps. In that case, enable the Garmin maps instead.

I have had trouble downloading and unpacking the .osm.bz2 file of North America, which is over 14GB. The .pbf file is 8.6GB, but you have to convert the .pbf to a .bin file. There is a wiki on the openstreetmap-navit wiki for this, but I haven't been able to get it to work. Don't know why. I have been most successful by downloading and unpacking smaller sections of North America and converting the osm files to .bin. Still working on the .pbf conversion thing.

Navit has innumerable variables for setup. You can customize everything from the display to settings for your particular vehicle, bicycle, or even a horse! Do all your configuration options in this file. Save a backup of it somewhere not on your rpi, so you can restore it if necessary.

Your Navit installation should now be working. Go back over the Ozzmaker tutorial and set anything else you find interesting from his tutorial.

You can add Navit to your OAP Applications menu by creating a Navit logo image file by using an image editor, such as Preview on your mac or iphone. Make it small and save it as a .png file. Now edit your openauto_applications.ini (located at /home/pi/.openauto/config/openauto_applications.ini) file and add the following to the bottom of it:

[Application_5]
Name=Navit
Path=<path to your Navit exec file> (This path is /usr/bin/navit on my installation)
IconPath=/home/pi/.openauto/icons/navit.png
Arguments=
Autostart=false

Make sure the Path points to your Navit exec file. If you followed this tutorial, it should be /usr/bin/navit. It is important to have the

[Applications]
Count=6

at the beginning of the file set correctly. If you have 6 applications the number will be 6. The [Application_#] for the application you are adding should be the next number in line, which will be 5 in this case, since the first application is 0.  Make sure you store your navit icon in the icons folder as indicated above. NOTE: Currently OAP limits the number of applications to a max of 8 applications. You can add other executable applications in this same manner and delete ones you don't use, but max is still 8.

Hope that works for you. Since I've installed the new OAP beta, I've had to reinstall Navit from scratch. I should have thought to save the navit.xml file and reinstalled it after the upgrade. Oh well. It helped this tutorial.

Side note: I'm having trouble getting my gps to hook up to Navit for some reason. By using

cat /dev/ttyUSB0

I can see the gps unit is providing active data, but I can't seem to get gpsd to connect to it. Still working on it. Had it working fine before the update, but I don't think it's an OAP problem. I'll update this post when I get it working again.

UPDATE: Got my gps working again. Stupid me. Forgot to edit /etc/default/gpsd to set DEVICES="/dev/ttyUSB0", which is the location for my device. After setting that,

sudo killall gpsd
sudo systemctl enable gpsd.socket
sudo systemctl start gpsd.socket

And Voila! Navit is up and working again.

Despite what some of the various gps tutorials indicate, leave gpsd running, so it starts at boot, so that you don't have to manually enable it every time you boot up your OAP system.

TTH
Reply
#2
funny ... I did the same and now I found your post.
but finaly I have one problem: if I'm closing NAVIT and restart it, the /dev/ttyUSB connection is broken ... at moment I'm not sure why.
Do you have the same problem, or is it something with my config?
Reply
#3
(10-16-2019, 12:53 PM)botswanabub Wrote: funny ... I did the same and now I found your post.
but finaly I have one problem: if I'm closing NAVIT and restart it, the /dev/ttyUSB connection is broken ... at moment I'm not sure why.
Do you have the same problem, or is it something with my config?
I haven't had that problem. I suspect you need to set your gpsd configuration in /etc/default/gpsd. Set to DEVICES="/dev/ttyUSB0". If that isn't the problem, then I suspect your gpsd daemon isn't starting automatically. Try 

sudo killall gpsd

sudo systemctl enable gpsd.socket
sudo systemctl start gpsd.socket

and see if that doesn't fix it.


It is also possible your device address isn't ttyUSB0, like mine is. It could be ttyAMA0 or something else. Try 

cat /dev/ttyUSB0 and see if you get live data from your device. If not, try another address to see if anything gives live data.

TH
Reply
#4
hi, finally I figured out the problem. I did not connect the GPSD, instead I used the hardware conncetion /dev/ttyUSB ... it seems that navit is not closing the connection when you shutdown the task.
with GPSD I have no problems.
Reply
#5
(11-01-2019, 05:52 AM)botswanabub Wrote: hi, finally I figured out the problem. I did not connect the GPSD, instead I used the hardware conncetion /dev/ttyUSB ... it seems that navit is not closing the connection when you shutdown the task.
with GPSD I have no problems.
Nice!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)