<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  
  
  <channel>
    <title>chrisjrob: gps</title>
    <link>https://chrisjrob.com</link>
    <atom:link href="https://chrisjrob.com/tag/gps/feed/index.xml" rel="self" type="application/rss+xml" />
    <description>GNU Linux, Perl and FLOSS</description>
    <language>en-gb</language>
    <pubDate>Fri, 13 Feb 2026 17:22:31 +0000</pubDate>
    <lastBuildDate>Fri, 13 Feb 2026 17:22:31 +0000</lastBuildDate>
    
    <item>
      <title>Polarnavy</title>
      <link>https://chrisjrob.com/2013/02/06/polarnavy/</link>
      <pubDate>Wed, 06 Feb 2013 00:00:00 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2013/02/06/polarnavy</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/polar-navy.png" align="right" alt="Featured Image">
         
         <p>Following <a href="/2012/09/17/gps-on-linux/" title="GPS on Linux">an earlier post on using GPS</a> under Ubuntu, I have been
trying to get <a href="http://www.polarnavy.com/" title="Polar Navy">PolarNavy</a>
working under Ubuntu 12.10. Polar Navy is the only Linux chart
navigation software available for Linux. I know people will correct me
by quoting <a href="http://opencpn.org/" title="OpenCPN">OpenCPN</a>, but there are no
charts currently legally available for the UK, at least that I could
find.</p>

<!--more-->

<p>Polar Navy has two components - PolarCOM which communicates with the GPS
receiver, and PolarView which displays the actual charts. The two
applications can connect together, to show the vessel’s current
position.</p>

<p>I had Polar Navy working fine under Ubuntu 12.04 i386, but for some
reason I had problems running under Ubuntu 12.10 amd64. The problem was
that PolarCOM would simply not display the position, i.e. the Lat and
Long. I tried running from the command line, and there were a large
number of errors when running PolarCOM, for example:\</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>menu_proxy_module_load': ./PolarCOM.bin: undefined symbol: menu_proxy_module_load (PolarCOM.bin:4487): Gtk-WARNING **: Failed to load type module: (null)
</code></pre></div></div>

<p>I eventually fixed that by adding the following to the
/opt/polarcom/bin/PolarCOM script:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>export UBUNTU_MENUPROXY=0
</code></pre></div></div>

<p>Sadly PolarCOM was still not working. The GPS Receiver that I use is the
BU-353, a terrific piece of hardware that “just works” under Linux. This
is the recommended GPS for Polar Navy, which was a happy coincidence.
When I plugged in the receiver it was detected as /dev/ttyUSB0, which I
noticed had a group “dialout”. I added myself to that group:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo adduser dialout
</code></pre></div></div>

<p>I posted <a href="http://support.polarnavy.com/forum/read.php?1,494" title="PolarNavy support">a request for help</a>
on the Polar Navy forums and they suggested I connect directly to the
receiver using screen. I was unsure how to terminate that session, but
ended up killing the screen session (Ctrl+Alt+a followed by k to kill).
There is probably a better way - feel free to comment below.:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ screen /dev/ttyUSB0 4800
</code></pre></div></div>

<p>But doing so just output a load of binary garbage, which I realised
(with help from Surrey LUG IRC #surrey on irc.lug.org.uk) meant that
the receiver was no longer in NMEA mode. Apparently GPSD automatically
reconfigures the receiver to SIRC III binary. I have no idea why this
was not a problem in Ubuntu 12.04.</p>

<p>To fix this problem I needed to ensure that GPSD was not running.
Unfortunately stopping the service does not seem to terminate the
process, so I also had to kill it off:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo service gpsd stop
$ ps aux | grep gps
$ killall PolarCOM.bin
</code></pre></div></div>

<p>Next I placed the GPS receiver into NMEA ASCII mode, instead of SIRCIII
Binary mode:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ gpsctl -f -n /dev/ttyUSB0
</code></pre></div></div>

<p>Lastly, you may also need to configure the serial port, although I did
not need to do this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ stty -F /dev/ttyUSB0 ispeed 4800
</code></pre></div></div>

<p>A quick check to see that we are getting ASCII NMEA sentences, showed
that it was working perfectly, with easy to read text output from the
receiver.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ screen /dev/ttyUSB0 4800
</code></pre></div></div>

<p>To prevent GPSD from reconfiguring the receiver again, I then needed to
reconfigure it to use read-only mode:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo dpkg-reconfigure gpsd
</code></pre></div></div>

<p>And at the point where it requests switches, I added “-b” (Broken Device
Safety Mode), otherwise known as read-only mode.</p>

<p>With trepidation I launched PolarCOM, which immediately showed my
current position.</p>


       ]]>
      </description>
    </item>
    
    <item>
      <title>GPS On Linux</title>
      <link>https://chrisjrob.com/2012/09/17/gps-on-linux/</link>
      <pubDate>Mon, 17 Sep 2012 00:00:00 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2012/09/17/gps-on-linux</guid>
      <description>
       <![CDATA[
         
           <img src="https://chrisjrob.com/assets/gps-bu-353.jpg" align="right" alt="Featured Image">
         
         <p>I have bought myself a <a href="http://www.amazon.co.uk/gp/product/B000PKX2KA/ref=as_li_ss_il?ie=UTF8&amp;camp=1634&amp;creative=19450&amp;creativeASIN=B000PKX2KA&amp;linkCode=as2&amp;tag=robsquadnet-21">GPS Receiver BU-353</a>.
Having plugged in the device into my Debian Wheezy workstation, I wanted
to test that it was working.</p>

<!--more-->

<p>A quick dmesg | tail showed me that the device has been found and
installed correctly (no drivers required).</p>

<p>I then installed the GPS daemon:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install gpsd gpsd-clients
$ sudo dpkg-reconfigure gpsd
</code></pre></div></div>

<p>This then started the GPS daemon. The next thing to do was get some
example output, and the tool for this is gpspipe:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ gpspipe -w -n 5
</code></pre></div></div>

<p>Lastly, I thought it would be fun to plot the output onto Google Maps
and/or Openstreetmaps:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ tpv=$(gpspipe -w -n 5 | grep -m 1 TPV | cut -d, -f4,6-8,13)
$ latitude=$(echo $tpv | cut -d, -f3 | cut -d: -f2)
$ longitude=$(echo $tpv | cut -d, -f4 | cut -d: -f2)
$ google_map_url="http://maps.google.com/?q=${longitude},${latitude}&amp;z=${zoom}"
$ osm_map_url="http://www.openstreetmap.org/?mlat=${latitude}&amp;mlon=${longitude}&amp;zoom=${zoom}&amp;layers=M"
$ xdg-open $google_map_url
$ xdg-open $osm_map_url
</code></pre></div></div>

<p>All worked beautifully.</p>


       ]]>
      </description>
    </item>
    
  </channel> 
</rss>
