Index: src/python/bin/gnuboat
===================================================================
--- src/python/bin/gnuboat	(revision 1efcac7b94f6aecc373de94bef5d21da1605b4cb)
+++ src/python/bin/gnuboat	(revision 0e718778e4026c00b59eae819c6824bf65bba02d)
@@ -33,6 +33,6 @@
 from gnuboat import daemon
 
-WHITE=1
-BLACK=0
+WHITE = 1
+BLACK = 0
 marginVertical = 10
 marginHorizontal = marginVertical
@@ -48,189 +48,201 @@
 nmeafile = None
 
+
 def rraRows(duration, resolution, step):
     return int(round(float(duration) / rraSteps(resolution, float(step)) / float(step)))
 
+
 def rraSteps(resolution, step):
     return int(round(float(resolution) / float(step)))
 
+
 def createDatabase(databaseFile):
-  rrdDataSources = [ 'DS:latitude:GAUGE:15:-90:90',
-                     'DS:longitude:GAUGE:15:-180:180',
-                     'DS:speedthroughwater:GAUGE:15:U:U',
-                     'DS:speedoverground:GAUGE:15:U:U',
-                     'DS:waterdepth:GAUGE:15:0:10000',
-                     'DS:watertemperature:GAUGE:15:-10:50',
-                     'DS:gpsfix:GAUGE:15:-999:3' ]
-
-  step = logperiod
-  # durations: each archive should contain values for in seconds
-  archives = [
-    {"duration": 240, "resolution": 2},
-    {"duration": 3600, "resolution": 10},
-    {"duration": 86400, "resolution": 60},
-  ]
-  rrdArchives = []
-  for i in range(0, len(archives)):
-    rrdArchives += ['RRA:AVERAGE:0.5:%d:%d' % (rraSteps(archives[i]["resolution"], step), rraRows(archives[i]["duration"], archives[i]["resolution"], step))]
-
-  if not os.path.isfile(databaseFile):
-    rrdtool.create(databaseFile,
-                   "--start",
-                   "N",
-                   "--step",
-                   str(step),
-                   rrdDataSources,
-                   rrdArchives)
+    rrdDataSources = ['DS:latitude:GAUGE:15:-90:90',
+                      'DS:longitude:GAUGE:15:-180:180',
+                      'DS:speedthroughwater:GAUGE:15:U:U',
+                      'DS:speedoverground:GAUGE:15:U:U',
+                      'DS:waterdepth:GAUGE:15:0:10000',
+                      'DS:watertemperature:GAUGE:15:-10:50',
+                      'DS:gpsfix:GAUGE:15:-999:3']
+
+    step = logperiod
+    # durations: each archive should contain values for in seconds
+    archives = [
+        {"duration": 240, "resolution": 2},
+        {"duration": 3600, "resolution": 10},
+        {"duration": 86400, "resolution": 60},
+    ]
+    rrdArchives = []
+    for i in range(0, len(archives)):
+        rrdArchives += ['RRA:AVERAGE:0.5:%d:%d' % (rraSteps(archives[i]["resolution"], step), rraRows(
+            archives[i]["duration"], archives[i]["resolution"], step))]
+
+    if not os.path.isfile(databaseFile):
+        rrdtool.create(databaseFile,
+                       "--start",
+                       "N",
+                       "--step",
+                       str(step),
+                       rrdDataSources,
+                       rrdArchives)
+
 
 def checkShutdownRequest(shutdownFile):
-  global shutdownRequested
-  # have look for new shutdown requests
-  if os.path.isfile(shutdownFile):
-    with open(shutdownFile, "r") as fileHandler:
-      shutdownStart = fileHandler.read().strip()
-    os.remove(shutdownFile)
-    shutdownRequested = dateutil.parser.parse(shutdownStart)
-  # check existing shutdown requests
-  if shutdownRequested is not None:
-    currentTime = datetime.datetime.now()
-    currentTime = currentTime.replace(tzinfo=pytz.utc)
-    if (currentTime - shutdownRequested) > datetime.timedelta(seconds = 0):
-      os.system("sudo shutdown -h now")
+    global shutdownRequested
+    # have look for new shutdown requests
+    if os.path.isfile(shutdownFile):
+        with open(shutdownFile, "r") as fileHandler:
+            shutdownStart = fileHandler.read().strip()
+        os.remove(shutdownFile)
+        shutdownRequested = dateutil.parser.parse(shutdownStart)
+    # check existing shutdown requests
+    if shutdownRequested is not None:
+        currentTime = datetime.datetime.now()
+        currentTime = currentTime.replace(tzinfo=pytz.utc)
+        if (currentTime - shutdownRequested) > datetime.timedelta(seconds=0):
+            os.system("sudo shutdown -h now")
+
 
 def usage():
