Index: src/python/bin/gnuboat
===================================================================
--- src/python/bin/gnuboat	(revision 314564843681c74c65353f2bb7cb95c4a5955d6f)
+++ src/python/bin/gnuboat	(revision 9773514b63fb306019a818c5730c59df5355ba58)
@@ -67,18 +67,4 @@
         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 "  -lv --log-verbose       Log verbose information to nmea log file (Enables -ls and adds RMC sentences, with invalid GPS state, on non fixes"
-    print "  -ls --log-system-time   Add to enable prefixing every logline with the system time (Default off)"
-    print "  -d  --displayperiod     Timein seconds to update the display"
-    print "  -o  --output            Directory where the log files are stored (e.g. the NMEA0183 log files)"
 
 def log(gpsFix, gpsTime, gpsStatus, latitude, latitudeDirection, longitude,
@@ -104,8 +90,8 @@
         try:
             nmeaFileDate = nmeaFileDateShould
-            nmeaLogFile = "nmea0183-%s.log" % nmeaFileDate
-            nmeafile = open("%s/%s" % (logdir, nmeaLogFile), 'a', 0)
+            nmeaLogFile = 'nmea0183-{}.log'.format(nmeaFileDate)
+            nmeafile = open('{}/{}'.format(logdir, nmeaLogFile), 'a', 0)
         except IOError as error:
-            print "Could not open the logfile: %s" % error
+            print('Could not open the logfile: {}'.format(error))
             sys.exit(2)
 
@@ -115,20 +101,20 @@
     logsystemtime = ""
     if logsystemtime:
-        logsystemtime = "%s:" datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S")
+        logsystemtime = '{}: '.format(datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S"))
         
     try:
-        nmeafile.write("%s%s\r\n" % (logsystemtime, str(pynmea2.RMC('GN', 'RMC',
+        nmeafile.write('{}{}\r\n'.format(logsystemtime, str(pynmea2.RMC('GN', 'RMC',
                                                      (gpsTime.strftime("%H%M%S"), gpsStatus,
-                                                     '%02d%s' % (latitude['degrees'], latitude['minutes'])
+                                                     '{:02d}{:s}'.format(latitude['degrees'], latitude['minutes']),
                                                      latitudeDirection,
-                                                     '%03d%s' % (longitude['degrees'], longitude['minutes']),
+                                                     '{:03d}{:s}'.format(longitude['degrees'], longitude['minutes']),
                                                      longitudeDirection,
-                                                     '%04.1f' % speedOverGround, '%04.1f' % courseOverGround,
+                                                     '{:04.1f}'.format(speedOverGround), '{:04.1f}'.format(courseOverGround),
                                                      gpsTime.strftime("%d%m%y"), '', '', mode)))))
         if transducerValid:
-            nmeafile.write("%s%s\r\n" % (logsystemtime, str(pynmea2.DPT('SD', 'DPT', ('%05.2f' % waterDepth, '00.00')))))
-            nmeafile.write("%s%s\r\n" % (logsystemtime, str(pynmea2.MTW('YX', 'MTW', ('%04.1f' % waterTemperature, 'C')))))
+            nmeafile.write('{}{}\r\n'.format(logsystemtime, str(pynmea2.DPT('SD', 'DPT', ('{:05.2f}'.format(waterDepth, '00.00'))))))
+            nmeafile.write('{}{}\r\n'.format(logsystemtime, str(pynmea2.MTW('YX', 'MTW', ('{:04.1f}'.format(waterTemperature, 'C'))))))
     except:
-        print "Failed writing to logfile %s" % nmeaLogFile
+        print('Failed writing to logfile {}'.format(nmeaLogFile))
         print(traceback.format_exc())
 
@@ -148,5 +134,5 @@
     global nmeafile
 
-    parser = argparse.ArgumentParser(description="Collects the data from canboat and gpsd and writes them to the rrd database and the nmea log file")
+    parser = argparse.ArgumentParser(description='Collects the data from canboat and gpsd and writes them to the rrd database and the nmea log file')
     parser.add_argument('-r', '--rrdfile', dest='rrd_file', metavar='rrd_file', type=str,
                         help='Path to the rrd database used by the webservice to serve the clients', default=rrdfile)
@@ -182,25 +168,21 @@
 
     if not os.path.exists(os.path.dirname(rrdfile)):
-        print "rrd database directory not found %s" % os.path.dirname(rrdfile)
-        print ""
-        usage()
+        print('rrd database directory not found {}'.format(os.path.dirname(rrdfile)))
+        parser.print_help()
         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()
+        print('Shutdown request directory not found {}'.format(os.path.dirname(shutdownfile)))
+        parser.print_help()
         sys.exit(2)
 
     if logperiod < 1:
-        print "Log period must be >= 1"
-        print ""
-        usage()
+        print('Log period must be >= 1')
+        parser.print_help()
         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()
+        print('Display period must be >= 1 and could not be faster than log period')
+        parser.print_help()
         sys.exit(2)
 
@@ -231,5 +213,5 @@
 
             # update rrd database for the webservice
-            daemon.rrd_update(rrdfile, "N:%s:%s:%s:%s:%s:%s:%s:%s" % (
+            daemon.rrd_update(rrdfile, 'N:{:s}:{:s}:{:s}:{:s}:{:s}:{:s}:{:s}:{:s}'.format(
                 latitude, longitude, speedThroughWater, speedOverGround, courseOverGround, waterDepth, waterTemperature, gpsFix))
 
Index: src/python/bin/gnuboat-data-generator
===================================================================
--- src/python/bin/gnuboat-data-generator	(revision 314564843681c74c65353f2bb7cb95c4a5955d6f)
+++ src/python/bin/gnuboat-data-generator	(revision 9773514b63fb306019a818c5730c59df5355ba58)
@@ -46,5 +46,5 @@
     global logperiod
 
-    parser = argparse.ArgumentParser(description="Generates test data for gnuboat webservice and fills the rrd database")
+    parser = argparse.ArgumentParser(description='Generates test data for gnuboat webservice and fills the rrd database')
     parser.add_argument('-f', '--file', dest='rrd_database', metavar='rrd_database', type=str,
                         help='File path of the rrd database to fill', default="/var/lib/gnuboat/gnuboat.rrd")
@@ -78,6 +78,5 @@
 
     if not os.path.exists(os.path.dirname(rrdfile)):
-        print "rrd database directory not found %s" % os.path.dirname(rrdfile)
-        print ""
+        print('rrd database directory not found {}'.format(os.path.dirname(rrdfile)))
         parser.print_help()
         sys.exit(2)
@@ -87,11 +86,11 @@
         
     if os.path.isfile(rrdfile):
-        print "Removing old database %s" % rrdfile
+        print('Removing old database {}'.format(rrdfile))
         os.remove(rrdfile)
 
-    print "Creating %s" % rrdfile
+    print('Creating {}'.format(rrdfile))
     daemon.rrd_create_database(rrdfile, logperiod, str(start_time))
     
-    print "Filling database inside [%s, %s] --> [%s,%s]..." % (latitude_min, longitude_min, latitude_max, longitude_max)
+    print('Filling database inside [{}, {}] --> [{}, {}]...'.format(latitude_min, longitude_min, latitude_max, longitude_max))
     for current_time in xrange(timestamp - duration, timestamp, logperiod):
         latitude = random.uniform(latitude_min, latitude_max)
@@ -104,5 +103,5 @@
         gpsFix = 3
         # update rrd database for the webservice
-        daemon.rrd_update(rrdfile, "%s:%s:%s:%s:%s:%s:%s:%s:%s" % (
+        daemon.rrd_update(rrdfile, '{:s}:{:s}:{:s}:{:s}:{:s}:{:s}:{:s}:{:s}:{:s}'.format(
                        current_time, latitude, longitude, speedThroughWater, speedOverGround, courseOverGround, waterDepth, waterTemperature, gpsFix))
 
Index: src/python/bin/gnuboat-log-converter
===================================================================
--- src/python/bin/gnuboat-log-converter	(revision 314564843681c74c65353f2bb7cb95c4a5955d6f)
+++ src/python/bin/gnuboat-log-converter	(revision 9773514b63fb306019a818c5730c59df5355ba58)
@@ -43,5 +43,5 @@
            return int(string)
         except ValueError as error:
-           print 'INFO: Failed to convert value from line %s into numeric: %s\n      Message: %s' % (current_row, string, error)
+           print('INFO: Failed to convert value from line %s into numeric: {:s}\n      Message: {:s}'.format(current_row, string, error))
            return 0
 
@@ -54,5 +54,5 @@
     matches = regex_nmea_position.match(nmea_value)
     if matches is None:
-        print 'INFO: Failed to convert position value from line %s into decimal degrees: %s' % (current_row, nmea_value)
+        print('INFO: Failed to convert position value from line {:s} into decimal degrees: {:s}'.format(current_row, nmea_value))
         return
     decimalDegrees = toFloat(matches.group(1), current_row)
@@ -66,5 +66,5 @@
         output_file = open(output_file_path, 'w', 0)
     except IOError as error:
-        print "ERROR: Could not open the output file: %s" % error
+        print('ERROR: Could not open the output file: {}'.format(error))
         sys.exit(3)
 
@@ -81,5 +81,5 @@
         input_file = open(input_file_path, 'r')
     except IOError as error:
-        print "ERROR: Could not open the input file: %s" % error
+        print('ERROR: Could not open the input file: {}'.format(error))
         sys.exit(3)
     current_row = 1
@@ -89,5 +89,5 @@
         matches = regex_nmea_sentence.match(line)
         if matches is None:
-            print 'INFO: Failed to parse nmea sentence (%s) at line %s\n' % (line, current_row)
+            print('INFO: Failed to parse nmea sentence ({}) at line {}\n'.format(line, current_row))
             if not errors_ignore:
                 input_file.close()
@@ -99,5 +99,5 @@
                 if last_row is not None:
                     output_file_csv.writerow(last_row)
-                last_row = {'datetime': '%s %s' % (nmea_sentence.datestamp, nmea_sentence.timestamp),
+                last_row = {'datetime': '{} {}'.format(nmea_sentence.datestamp, nmea_sentence.timestamp),
                             'gps_status': nmea_sentence.status,
                             'latitude': nmeaToDecimalDegrees(nmea_sentence.lat, current_row),
@@ -125,5 +125,5 @@
         output_file = open(output_file_path, 'w', 0)
     except IOError as error:
-        print "ERROR: Could not open the output file: %s" % error
+        print('ERROR: Could not open the output file: {}'.format(error))
         sys.exit(3)
 
@@ -132,5 +132,5 @@
         input_file = open(input_file_path, 'r')
     except IOError as error:
-        print "ERROR: Could not open the input file: %s" % error
+        print('ERROR: Could not open the input file: {}'.format(error))
         sys.exit(3)
     current_row = 1
@@ -140,5 +140,5 @@
         matches = regex_nmea_sentence.match(line)
         if matches is None:
-            print 'INFO: Failed to parse nmea sentence (%s) at line %s\n' % (line, current_row)
+            print('INFO: Failed to parse nmea sentence ({}) at line {}\n'.format(line, current_row))
             if not errors_ignore:
                 input_file.close()
@@ -149,6 +149,6 @@
             output_string = str(nmea_sentence)
             if not strip_time and matches.group(1):
-                output_string = '%s%s' % (matches.group(1), output_string) 
-            output_file.write("%s\r\n" % str(output_string))
+                output_string = '{}{}'.format(matches.group(1), output_string)
+            output_file.write('{}\r\n'.format(str(output_string)))
     output_file.close()
     input_file.close()
@@ -177,5 +177,5 @@
       formats.append(file_format.name)
 
-    parser = argparse.ArgumentParser(description="Convert gnuboat logfiles into other formats")
+    parser = argparse.ArgumentParser(description='Convert gnuboat logfiles into other formats')
     parser.add_argument('-f', '--format', dest='output_format', metavar='output_format', type=str,
                         help='Format of the output file.', choices=formats, default='CSV')
@@ -197,5 +197,5 @@
                format_found = True
         if not format_found:
-            print 'ERROR: Invalid input format specified: %s' % arguments.output_format
+            print('ERROR: Invalid input format specified: {}'.format(arguments.output_format))
             sys.exit(1)
 
@@ -207,8 +207,8 @@
             
     if arguments.input_file is None:
-        print 'ERROR: No input file specified'
+        print('ERROR: No input file specified')
         sys.exit(2)
     elif not os.path.exists(arguments.input_file):
-        print 'ERROR: Specified input file does not exists: %s' % arguments.input_file
+        print('ERROR: Specified input file does not exists: {}'.format(arguments.input_file))
         sys.exit(3)
     else:
@@ -216,8 +216,8 @@
         
     if arguments.output_file is None:
-        print 'ERROR: No output file specified'
+        print('ERROR: No output file specified')
         sys.exit(2)
     elif not os.path.exists(os.path.dirname(arguments.output_file)):
-        print 'ERROR: Specified directory of output file does not exists: %s' % arguments.output_file
+        print('ERROR: Specified directory of output file does not exists: {}'.format(arguments.output_file))
         sys.exit(3)
     else:
@@ -231,5 +231,5 @@
         convertToGpx(input_file_path, output_file_path, errors_ignore, strip_time)
     else:
-        print "ERROR: Undefined output format!\n";
+        print('ERROR: Undefined output format!\n')
         sys.exit(1)
 
Index: src/python/bin/gnuboat-splashscreen
===================================================================
--- src/python/bin/gnuboat-splashscreen	(revision 314564843681c74c65353f2bb7cb95c4a5955d6f)
+++ src/python/bin/gnuboat-splashscreen	(revision 9773514b63fb306019a818c5730c59df5355ba58)
@@ -39,9 +39,9 @@
 
 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"
+    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()
 
@@ -65,11 +65,10 @@
 
     if not os.path.exists(image):
-        print "Image %s not found" % image
-        print ""
+        print("Image {} not found".format(image))
         usage()
         sys.exit(2)
 
     if not epdEnabled:
-        print "Could not initialize EPD or PIL python packages"
+        print("Could not initialize EPD or PIL python packages")
         sys.exit(2)
 
Index: src/python/gnuboat/daemon/gpsdpoller.py
===================================================================
--- src/python/gnuboat/daemon/gpsdpoller.py	(revision 314564843681c74c65353f2bb7cb95c4a5955d6f)
+++ src/python/gnuboat/daemon/gpsdpoller.py	(revision 9773514b63fb306019a818c5730c59df5355ba58)
@@ -31,10 +31,6 @@
     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._session = None
+        self._session = None
         self._currentValue = None
         self._running = True
@@ -47,5 +43,5 @@
 
     def latitudeDirection(self):
-        return "N"
+        return 'N'
 
     def longitude(self):
@@ -55,5 +51,5 @@
 
     def longitudeDirection(self):
-        return "E"
+        return 'E'
 
     def speedOverGround(self):
@@ -74,6 +70,6 @@
     def status(self):
         if self._currentValue == None or self.gpsFix() < 2:
-            return "V"
-        return "A"
+            return 'V'
+        return 'A'
 
     def timeUtc(self):
@@ -92,11 +88,14 @@
             while self._running:
                 try:
+                    if self._session is None:
+                        self._session = gps.gps(mode=gps.WATCH_ENABLE)
                     self._currentValue = self._session.next()
                 except StopIteration:
-                    break;
+                    break
                 except:
-                    print "Failed to read gpsd data"
+                    print('Failed to read gpsd data')
                     print(traceback.format_exc())
                     self._currentValue = None
+                    self._session = None
         except StopIteration:
             pass
Index: src/python/gnuboat/daemon/n2kdpoller.py
===================================================================
--- src/python/gnuboat/daemon/n2kdpoller.py	(revision 314564843681c74c65353f2bb7cb95c4a5955d6f)
+++ src/python/gnuboat/daemon/n2kdpoller.py	(revision 9773514b63fb306019a818c5730c59df5355ba58)
@@ -69,10 +69,10 @@
         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)
+                print('Failed to connect to n2kd server at {}:{}: {}'.format(self._serverHost, self._serverPort, error))
                 self._connectErrorPrinted = True
             self._waterDepthValid = False
             return
         if self._connectErrorPrinted:
-            print "Connected to n2kd server at %s:%s" % (self._serverHost, self._serverPort)
+            print('Connected to n2kd server at {}:{}'.format(self._serverHost, self._serverPort))
             self._connectErrorPrinted = False
 
@@ -82,5 +82,5 @@
                 data = n2kdSocket.recv(1024)
             except:
-                print "Failed to update n2kd data"
+                print('Failed to update n2kd data')
                 print(traceback.format_exc())
                 self._waterDepthValid = False
@@ -92,5 +92,5 @@
             data = json.loads(response)
         except ValueError as error:
-            print "Failed to decode json: %s" % error
+            print('Failed to decode json: {}'.format(error))
 
         descriptions = [
@@ -100,5 +100,5 @@
             entryKeys = data[key].keys()
             if len(entryKeys) != 2:
-                print "Malformed json n2kd response? %s" % response
+                print('Malformed json n2kd response? {}'.format(response))
             else:
                 if data[key]["description"] in descriptions:
@@ -106,5 +106,5 @@
                     lineKeys = data[key][entryKey].keys()
                     if "fields" not in lineKeys:
-                        print "No fields entry. Malformed json n2kd response in %s" % data[key][entryKey]
+                        print('No fields entry. Malformed json n2kd response in {}'.format(data[key][entryKey]))
                     else:
                         fields = data[key][entryKey]["fields"]
@@ -116,6 +116,5 @@
                         # try speed
                         if "Speed Water Referenced" in fields:
-                            self._speedThroughWater = fields[
-                                "Speed Water Referenced"]
+                            self._speedThroughWater = fields["Speed Water Referenced"]
                         # try sea temperature
                         if "Temperature Source" in fields and "Temperature" in fields:
@@ -129,5 +128,5 @@
 
     def _serverUrl(self):
-        return "http://%s:%d/" % (self._serverHost, self._serverPort)
+        return 'http://{}:{:d}/'.format(self._serverHost, self._serverPort)
 
     def stop(self):
Index: src/python/gnuboat/daemon/rrdhandler.py
===================================================================
--- src/python/gnuboat/daemon/rrdhandler.py	(revision 314564843681c74c65353f2bb7cb95c4a5955d6f)
+++ src/python/gnuboat/daemon/rrdhandler.py	(revision 9773514b63fb306019a818c5730c59df5355ba58)
@@ -40,5 +40,5 @@
     rrd_archives = []
     for i in range(0, len(archives)):
-        rrd_archives += ['RRA:AVERAGE:0.5:%d:%d' % (_steps(archives[i]["resolution"], step), _rows(
+        rrd_archives += ['RRA:AVERAGE:0.5:{:d}:{:d}'.format(_steps(archives[i]["resolution"], step), _rows(
         archives[i]["duration"], archives[i]["resolution"], step))]
 
@@ -56,5 +56,5 @@
         rrdtool.update(rrdfile, value_string)
     except:
-        print "Failed to update rrd database %s with values\n  %s" % (rrdfile, value_string)
+        print('Failed to update rrd database {} with values\n  {}'.format(rrdfile, value_string))
         print(traceback.format_exc())
 
