GPS, maps && apps (uNav)

Some hints about maps / GPS apps

foxtrotGPS:

Unresolved; foxtrotGPS is not ported, and the existings apps are somewhat crappy;

OSMTouch:

The app OSMTouch stores (uses?) the data from this dir (example file):

/home/phablet/.cache/me.yohanboniface.osmtouch/osm_100-1-9-260-172.png

The default location is hardcoded at https://bazaar.launchpad.net/~yohanboniface/osmtouch/trunk/view/head:/OSMTouch.qml#L100

but this seems for another version; in r22 I have found them here and changed the default values for the location I'm in: Havana, Taufkirchen

# ls -l /userdata/system-data/opt/click.ubuntu.com/me.yohanboniface.osmtouch/0.2.1/components/MapPa*
-rw-r--r-- 1 clickpkg clickpkg 12415 jun 13 12:09 MapPage.qml
-rw-r--r-- 1 clickpkg clickpkg 12416 jun 13 12:05 MapPage.qml.Havana
-rw-r--r-- 1 clickpkg clickpkg 12408 dic 7 2014 MapPage.qml.orig
-rw-r--r-- 1 clickpkg clickpkg 12415 jun 13 12:09 MapPage.qml.Taufkirchen

Offline maps:

I have in my FreeBSD netbook ~120.000 tiles of the locations Munich and Havana to make use of the maps even without Internet. I fetch them from time to time for the OpenStreetMap servers. Here are some technical notes about:

The OSM wiki at http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames explains the name structure of the tiles and the different styles. The names are like this 'zoom/x/y.png' and tiles gets delivered in different styles:

Standard:
http://a.tile.openstreetmap.org/9/266/170.png
^----- [abc]
MapQuest:
http://otile1.mqcdn.com/tiles/1.0.0/osm/9/266/170.png
^----- [1234]
http://otile1.mqcdn.com/tiles/1.0.0/osm/9/266/170.jpg
^----- [1234]
OpenCycleMap Transport (experimental):
http://a.tile2.opencyclemap.org/transport/9/266/170.png
^----- [abc]

OSMTouch is normaly using 'MapQuest' style, I'm used to use 'Standard' style.

uNav:

The best OSM app IMHO is at the moment uNav. Since version 0.60 it supports even so called offline (prefetched) tiles. Due to the space limitation I store them on the microSD and use an internal webserver which let uNav access them there. The details are here:

#!/bin/sh
#
# purpose of this script:
# as of 0.60 uNav, written by Costales
# can be configured to use tiles in offline mode directly from the device from
# files in /home/phablet/.local/share/navigator.costales/maps/{z}/{x}/{y}.png
# the URL for this access is coded in
# /userdata/system-data/opt/click.ubuntu.com/navigator.costales/0.60/nav/index.html
#
# due to space limitations, my tiles are on the SD below /media/phablet/*/Maps which
# is not directly accessible by the app;
#
# For uNav version 0.63 I've modified the following two files:
#
# [email protected]:/opt/click.ubuntu.com/navigator.costales/0.63$ diff nav/index.htm*
# 246c246
# < source: new ol.source.OSM({url: 'http://localhost:8888/osm/{z}/{x}/{y}.png'}),
# ---
# > source: new ol.source.OSM({url: '/home/phablet/.local/share/navigator.costales/maps/{z}/{x}/{y}.png'}),
#
# [email protected]:/opt/click.ubuntu.com/navigator.costales/0.63$ diff nav/class/UI.j*
# 775,776c775
# < // dont change the zoom level ([email protected])
# < // this.map_zoom(gps_data['speed'], route_indicator['dist2turn'], route_indicator['dist_track_done'], route_indicator['radar']);
# ---
# > this.map_zoom(gps_data['speed'], route_indicator['dist2turn'], route_indicator['dist_track_done'], route_indicator['radar']);
#
# (end of mods)
#
# and use an own app.desktop file in ~phablet/.local/share/applications/unav-osm.desktop
# which launches this script:
#
# [Desktop Entry]
# Name=unav-osm
# Type=Application
# Exec=/usr/bin/nohup /home/phablet/unav.sh
# Icon=/userdata/system-data/opt/click.ubuntu.com/navigator.costales/current/icon.png
# Terminal=false
# X-Ubuntu-Touch=true
#
# 1st start the local HTTP server:
#
cd /media/phablet/*/Maps
python3 -m http.server 8888 &
# now start uNav
#
cd /userdata/system-data/opt/click.ubuntu.com/navigator.costales/current
qmlscene %u qml/Main.qml

For more information about offline maps in uNav see also: https://unav-go.github.io/offline/

GPS in general:

Things one can do to check the state of GPS:

Make sure all switches for the GPS are on: 1. system settings -> security and privacy -> location access 2. system settings -> battery -> GPS 3. pull down top bar -> location -> location detection and GPS.

Check for GPS in the messages:

$ sudo dmesg | grep GPS
[142058.709985] [GPS] GPS_close: WMT turn off GPS OK!
[142059.154167] GPS_open: major 191 minor 0 (pid 21501)
[142059.154506] [WMT-CTRL][I]wmt_ctrl_gps_sync_set:ctrl GPS_SYNC(4)
[142059.154526] [WMT-FUNC][I]wmt_func_gps_pre_ctrl:ctrl GPS_SYNC_SET(0)
ok
[142059.155455] [WMT-FUNC][I]wmt_func_gps_pre_ctrl:set reg for GPS_SYNC
function okay by chip ic_pin_ctrl
[142059.155492] [WMT-CTRL][I]wmt_ctrl_gps_lna_set:ctrl GPS_LNA(2)
[142059.158530] [GPS] GPS_open: WMT turn on GPS OK!

so you know the state of the GPS.

to list the space vehicles:

$ ubuntu-location-serviced-cli --bus system --get --property visible_space_vehicles
Visible space vehicles:
(type: gps, prn: 1, snr: 0, has_almanac_data: 0,
has_ephimeris_data: 0, used_in_fix: 0, azimuth: 3 deg,
elevation: 23 deg)

Satellites with a snr > 0 are visible;

to run a test:

$ sudo GLOG_v=1000 GLOG_logtostderr=1 ubuntu-location-serviced-cli --bus system --test

The test will try to acquire a fix from GPS only 3 times from cold start, and print out diagnostics together with a summary containing the mean/std.dev. of time to first fix.

to activate more / better logging: the logs are in this dir: /var/log/ubuntu-location-service/

they would help in tracking down any potential issues; alter the config file:

/etc/init/ubuntu-location-service.override

and add the following two lines before the exec line:

export GLOG_v=100
export GLOG_logtostderr=1

and reboot the phone. After having tried to acquire a position, the same log files as mentioned before contain very verbose information about the GPS operation.

Using the dbus-monitor:

$ dbus-monitor --system "path=/com/ubuntu/espoo/Service/Provider, interface=com.ubuntu.remote.Service.Provider, member=PositionChanged"

But you need to switch on system settings -> security and privacy -> location access -> ..anonymized wifi... i believe

Last updated: Mon Feb 5 12:13:38 CET 2018