-  print "Usage of gnuboat daemon:"
-  print "  gnuboat -r PATH_TO_RRD_DATABAE_FILE -s PATH_TO_SHUTDOWN_REQUEST_FILE [-l [LOG_UPDATE_PERIOD] [-d DISPLAY_UPDATE_PERIOD] [-o PATH_TO_NMEA1983_LOG]"
-  print ""
-  print "  -h --help              Display this help"
-  print "  -r --rrdfile           Path to the rrd database used by the webservice to serve the clients"
-  print "  -s --shutdownfile      Path to the shutdown request file, used by the webservice to request a shutdown of the system running gnuboat"
-  print "  -l --logperiod         Time in seconds to update the logs"
-  print "  -d --displayperiod     Timein seconds to update the display"
-  print "  -o --output            File where the NMEA1983 log is stored"
+    print "Usage of gnuboat daemon:"
+    print "  gnuboat -r PATH_TO_RRD_DATABAE_FILE -s PATH_TO_SHUTDOWN_REQUEST_FILE [-l [LOG_UPDATE_PERIOD] [-d DISPLAY_UPDATE_PERIOD] [-o PATH_TO_NMEA1983_LOG]"
+    print ""
+    print "  -h --help              Display this help"
+    print "  -r --rrdfile           Path to the rrd database used by the webservice to serve the clients"
+    print "  -s --shutdownfile      Path to the shutdown request file, used by the webservice to request a shutdown of the system running gnuboat"
+    print "  -l --logperiod         Time in seconds to update the logs"
+    print "  -d --displayperiod     Timein seconds to update the display"
+    print "  -o --output            File where the NMEA1983 log is stored"
+
 
 def main(argv):
