Monthly Archives: October 2011

Fixing N900 GPS locking

The Problem

So as I mentioned in my earlier post I had lots of troubles getting GPS locking lately on my N900 which I regularly use for tracking when running. After switching and trying all apps that I was able to find – GPS Recorder, GPS desktop widget, Marble, eCoach and OVI Maps I’ve come to the conclusion that the problems is not in the applications, but rather the GPS device. Initially my thoughts were that it was completely broken as hardware, as I’ve used it quite often and it was always working as expected until recently when it completely failed on me.

The Fix

In the end after lots of searching I’ve found a fix that proved me wrong that it is HW issue, but rather a software one. The only thing that I’ve done was to switch the server used by the A-GPS from the original supl.nokia.com to supl.google.com – works like a charm, locks in a matter of seconds – even inside my apartment 🙂 Just go to Settings -> Location on your device and change the Location server

Well – finally I’m back on track with eCoach …

Advertisements
Tagged , , ,

Fixing Marble KML files

So today I’ve woke up and went for my morning run. I’ve decided to use Marble for tracking on my N900 this time, as eCoach has failed me the couple of times and was not able to produce proper tracks. Everything went smoothly and I’ve got a nice track, which I saved after I’ve finished. Marble supports only KML files, so when I got home, I knew I must convert it to GPX prior to uploading it to mapmytracks.com (one of the best sites I’ve seen for analyzing your tracking data).

The conversion

Using guidelines from the Marble/Tracking page I’ve used the following command:

$ gpsbabel -i kml -f running-2011-10-11_071712.kml -o gpx -f running-2011-10-11_071712.gpx

Please bare in mind that I’m running this on a Fedora 14 install which misses the gpsbabel GUI. I was able to find packages for F15/F16 so if you are using one of those you should have it in the Fedora Repositories.

Having the file converted I’ve tried to upload it to mapmytracks.com, but this is where the things got ugly. The following error was thrown at me:

Warning: Division by zero in /var/www/vhosts/mapmytracks.com/httpdocs/assets/php/modules/classes/gpx.php on line 103
Warning: Division by zero in /var/www/vhosts/mapmytracks.com/httpdocs/assets/php/modules/classes/gpx.php on line 103
Warning: Division by zero in /var/www/vhosts/mapmytracks.com/httpdocs/assets/php/modules/classes/gpx.php on line 103


The Problem

After short investigation I’ve found that my other (eCoach) gpx tracks were having the attribute for each trackpoint () and the converted file was missing them. The google search resulted in nothing of a help that would allow me to inject the timestamps inside this trackpoints, so the logical continuation was to do it myself 🙂

The Fix

For the purpose of this task, a simple perl script was created. You’ll need Date::Parse perl module (perl-TimeDate package on Fedora 14):

#!/usr/bin/perl -w

use Date::Parse;
use POSIX qw/strftime/;

# read the input file
$num_args = $#ARGV + 1;
if ($num_args != 1) {
  print "\nUsage: $0 <input_file.gpx>\n";
  exit;
}

# if you are consolidating points in gpsbabel, change this accordingly
# by default marble writes points every 1 second
my $timeStep = 1;

my $inFile = $ARGV[0];
open FILE, "< $inFile" or die "Can't open $inFile : $!";

# calculate the timezone
my $tz = strftime("%z", localtime(time()));
$tz =~ s/(\d{2})(\d{2})/$1:$2/;
my $unixTime = 0;

while(<FILE>){
  print $_;
  if(/<time>(.*)Z<\/time>/){
    # get the starting time
    $unixTime = str2time($1);
  }
  if(/<ele>/){
    # print ISO8601 formated time
    print "  <time>" . strftime("%Y-%m-%dT%H:%M:%S", localtime($unixTime)) . $tz . "</time>\n";
    $unixTime += $timeStep;
  }
}
close FILE

The only argument that this script takes is the input gpx file, generated with gpsbabel and the output is thrown on stdout. What that script does is it takes the initial time when the gpx file was generated and injects <time></time> values from it, increasing it after every trackpoint with one second. Of course this is not perfect as the timestamps are shifted in time and are not the real values, but at least that allows me to insert the file and analyze it on MapMyTracks. Maybe I’ll post update on that script that will take also as input the KML file, where the time when the files was saved is used, and reverse it back to the first trackpoint. That should give more accurate gpx files.

It seems that I’ll be using this half-baked solution for uploading my tracks, as it works and generates pretty detailed track (one trackpoint per second), unlike eCoach that does this at best every 2 seconds (and does not work on my device :-). Here is the final result on MapMyTracks.

 

EDIT: I’ve found what’s wrong with eCoach and how to fix it

Tagged , , , , , , ,

Add some fun to your KDE desktop

So today I’ve got a little bored of my o-so-serious-monochrome-desktop and decided to change it a little bit. And here I am surfing my best site for desktop “candies” 🙂 – kde-look.org.

The icons

First I’ve found some pretty good-looking and as it seems quite complete set of icons. Of course I’ve installed them directly through systemsettings->Application Appearance->Icons – it is as easy as that. Just search for kfaenza. Here is a sample screenshot from my desktop with the this iconset:

They may resemble some other OS to some extent, but I do not care – they are nice in the end.

The wallpaper

After that I’ve searched for something different and new and found one little nifty plasmoid package that makes wonders 🙂 – The Wallpaper Clock plasmoid. What this plasmoid is supposed to do is to sit in the background as a sort of dynamic wallpaper showing current date and time. It has lots and lots of themes and all of them looking great.

The plasmoit itself depends on plasma-scriptengine-python (as I’m installing this on Fedora 14), and you’ll need to install it if you don’t have it already. Initially I’ve tried installing the package which I’ve downloaded through the plasmoid GUI (“install from local file”), but that failed miserably. So I did it the old way:

$ plasmapkg -r clock # removing the plugin that failed
$ plasmapkg -i clock.plasmoid

EDIT: I’ve done this on another Fedora 14 install and this time I’ve used the “Download new plasma widgets” searched for “wallpaper clock” and directly installed it – it worked like a charm. Still if you have problems, you can try the manual install. You can verify that everything is working as expected by running it manually in separate window:

$ plasmawallpaperviewer --wallpaper clock

/EDIT

And that’s all. After that you can find it sitting under your wallpaper configuration:

As you’ll see adding themes is completely integrated into the plasmoid configuration itself (under “Get New Wallpapers”) and  are very fresh and fun. Please note that some of the themes are only for registered users.

Tagged , , , ,