Willkommen Downloads Projekte Links Kontakt

 

Navit configuration file for Openmoko Neo Freerunner by ChrisPZV

For some (unknown) reason I get this error when I try to copy this well formed file as described here:
root@om-gta02 ~ # unset LC_ALL && export LANG=de_DE.utf-8 && fsoraw -fr CPU,GPS,
Display -- navit
navit:main_real:Error parsing '/home/root/.navit/navit.xml': Error on line 1 char 1: Document must begin with an element (e.g. <book>) at line 1, char 1

GNU gdb (GDB) 7.1 [...]
So I packed it with tape archiver ('tar') and the install command does so vice versa.
Something interesting about the original navit.xml file here:
root@om-gta02 ~ # file /home/root/.navit/navit.xml 
/home/root/.navit/navit.xml: broken xHTML document text
root@om-gta02 ~ #
To install this config file to your Openmoko running SHR you need to:
mkdir -p /home/root/.navit/ && wget -O /tmp/navit_xml.tgz http://www.chpohl.de/openmoko/navit/navit_xml.tgz && tar -xzf /tmp/navit_xml.tgz -C /home/root/
Code:
This layout supports both, landscape and portrait orientation. To let Navit speak in your own language, 'export LANG=de_DE.utf-8' (use your language code here) before starting navit binary and adjust speech-tag to your needs. map-tag has to be checked too.
Screenshots:
landscape and portrait orientation screenshot

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE config SYSTEM "navit.dtd">
<config xmlns:xi="http://www.w3.org/2001/XInclude">
	<xi:include href="/usr/share/navit/plugins.xml"/>
	<xi:include href="/usr/share/navit/navit.default.xml" xpointer="xpointer(/config/debug)"/>

	<navit center="4808 N 1134 E" zoom="64" tracking="1" orientation="-1" recent_dest="10" drag_bitmap="1">
		<graphics type="gtk_drawing_area"/>
		<gui type="gtk" enabled="no" menubar="1" toolbar="1" statusbar="0"/>
		<!--xi:include href="/usr/share/navit/navit.default.xml" xpointer="xpointer(/config/navit/gui[@type='internal'])"/-->
		<gui type="internal" enabled="yes" fullscreen="1" font_size="380" icon_xs="60" icon_s="70" icon_l="96"><![CDATA[
		<html>
			<a name='Main Menu'><text>Main menu</text>
				<a href='#Actions'><img src='gui_actions'>Actions</img></a>
				<img cond='flags&2' src='gui_map' onclick='back_to_map()'><text>Show
Map</text></img>
				<a href='#Settings'><img src='gui_settings'><text>Settings</text></img></a>
				<a href='#Tools'><img src='gui_tools'><text>Tools</text></img></a>
				<a href='#Route'><img src='gui_settings'><text>Route</text></img></a>
                <img src='gui_about' onclick='about()'><text>About</text></img>
			</a>
			<a name='Actions'><text>Actions</text>
				<img src='gui_bookmark' onclick='bookmarks()'><text>Bookmarks</text></img>
				<img cond='click_coord_geo' src='gui_map' onclick='position(click_coord_geo,_("Map Point"),8|16|32|64|256)'><script>write(click_coord_geo)</script></img>
				<img cond='position_coord_geo' src='gui_vehicle' onclick='position(position_coord_geo,_("Vehicle Position"),8|32|64|128|256)'><script>write(position_coord_geo)</script></img>
				<img src='gui_town' onclick='town()'><text>Town</text></img>
				<img src='gui_quit' onclick='quit()'><text>Quit</text></img>
				<img cond='navit.route.route_status&52' src='gui_stop' onclick='abort_navigation()'><text>Stop
Navigation</text></img>
			</a>
			<a name='Settings'><text>Settings</text>
				<a href='#Settings Display'><img src='gui_display'><text>Display</text></img></a>
				<img src='gui_maps' onclick='setting_maps()'><text>Maps</text></img>
				<img src='gui_vehicle' onclick='setting_vehicle()'><text>Vehicle</text></img>
				<img src='gui_rules' onclick='setting_rules()'><text>Rules</text></img>
			</a>
			<a name='Settings Display'><text>Display</text>
				<img src='gui_display' onclick='setting_layout()'><text>Layout</text></img>
				<img cond='fullscreen==0' src='gui_fullscreen' onclick='fullscreen=1'><text>Fullscreen</text></img>
				<img cond='fullscreen==1' rc='gui_leave_fullscreen' onclick='fullscreen=0'><text>Window Mode</text></img>
				<img cond='navit.pitch==0' src='gui_map' onclick='navit.pitch=pitch;redraw_map();back_to_map()'><text>3D</text></img>
				<img cond='navit.pitch!=0' src='gui_map' onclick='navit.pitch=0;redraw_map();back_to_map()'><text>2D</text></img>
			</a>
			<a name='Tools'><text>Tools</text>
				<img src='gui_actions' onclick='locale()'><text>Show Locale</text></img>
			</a>
			<a name='Route'><text>Route</text>
				<img src='gui_actions' onclick='route_description()'><text>Description</text></img>
				<img src='gui_actions' onclick='route_height_profile()'><text>Height Profile</text></img>
			</a>
		</html>
		]]></gui>
			
		<!-- or comment gtk version above and try:
		opkg install navit-graphics-qt
		opkg install navit-gui-qml
		<graphics type="qt_qpainter"/>
		<gui type="qml" enabled="yes" menubar="1" toolbar="1" statusbar="1"/>
		-->
		<!--xi:include href="/usr/share/navit/osd.xml"/-->
		<osd enabled="yes" type="text" label="${navigation.item.street_name} ${navigation.item[1].street_name_systematic}" x="0" y="0" w="580" h="30" align="4" background_color="#000000cc" font_size="300" />
		<osd enabled="yes" type="gps_status" x="-60" y="0" w="60" h="30" align="6" background_color="#000000cc" font_size="300" />
		<osd enabled="yes" type="compass" align="0" font_size="160" x="0" y="30" w="90" h="110"  background_color="#000000cc" />
		<osd enabled="yes" type="navigation_next_turn" x="-150" y="30" w="150" h="65"  background_color="#000000cc" icon_src="$NAVIT_SHAREDIR/xpm/%s_wh_48_48.png" />
		<osd enabled="yes" type="text" label="${navigation.item[1].length[named]}" x="-150" y="95" w="150" h="45" align="0" background_color="#000000cc" font_size="450"/>
		<osd enabled="yes" type="button" x="-101" y="-227" command="zoom_in()" src="gui_zoom_in_96_96.png"/>
		<osd enabled="yes" type="button" x="-101" y="-126" command="zoom_out()" src="gui_zoom_out_96_96.png"/>
		<osd enabled="yes" x="0" y="-80" w="160" h="30" font_size="175" type="scale" />
		<osd enabled="yes" type="text" label="${vehicle.position_speed}" x="0" y="-50" w="160" h="25" align="4" background_color="#000000cc" font_size="350"/>
		<osd enabled="yes" type="text" label="ETA:${navigation.item.destination_time[arrival]}" x="0" y="-25" w="160" h="25" align="4" background_color="#000000cc" font_size="350" />
		<osd enabled="yes" type="text" label="TL:${navigation.item.destination_time[remaining]}" x="160" y="-25" w="160" h="25" align="4" background_color="#000000cc" font_size="350" />
		<osd enabled="yes" type="text" label="Dist:${navigation.item.destination_length[named]}" x="320" y="-25" w="160" h="25" align="4" background_color="#000000cc" font_size="350" />		

		<log enabled="no" type="textfile_debug" data="debug_%Y%m%d-%i.txt" flush_size="1000" flush_time="30"/>
		<vehicle name="Local GPS" profilename="car" enabled="yes" active="1" source="gpsd://localhost" gpsd_query="w+xj" follow="3">
			<!-- <log type="gpx" attr_types="position_time_iso8601,position_direction,position_speed,profilename,position_radius" data="track_%Y%m%d-%i.gpx" flush_size="1000" flush_time="30"/> -->
		</vehicle>

		<vehicle name="Demo" profilename="car" enabled="yes" active="0" source="demo://"/>

		<!-- For the cumulative displacement filter to be enabled, set cdf_histsize="x" here, with x being an integer somewhere around 4 -->
		<tracking cdf_histsize="0"/>

		<xi:include href="/usr/share/navit/navit.default.xml" xpointer="xpointer(/config/navit/vehicleprofile[@name='car'])"/>
		<xi:include href="/usr/share/navit/navit.default.xml" xpointer="xpointer(/config/navit/vehicleprofile[@name='bike'])"/>
		<xi:include href="/usr/share/navit/navit.default.xml" xpointer="xpointer(/config/navit/vehicleprofile[@name='pedestrian'])"/>
		<xi:include href="/usr/share/navit/navit.default.xml" xpointer="xpointer(/config/navit/vehicleprofile[@name='horse'])"/>

		<route destination_distance="50"/>

		<xi:include href="/usr/share/navit/navit.default.xml" xpointer="xpointer(/config/navit/navigation)"/>

		<!--xi:include href="/usr/share/navit/speech.xml"/-->
		<speech type="cmdline" data="espeak -vde+m4 '%s' &amp;" cps="15"/>
		
		<!--xi:include href="/usr/share/navit/maps.xml" /-->
		<mapset enabled="yes">
			<map type="binfile" enabled="yes" data="/media/mmc1/Maps/Navit/osm_germany.bin"/>
		</mapset>

		<xi:include href="/usr/share/navit/navit.default.xml" xpointer="xpointer(/config/navit/layout[@name='Car'])"/>
		<xi:include href="/usr/share/navit/navit.default.xml" xpointer="xpointer(/config/navit/layout[@name='Car-dark'])"/>
		<xi:include href="/usr/share/navit/navit.default.xml" xpointer="xpointer(/config/navit/layout[@name='Bike'])"/>
		<xi:include href="/usr/share/navit/navit.default.xml" xpointer="xpointer(/config/navit/layout[@name='T@H'])"/>
	</navit>
</config>


After having the navit.xml config file installed, I suggest to install a little navit start script, to make sure, all environment variables are set according to your language settings. Installing the script is done as follows:
mv /usr/bin/navit /usr/bin/navit.bin && wget -O /usr/bin/navit http://www.chpohl.de/openmoko/navit/navit && chmod 0755 /usr/bin/navit
Code:

#!/bin/sh

# adjust this code to your needs (e.g. en_US.utf-8): 
CODEPAGE=de_DE.utf-8

export LANG=$CODEPAGE
export LC_NUMERIC=$CODEPAGE
export LC_TIME=$CODEPAGE
export LC_MEASUREMENT=$CODEPAGE
export LC_TELEPHONE=$CODEPAGE
export LC_COLLATE=$CODEPAGE
export LANGUAGE=$CODEPAGE

export LC_MESSAGES=$CODEPAGE

unset LC_ALL

navit.bin

Note:
This configuration is tested with version svnr3599-r8 of Navit coming with the recent (Nov. 2010) unstable feeds of SHR-U http://shr.bearstech.com/shr-unstable/ipk/om-gta02/. If later versions of Navit do crash with that config, consider making a new one according to the values used here.