-  global rrdfile
-  global shutdownfile
-  global logperiod
-  global displayperiod
-  global logfile
-  global nmeafile
- 
-  try:                                
-    opts, args = getopt.getopt(argv, "hr:s:l:d:o:", ["help", "rrdfile=", "shutdownfile=", "logperiod=", "displayperiod=", "output="]) 
-  except getopt.GetoptError:           
-    usage()                          
-    sys.exit(2)
-
-  for option, argument in opts:
-    if option == ("-h", "--help"):
-      usage()
-      sys.exit()
-    elif option in ("-r", "--rrdfile"):
-       rrdfile = argument
-    elif option in ("-s", "--shutdownfile"):
-      shutdownfile = argument
-    elif option in ("-l", "--logperiod"):
-      logperiod = argument
-    elif option in ("-d", "--displayperiod"):
-      displayperiod = argument
-    elif option in ("-o", "--output"):
-      logfile = argument
-    else:
-      assert False, "unhandled option"
-
-  if not os.path.exists(os.path.dirname(rrdfile)):
-    print "rrd database directory not found %s" % os.path.dirname(rrdfile)
-    print ""
-    usage()
-    sys.exit(2)
-
-  if not os.path.exists(os.path.dirname(shutdownfile)):
-    print "Shutdown request directory not found %s" % os.path.dirname(shutdownfile)
-    print ""
-    usage()
-    sys.exit(2)
-
-  if logperiod < 1:
-    print "Log period must be >= 1"
-    print ""
-    usage()
-    sys.exit(2)
-
-  if displayperiod < 1 or displayperiod < logperiod:
-    print "Display period must be >= 1 and could not be faster than log period"
-    print ""
-    usage()
-    sys.exit(2)
-
-  createDatabase(rrdfile)
-
-  try:
-    nmeafile = open(logfile, 'a', 0)
-  except IOError as error:
-    print "Could not open the logfile: %s" % error
-    sys.exit(2)
-
-  displayHandler = daemon.DisplayHandler(displayperiod)
-
-  gpsp = daemon.GpsdPoller(logperiod)
-  n2kd = daemon.N2kdPoller(logperiod)
-  try:
-    gpsp.start()
-    n2kd.start()
-    while True:
-      # In the main thread, every logPeriod seconds print the current value
-      time.sleep(logperiod)
-      latitude = gpsp.latitude()
-      longitude = gpsp.longitude()
-      speedThroughWater = n2kd.speedThroughWater()
-      speedOverGround = gpsp.speedOverGround()
-      waterDepth = n2kd.waterDepth()
-      waterTemperature = n2kd.waterTemperature()
-      gpsFix = gpsp.gpsFix()
-            
-      # update rrd database for the webservice
-      rrdtool.update(rrdfile, "N:%s:%s:%s:%s:%s:%s:%s" % (latitude, longitude, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix))
-      
-      # append to log
-      if gpsp.gpsFix() >= 2:
-        timeUtc = gpsp.timeUtc()
-        status = gpsp.status()
-        latitudeDirection = gpsp.latitudeDirection()
-        longitudeDirection = gpsp.longitudeDirection()
-        courseOverGround = gpsp.courseOverGround()
-        
-        mode = 'N'
-        if gpsFix >= 2:
-          mode = 'A'
-        
-        nmeafile.write("%s\r\n" % str(pynmea2.RMC('GN', 'RMC',
-                      ( timeUtc.strftime("%H%M%S"), status, '$%04.3f' % latitude,
-                        latitudeDirection, '$%05.3f' % longitude, longitudeDirection,
-                        '$%02.1f' % speedOverGround, '$%02.1f' % courseOverGround,
-                        timeUtc.strftime("%d%m%y"), '', '', mode ))))
-        if n2kd.waterDepthValid():
-          nmeafile.write("%\r\n" % str(pynmea2.DPT('SD', 'DPT',
-                        ( '%02.2f' % waterDepth, '00.00' ))))
-      
-      # display data
-      displayHandler.setValues(speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix)
-      
-      #check for shutdown request
-      checkShutdownRequest(shutdownfile)
-       
-  except (KeyboardInterrupt, SystemExit): #when you press ctrl+c
-    if nmeafile:
-      nmeafile.close()
-    if gpsp.ident is not None:
-      gpsp.stop()
-      gpsp.join() # wait for the thread to finish what it's doing
-    if n2kd.ident is not None:
-      n2kd.stop()
-      n2kd.join()
-    if displayHandler.ident is not None:
-      displayHandler.stop()
-      displayHandler.join() # wait for the thread to finish what it's doing
+    global rrdfile
+    global shutdownfile
+    global logperiod
+    global displayperiod
+    global logfile
+    global nmeafile
+
+    try:
+        opts, args = getopt.getopt(argv, "hr:s:l:d:o:", [
+                                   "help", "rrdfile=", "shutdownfile=", "logperiod=", "displayperiod=", "output="])
+    except getopt.GetoptError:
+        usage()
+        sys.exit(2)
+
+    for option, argument in opts:
+        if option == ("-h", "--help"):
+            usage()
+            sys.exit()
+        elif option in ("-r", "--rrdfile"):
+            rrdfile = argument
+        elif option in ("-s", "--shutdownfile"):
+            shutdownfile = argument
+        elif option in ("-l", "--logperiod"):
+            logperiod = argument
+        elif option in ("-d", "--displayperiod"):
+            displayperiod = argument
+        elif option in ("-o", "--output"):
+            logfile = argument
+        else:
+            assert False, "unhandled option"
+
+    if not os.path.exists(os.path.dirname(rrdfile)):
+        print "rrd database directory not found %s" % os.path.dirname(rrdfile)
+        print ""
+        usage()
+        sys.exit(2)
+
+    if not os.path.exists(os.path.dirname(shutdownfile)):
+        print "Shutdown request directory not found %s" % os.path.dirname(shutdownfile)
+        print ""
+        usage()
+        sys.exit(2)
+
+    if logperiod < 1:
+        print "Log period must be >= 1"
+        print ""
+        usage()
+        sys.exit(2)
+
+    if displayperiod < 1 or displayperiod < logperiod:
+        print "Display period must be >= 1 and could not be faster than log period"
+        print ""
+        usage()
+        sys.exit(2)
+
+    createDatabase(rrdfile)
+
+    try:
+        nmeafile = open(logfile, 'a', 0)
+    except IOError as error:
+        print "Could not open the logfile: %s" % error
+        sys.exit(2)
+
+    displayHandler = daemon.DisplayHandler(displayperiod)
+
+    gpsp = daemon.GpsdPoller(logperiod)
+    n2kd = daemon.N2kdPoller(logperiod)
+    try:
+        gpsp.start()
+        n2kd.start()
+        while True:
+            # In the main thread, every logPeriod seconds print the current
+            # value
+            time.sleep(logperiod)
+            latitude = gpsp.latitude()
+            longitude = gpsp.longitude()
+            speedThroughWater = n2kd.speedThroughWater()
+            speedOverGround = gpsp.speedOverGround()
+            waterDepth = n2kd.waterDepth()
+            waterTemperature = n2kd.waterTemperature()
+            gpsFix = gpsp.gpsFix()
+
+            # update rrd database for the webservice
+            rrdtool.update(rrdfile, "N:%s:%s:%s:%s:%s:%s:%s" % (
+                latitude, longitude, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix))
+
+            # append to log
+            if gpsp.gpsFix() >= 2:
+                timeUtc = gpsp.timeUtc()
+                status = gpsp.status()
+                latitudeDirection = gpsp.latitudeDirection()
+                longitudeDirection = gpsp.longitudeDirection()
+                courseOverGround = gpsp.courseOverGround()
+
+                mode = 'N'
+                if gpsFix >= 2:
+                    mode = 'A'
+
+                nmeafile.write("%s\r\n" % str(pynmea2.RMC('GN', 'RMC',
+                                                          (timeUtc.strftime("%H%M%S"), status, '$%04.3f' % latitude,
+                                                           latitudeDirection, '$%05.3f' % longitude, longitudeDirection,
+                                                           '$%02.1f' % speedOverGround, '$%02.1f' % courseOverGround,
+                                                           timeUtc.strftime("%d%m%y"), '', '', mode))))
+                if n2kd.waterDepthValid():
+                    nmeafile.write("%\r\n" % str(pynmea2.DPT('SD', 'DPT',
+                                                             ('%02.2f' % waterDepth, '00.00'))))
+
+            # display data
+            displayHandler.setValues(
+                speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix)
+
+            # check for shutdown request
+            checkShutdownRequest(shutdownfile)
+
+    except (KeyboardInterrupt, SystemExit):  # when you press ctrl+c
+        if nmeafile:
+            nmeafile.close()
+        if gpsp.ident is not None:
+            gpsp.stop()
+            gpsp.join()  # wait for the thread to finish what it's doing
+        if n2kd.ident is not None:
+            n2kd.stop()
+            n2kd.join()
+        if displayHandler.ident is not None:
+            displayHandler.stop()
+            # wait for the thread to finish what it's doing
+            displayHandler.join()
 
 if __name__ == "__main__":
-  main(sys.argv[1:])
+    main(sys.argv[1:])
Index: src/python/bin/gnuboat-splashscreen
===================================================================
--- src/python/bin/gnuboat-splashscreen	(revision 1efcac7b94f6aecc373de94bef5d21da1605b4cb)
+++ src/python/bin/gnuboat-splashscreen	(revision 0e718778e4026c00b59eae819c6824bf65bba02d)
@@ -21,58 +21,61 @@
 import getopt
 try:
-  from PIL import Image
-  from PIL import ImageOps
-  from EPD import EPD
-  epdEnabled = True
+    from PIL import Image
+    from PIL import ImageOps
+    from EPD import EPD
+    epdEnabled = True
 except:
-  epdEnabled = False
+    epdEnabled = False
+
 
 def displayImage(epd, imageFilePath):
-  image = Image.open(imageFilePath)
-  image = ImageOps.grayscale(image)
-  imageResized = image.resize((epd.width, epd.height))
-  imageBlackWhite = imageResized.convert("1", dither=Image.FLOYDSTEINBERG)
-  epd.display(imageBlackWhite)
-  epd.update()
+    image = Image.open(imageFilePath)
+    image = ImageOps.grayscale(image)
+    imageResized = image.resize((epd.width, epd.height))
+    imageBlackWhite = imageResized.convert("1", dither=Image.FLOYDSTEINBERG)
+    epd.display(imageBlackWhite)
+    epd.update()
+
 
 def usage():
-  print "Usage of gnuboat-splashscreen:"
-  print "  gnuboat-splashscreen [-h] -i PATH_TO_IMAGE_TO_DISPLAY"
-  print ""
-  print "  -h --help    Print this help"
-  print "  -i --image   Path to the image, which should be displayed"
-  sys.exit()
+    print "Usage of gnuboat-splashscreen:"
+    print "  gnuboat-splashscreen [-h] -i PATH_TO_IMAGE_TO_DISPLAY"
+    print ""
+    print "  -h --help    Print this help"
+    print "  -i --image   Path to the image, which should be displayed"
+    sys.exit()
 
-def main(argv):                      
-  image = ""                 
-  try:                                
-    opts, args = getopt.getopt(argv, "hi:", ["help", "image="]) 
-  except getopt.GetoptError:           
-    usage()                          
-    sys.exit(2)
 
-  for option, argument in opts:
-    if option == ("-h", "--help"):
-      usage()
-      sys.exit()
-    elif option in ("-i", "--image"):
-       image = argument
-    else:
-      assert False, "unhandled option"
+def main(argv):
+    image = ""
+    try:
+        opts, args = getopt.getopt(argv, "hi:", ["help", "image="])
+    except getopt.GetoptError:
+        usage()
+        sys.exit(2)
 
-  if not os.path.exists(image):
-    print "Image %s not found" % image
-    print ""
-    usage()
-    sys.exit(2)
+    for option, argument in opts:
+        if option == ("-h", "--help"):
+            usage()
+            sys.exit()
+        elif option in ("-i", "--image"):
+            image = argument
+        else:
+            assert False, "unhandled option"
 
-  if not epdEnabled:
-    print "Could not initialize EPD or PIL python packages"
-    sys.exit(2)
+    if not os.path.exists(image):
+        print "Image %s not found" % image
+        print ""
+        usage()
+        sys.exit(2)
 
-  epd = EPD()
-  epd.clear()
-  displayImage(epd, image)
+    if not epdEnabled:
+        print "Could not initialize EPD or PIL python packages"
+        sys.exit(2)
+
+    epd = EPD()
+    epd.clear()
+    displayImage(epd, image)
 
 if __name__ == "__main__":
-  main(sys.argv[1:])
+    main(sys.argv[1:])
Index: src/python/gnuboat/daemon/displayhandler.py
===================================================================
--- src/python/gnuboat/daemon/displayhandler.py	(revision 1efcac7b94f6aecc373de94bef5d21da1605b4cb)
+++ src/python/gnuboat/daemon/displayhandler.py	(revision 0e718778e4026c00b59eae819c6824bf65bba02d)
@@ -21,119 +21,136 @@
 
 try:
-  from EPD import EPD
-  from PIL import Image
-  from PIL import ImageDraw
-  from PIL import ImageFont
-  epdEnabled = True
+    from EPD import EPD
+    from PIL import Image
+    from PIL import ImageDraw
+    from PIL import ImageFont
+    epdEnabled = True
 except:
-  epdEnabled = False
+    epdEnabled = False
 
 """@class DisplayHandler
 """
+
+
 class DisplayHandler(threading.Thread):
-  def __init__(self, displayperiod):
-    threading.Thread.__init__(self)
-    try:
-      self._epd = EPD()
-    except:
-      epdEnabled = False
-      return
-    self._epd.clear()
-    self._updatePeriod = displayperiod
-    self._running = True
-    self._speedThroughWater = None
-    self._speedOverGround = None
-    self._waterDepth = None
-    self._waterTemperature = None
-    self._gpsFix = None
-    
-  def setSpeedThroughWater(self, speed):
-    self._speedThroughWater = speed
 
-  def setSpeedOverGround(self, speed):
-    self._speedOverGround = speed
-    
-  def setWaterDepth(self, depth):
-    self._waterDepth = depth
-    
-  def setWaterTemperature(self, temperature):
-    self._waterTemperature = temperature
+    def __init__(self, displayperiod):
+        threading.Thread.__init__(self)
+        try:
+            self._epd = EPD()
+        except:
+            epdEnabled = False
+            return
+        self._epd.clear()
+        self._updatePeriod = displayperiod
+        self._running = True
+        self._speedThroughWater = None
+        self._speedOverGround = None
+        self._waterDepth = None
+        self._waterTemperature = None
+        self._gpsFix = None
 
-  def setGpsFix(self, fix):
-    self._gpsFix = fix
-    
-  def setValues(self, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix):
-    self.setSpeedThroughWater(speedThroughWater)
-    self.setSpeedOverGround(speedOverGround)
-    self.setWaterDepth(waterDepth)
-    self.setWaterTemperature(waterTemperature)
-    self.setGpsFix(gpsFix)
+    def setSpeedThroughWater(self, speed):
+        self._speedThroughWater = speed
 
-  def stop(self):
-    self._running = False
-    
-  def run(self):
-    if not epdEnabled:
-      return
-    try:
-      while self._running:
-        self.displayValues(self._epd, self._speedThroughWater, self._speedOverGround, self._waterDepth, self._waterTemperature, self._gpsFix)
-        time.sleep(self._updatePeriod)
-    except StopIteration:
-      pass
+    def setSpeedOverGround(self, speed):
+        self._speedOverGround = speed
 
-  def displayValues(epd, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix):
-    if not epdEnabled:
-      return
+    def setWaterDepth(self, depth):
+        self._waterDepth = depth
 
-    # requires dejavu package!!!!
-    fontValues = ImageFont.truetype('/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf', 34)
-    fontTitles = ImageFont.truetype('/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf', 24)
+    def setWaterTemperature(self, temperature):
+        self._waterTemperature = temperature
 
-    # initially set all white background
-    image = Image.new('1', epd.size, WHITE)
-    width, height = image.size
+    def setGpsFix(self, fix):
+        self._gpsFix = fix
 
-    rowHeightTitles = 25
-    rowHeightValues = float(height - 2 * rowHeightTitles - 3 * marginVertical) / 2.0
-    columnWidthUnit = 30
-    columnWidthValues = int(float(width - 3 * marginHorizontal - 2 * columnWidthUnit) / 2.0)
+    def setValues(self, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix):
+        self.setSpeedThroughWater(speedThroughWater)
+        self.setSpeedOverGround(speedOverGround)
+        self.setWaterDepth(waterDepth)
+        self.setWaterTemperature(waterTemperature)
+        self.setGpsFix(gpsFix)
 
-    draw = ImageDraw.Draw(image)
-    # draw.rectangle((0, 0, width, height), fill=WHITE, outline=WHITE)
+    def stop(self):
+        self._running = False
 
-    x = marginHorizontal
-    y = marginVertical
-    draw.text((x, y), "STW", fill=BLACK, font=fontTitles)
-    if speedThroughWater is not None:
-      draw.text((x, y + rowHeightTitles), str(speedThroughWater), fill=BLACK, font=fontValues)
-    draw.text((x + columnWidthValues, y + rowHeightTitles * 1.4), "kts", fill=BLACK, font=fontTitles)
+    def run(self):
+        if not epdEnabled:
+            return
+        try:
+            while self._running:
+                self.displayValues(self._epd, self._speedThroughWater, self._speedOverGround,
+                                   self._waterDepth, self._waterTemperature, self._gpsFix)
+                time.sleep(self._updatePeriod)
+        except StopIteration:
+            pass
 
-    x = x + marginHorizontal + columnWidthValues + columnWidthUnit
-    draw.text((x, y), "SOG", fill=BLACK, font=fontTitles)
-    if speedOverGround is not None:
-      draw.text((x, y + rowHeightTitles), str(speedOverGround), fill=BLACK, font=fontValues)
-    draw.text((x + columnWidthValues, y + rowHeightTitles * 1.4), "kts", fill=BLACK, font=fontTitles)
+    def displayValues(epd, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix):
+        if not epdEnabled:
+            return
 
-    x = marginHorizontal
-    y = y + rowHeightTitles + rowHeightValues + marginVertical
-    draw.text((x, y), "Depth", fill=BLACK, font=fontTitles)
-    if waterDepth is not None:
-      draw.text((x, y + rowHeightTitles), str(waterDepth), fill=BLACK, font=fontValues)
-    draw.text((x + int(float(columnWidthValues) / 1.5), y + rowHeightTitles * 1.4), "m", fill=BLACK, font=fontTitles)
+        # requires dejavu package!!!!
+        fontValues = ImageFont.truetype(
+            '/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf', 34)
+        fontTitles = ImageFont.truetype(
+            '/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf', 24)
 
-    x = x + marginHorizontal + columnWidthValues + columnWidthUnit
-    draw.text((x, y), "Water", fill=BLACK, font=fontTitles)
-    if waterTemperature is not None:
-      draw.text((x, y + rowHeightTitles), str(waterTemperature), fill=BLACK, font=fontValues)
-    draw.text((x + int(float(columnWidthValues) / 1.5), y + rowHeightTitles * 1.4), "C", fill=BLACK, font=fontTitles)
+        # initially set all white background
+        image = Image.new('1', epd.size, WHITE)
+        width, height = image.size
 
-    x = int((x + marginHorizontal + columnWidthValues) * 0.93)
-    draw.text((x, y), "Fix", fill=BLACK, font=fontTitles)
-    if gpsFix is not None:
-      draw.text((x, y + rowHeightTitles), str(gpsFix), fill=BLACK, font=fontValues)
-  
-    epd.display(image)
-    epd.update()
+        rowHeightTitles = 25
+        rowHeightValues = float(
+            height - 2 * rowHeightTitles - 3 * marginVertical) / 2.0
+        columnWidthUnit = 30
+        columnWidthValues = int(
+            float(width - 3 * marginHorizontal - 2 * columnWidthUnit) / 2.0)
+
+        draw = ImageDraw.Draw(image)
+        # draw.rectangle((0, 0, width, height), fill=WHITE, outline=WHITE)
+
+        x = marginHorizontal
+        y = marginVertical
+        draw.text((x, y), "STW", fill=BLACK, font=fontTitles)
+        if speedThroughWater is not None:
+            draw.text(
+                (x, y + rowHeightTitles), str(speedThroughWater), fill=BLACK, font=fontValues)
+        draw.text((x + columnWidthValues, y + rowHeightTitles * 1.4),
+                  "kts", fill=BLACK, font=fontTitles)
+
+        x = x + marginHorizontal + columnWidthValues + columnWidthUnit
+        draw.text((x, y), "SOG", fill=BLACK, font=fontTitles)
+        if speedOverGround is not None:
+            draw.text((x, y + rowHeightTitles), str(speedOverGround),
+                      fill=BLACK, font=fontValues)
+        draw.text((x + columnWidthValues, y + rowHeightTitles * 1.4),
+                  "kts", fill=BLACK, font=fontTitles)
+
+        x = marginHorizontal
+        y = y + rowHeightTitles + rowHeightValues + marginVertical
+        draw.text((x, y), "Depth", fill=BLACK, font=fontTitles)
+        if waterDepth is not None:
+            draw.text(
+                (x, y + rowHeightTitles), str(waterDepth), fill=BLACK, font=fontValues)
+        draw.text((x + int(float(columnWidthValues) / 1.5),
+                   y + rowHeightTitles * 1.4), "m", fill=BLACK, font=fontTitles)
+
+        x = x + marginHorizontal + columnWidthValues + columnWidthUnit
+        draw.text((x, y), "Water", fill=BLACK, font=fontTitles)
+        if waterTemperature is not None:
+            draw.text(
+                (x, y + rowHeightTitles), str(waterTemperature), fill=BLACK, font=fontValues)
+        draw.text((x + int(float(columnWidthValues) / 1.5),
+                   y + rowHeightTitles * 1.4), "C", fill=BLACK, font=fontTitles)
+
+        x = int((x + marginHorizontal + columnWidthValues) * 0.93)
+        draw.text((x, y), "Fix", fill=BLACK, font=fontTitles)
+        if gpsFix is not None:
+            draw.text(
+                (x, y + rowHeightTitles), str(gpsFix), fill=BLACK, font=fontValues)
+
+        epd.display(image)
+        epd.update()
 
 if __name__ == "__main__":
Index: src/python/gnuboat/daemon/gpsdpoller.py
===================================================================
--- src/python/gnuboat/daemon/gpsdpoller.py	(revision 1efcac7b94f6aecc373de94bef5d21da1605b4cb)
+++ src/python/gnuboat/daemon/gpsdpoller.py	(revision 0e718778e4026c00b59eae819c6824bf65bba02d)
@@ -24,71 +24,74 @@
 
 # Copied from https://gist.github.com/wolfg1969/4653340
+
+
 class GpsdPoller(threading.Thread):
-  def __init__(self, logperiod):
-    threading.Thread.__init__(self)
-    try:
-      self._session = gps.gps(mode=gps.WATCH_ENABLE)
-    except:
-      self._session = None
-      self._running = False
-      return
-    self._currentValue = None
-    self._running = True
-    self._logperiod = logperiod
 
-  def latitude(self):
-    if self._session == None or self.gpsFix() < 2:
-      return 0
-    return self._session.fix.latitude
-   
-  def latitudeDirection(self):
-    return "N"
-   
-  def longitude(self):
-    if self._session == None or self.gpsFix() < 2:
-      return 0
-    return self._session.fix.longitude
+    def __init__(self, logperiod):
+        threading.Thread.__init__(self)
+        try:
+            self._session = gps.gps(mode=gps.WATCH_ENABLE)
+        except:
+            self._session = None
+            self._running = False
+            return
+        self._currentValue = None
+        self._running = True
+        self._logperiod = logperiod
 
-  def longitudeDirection(self):
-    return "E"
+    def latitude(self):
+        if self._session == None or self.gpsFix() < 2:
+            return 0
+        return self._session.fix.latitude
 
-  def speedOverGround(self):
-    if self._session == None or self.gpsFix() < 2:
-      return 0
-    return self._session.fix.speed
+    def latitudeDirection(self):
+        return "N"
 
-  def courseOverGround(self):
-    if self._session == None or self.gpsFix() < 2:
-      return 0
-    return self._session.fix.track
-   
-  def gpsFix(self):
-    if self._session == None:
-      return 0
-    return self._session.fix.mode
+    def longitude(self):
+        if self._session == None or self.gpsFix() < 2:
+            return 0
+        return self._session.fix.longitude
 
-  def status(self):
-    if self._session == None or self.gpsFix() < 2:
-      return "V"
-    return "A"
+    def longitudeDirection(self):
+        return "E"
 
-  def timeUtc(self):
-    if self._session == None or self.gpsFix() < 2:
-      return None
-    currentTime = self._session.fix.time
-    if isinstance(currentTime, float):
-      return datetime.datetime.fromtimestamp(currentTime)
-    return dateutil.parser.parse(self._session.fix.time)
+    def speedOverGround(self):
+        if self._session == None or self.gpsFix() < 2:
+            return 0
+        return self._session.fix.speed
 
-  def stop(self):
-    self._running = False
-   
-  def run(self):
-    try:
-      while self._running:
-        self._currentValue = self._session.next()
-        time.sleep(float(self._logperiod)/2.0)
-    except StopIteration:
-      pass
+    def courseOverGround(self):
+        if self._session == None or self.gpsFix() < 2:
+            return 0
+        return self._session.fix.track
+
+    def gpsFix(self):
+        if self._session == None:
+            return 0
+        return self._session.fix.mode
+
+    def status(self):
+        if self._session == None or self.gpsFix() < 2:
+            return "V"
+        return "A"
+
+    def timeUtc(self):
+        if self._session == None or self.gpsFix() < 2:
+            return None
+        currentTime = self._session.fix.time
+        if isinstance(currentTime, float):
+            return datetime.datetime.fromtimestamp(currentTime)
+        return dateutil.parser.parse(self._session.fix.time)
+
+    def stop(self):
+        self._running = False
+
+    def run(self):
+        try:
+            while self._running:
+                self._currentValue = self._session.next()
+                time.sleep(float(self._logperiod) / 2.0)
+        except StopIteration:
+            pass
 
 if __name__ == "__main__":
Index: src/python/gnuboat/daemon/n2kdpoller.py
===================================================================
--- src/python/gnuboat/daemon/n2kdpoller.py	(revision 1efcac7b94f6aecc373de94bef5d21da1605b4cb)
+++ src/python/gnuboat/daemon/n2kdpoller.py	(revision 0e718778e4026c00b59eae819c6824bf65bba02d)
@@ -24,107 +24,112 @@
 """@class N2kdPoller
 """
+
+
 class N2kdPoller(threading.Thread):
-  def __init__(self, logperiod):
-    threading.Thread.__init__(self)
-    self._serverHost = "127.0.0.1"
-    self._serverPort = 2597
-    self._timeout = 1.5
-    self._speedThroughWater = 0
-    self._distanceLog = 0
-    self._distanceLogTrip = 0
-    self._waterDepth = 0
-    self._waterDepthValid = False
-    self._waterTemperature = 0
-    self._running = True
-    self._logperiod = logperiod
-    self._connectErrorPrinted = False
 
-  def speedThroughWater(self):
-    return self._speedThroughWater
-   
-  def distanceLog(self):
-    return self._distanceLog
+    def __init__(self, logperiod):
+        threading.Thread.__init__(self)
+        self._serverHost = "127.0.0.1"
+        self._serverPort = 2597
+        self._timeout = 1.5
+        self._speedThroughWater = 0
+        self._distanceLog = 0
+        self._distanceLogTrip = 0
+        self._waterDepth = 0
+        self._waterDepthValid = False
+        self._waterTemperature = 0
+        self._running = True
+        self._logperiod = logperiod
+        self._connectErrorPrinted = False
 
-  def distanceLogTrip(self):
-    return self._distanceLogTrip
+    def speedThroughWater(self):
+        return self._speedThroughWater
 
-  def waterDepth(self):
-    return self._waterDepth
+    def distanceLog(self):
+        return self._distanceLog
 
-  def waterDepthValid(self):
-    return self._waterDepthValid
-   
-  def waterTemperature(self):
-    return self._waterTemperature
+    def distanceLogTrip(self):
+        return self._distanceLogTrip
 
-  def _loadData(self):
-    n2kdSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-    n2kdSocket.settimeout(float(self._logperiod)/2.0)
-    try:
-      n2kdSocket.connect((self._serverHost, self._serverPort))
-    except socket.error as error:
-      if not self._connectErrorPrinted:
-        print "Failed to connect to n2kd server at %s:%s: %s" % (self._serverHost, self._serverPort, error)
-        self._connectErrorPrinted = True
-      self._waterDepthValid = False
-      return
-    if self._connectErrorPrinted:
-      print "Connected to n2kd server at %s:%s: %s" % (self._serverHost, self._serverPort, error)
-      self._connectErrorPrinted = False
+    def waterDepth(self):
+        return self._waterDepth
 
-    response = ""
-    while 1:
-      data = n2kdSocket.recv(1024)
-      if not data:
-        break
-      response += data
-    n2kdSocket.close()
-    data = json.loads(response)
-    
-    descriptions = [ "Water Depth", "Speed", "Environmental Parameters", "Distance Log" ]
-    
-    for key in data:
-      entryKeys = data[key].keys()
-      if len(entryKeys) != 2:
-        print "Malformed json n2kd response? %s" % response
-      else:
-        if data[key]["description"] in descriptions:
-          entryKey = entryKeys[1]
-          lineKeys = data[key][entryKey].keys()
-          if "fields" not in lineKeys:
-            print "No fields entry. Malformed json n2kd response in %s" % data[key][entryKey]
-          else:
-            fields = data[key][entryKey]["fields"]
-            # try water depth (NEED TO APPLY OFFSET?)
-            if "Depth" in fields:
-              if data[key][entryKey]["description"] == "Water Depth":
-                self._waterDepth = fields["Depth"]
-                self._waterDepthValid = True
-            # try speed
-            if "Speed Water Referenced" in fields:
-              self._speedThroughWater = fields["Speed Water Referenced"]
-            # try sea temperature
-            if "Temperature Source" in fields and "Temperature" in fields:
-              if fields["Temperature Source"] == "Sea Temperature":
-                self._waterTemperature = fields["Temperature"]
-            # try log
-            if "Log" in fields:
-              self._distanceLog = fields["Log"]
-            if "Trip Log" in fields:
-              self._distanceLogTrip = fields["Trip Log"]
-              
-  def _serverUrl(self):
-    return "http://%s:%d/" % (self._serverHost, self._serverPort)
-   
-  def stop(self):
-    self._running = False
-   
-  def run(self):
-    try:
-      while self._running:
-        self._loadData()
-        time.sleep(float(self._logperiod)/2.0)
-    except StopIteration:
-      pass
+    def waterDepthValid(self):
+        return self._waterDepthValid
+
+    def waterTemperature(self):
+        return self._waterTemperature
+
+    def _loadData(self):
+        n2kdSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+        n2kdSocket.settimeout(float(self._logperiod) / 2.0)
+        try:
+            n2kdSocket.connect((self._serverHost, self._serverPort))
+        except socket.error as error:
+            if not self._connectErrorPrinted:
+                print "Failed to connect to n2kd server at %s:%s: %s" % (self._serverHost, self._serverPort, error)
+                self._connectErrorPrinted = True
+            self._waterDepthValid = False
+            return
+        if self._connectErrorPrinted:
+            print "Connected to n2kd server at %s:%s: %s" % (self._serverHost, self._serverPort, error)
+            self._connectErrorPrinted = False
+
+        response = ""
+        while 1:
+            data = n2kdSocket.recv(1024)
+            if not data:
+                break
+            response += data
+        n2kdSocket.close()
+        data = json.loads(response)
+
+        descriptions = [
+            "Water Depth", "Speed", "Environmental Parameters", "Distance Log"]
+
+        for key in data:
+            entryKeys = data[key].keys()
+            if len(entryKeys) != 2:
+                print "Malformed json n2kd response? %s" % response
+            else:
+                if data[key]["description"] in descriptions:
+                    entryKey = entryKeys[1]
+                    lineKeys = data[key][entryKey].keys()
+                    if "fields" not in lineKeys:
+                        print "No fields entry. Malformed json n2kd response in %s" % data[key][entryKey]
+                    else:
+                        fields = data[key][entryKey]["fields"]
+                        # try water depth (NEED TO APPLY OFFSET?)
+                        if "Depth" in fields:
+                            if data[key][entryKey]["description"] == "Water Depth":
+                                self._waterDepth = fields["Depth"]
+                                self._waterDepthValid = True
+                        # try speed
+                        if "Speed Water Referenced" in fields:
+                            self._speedThroughWater = fields[
+                                "Speed Water Referenced"]
+                        # try sea temperature
+                        if "Temperature Source" in fields and "Temperature" in fields:
+                            if fields["Temperature Source"] == "Sea Temperature":
+                                self._waterTemperature = fields["Temperature"]
+                        # try log
+                        if "Log" in fields:
+                            self._distanceLog = fields["Log"]
+                        if "Trip Log" in fields:
+                            self._distanceLogTrip = fields["Trip Log"]
+
+    def _serverUrl(self):
+        return "http://%s:%d/" % (self._serverHost, self._serverPort)
+
+    def stop(self):
+        self._running = False
+
+    def run(self):
+        try:
+            while self._running:
+                self._loadData()
+                time.sleep(float(self._logperiod) / 2.0)
+        except StopIteration:
+            pass
 
 if __name__ == "__main__":
