Index: src/daemon/gnuboat
===================================================================
--- src/daemon/gnuboat	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/daemon/gnuboat	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -31,8 +31,13 @@
 import getopt
 import sys
-from EPD import EPD
-from PIL import Image
-from PIL import ImageDraw
-from PIL import ImageFont
+
+try:
+  from EPD import EPD
+  from PIL import Image
+  from PIL import ImageDraw
+  from PIL import ImageFont
+  epdEnabled = True
+except:
+  epdEnabled = False
 
 WHITE=1
@@ -42,5 +47,5 @@
 
 # default values for command line arguments
-rrdfile = "/var/www/html/webservice/data/log-webservice.rrd"
+rrdfile = "/usr/share/gnuboat/webservice/data/log-webservice.rrd"
 shutdownfile = "/var/spool/gnuboat/shutdown.request"
 logperiod = 1
@@ -48,4 +53,11 @@
 
 shutdownRequested = None
+latitude = None
+longitude = None
+speedThroughWater = None
+speedOverGround = None
+waterDepth = None
+waterTemperature = None
+gpsFix = None
 
 # Copied from https://gist.github.com/wolfg1969/4653340
@@ -81,4 +93,87 @@
       pass
 
+"""@class DisplayHandler
+"""
+class DisplayHandler(threading.Thread):
+  def __init__(self, displayperiod):
+    threading.Thread.__init__(self)
+    self._epd = EPD()
+    self._epd.clear()
+    self._updatePeriod = displayperiod
+    self._running = True
+    
+  def stop(self):
+    self._running = False
+    
+  def run(self):
+    global latitude
+    global longitude
+    global speedThroughWater
+    global speedOverGround
+    global waterDepth
+    global waterTemperature
+    global gpsFix
+
+    try:
+      while self._running:
+        self.displayValues(epd, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix)
+        time.sleep(self._updatePeriod)
+    except StopIteration:
+      pass
+
+  def displayValues(epd, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix):
+    if not epdEnabled:
+      return
+
+    # 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)
+
+    # initially set all white background
+    image = Image.new('1', epd.size, WHITE)
+    width, height = image.size
+
+    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()
+
 def createDatabase(databaseFile):
   rrdDataSources = [ 'DS:latitude:GAUGE:15:-90:90',
@@ -104,50 +199,4 @@
                    rrdDataSources,
                    rrdArchives)
-
-def displayValues(epd, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix):
-  # 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)
-
-  # initially set all white background
-  image = Image.new('1', epd.size, WHITE)
-  width, height = image.size
-
-  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)
-  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)
-  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)
-  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)
-  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)
-  draw.text((x, y + rowHeightTitles), str(gpsFix), fill=BLACK, font=fontValues)
-  
-  epd.display(image)
-  epd.update()
 
 def checkShutdownRequest(shutdownFile):
@@ -181,4 +230,11 @@
   global logperiod
   global displayperiod
+  global latitude
+  global longitude
+  global speedThroughWater
+  global speedOverGround
+  global waterDepth
+  global waterTemperature
+  global gpsFix
 
   try:                                
@@ -229,6 +285,7 @@
   createDatabase(rrdfile)
 
-  epd = EPD()
-  epd.clear()
+  displayHandler = None
+  if epdEnabled:
+    displayHandler = DisplayHandler(displayperiod)
 
   gpsp = GpsdPoller()
@@ -249,7 +306,4 @@
       # update rrd database for the webservice
       rrdtool.update(rrdfile, "N:%s:%s:%s:%s:%s:%s:%s" % (latitude, longitude, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix))
-      # update display, if needed
-      if round(time.time(),0) % displayperiod == 0:
-        displayValues(epd, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix)
       #check for shutdown request
       checkShutdownRequest(shutdownfile)
@@ -258,4 +312,7 @@
     gpsp.stop()
     gpsp.join() # wait for the thread to finish what it's doing
+    if displayHandler is not None:
+      displayHandler.stop()
+      displayHandler.join() # wait for the thread to finish what it's doing
 
 if __name__ == "__main__":
Index: src/daemon/gnuboat.service
===================================================================
--- src/daemon/gnuboat.service	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
+++ src/daemon/gnuboat.service	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -0,0 +1,16 @@
+[Unit]
+Description=GNUBoat logging service
+After=epd-fuse
+After=gpsd
+
+[Service]
+Type=simple
+User=root
+Group=root
+WorkingDirectory=/tmp
+ExecStart=/usr/bin/gnuboat -r /usr/share/gnuboat/webservice/data/gnuboat.rrd -s /var/spool/gnuboat/shutdown.request
+StandardOutput=syslog
+StandardError=syslog
+
+[Install]
+WantedBy=multi-user.target
Index: src/webapp/build.xml
===================================================================
--- src/webapp/build.xml	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/webapp/build.xml	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -16,4 +16,7 @@
 		<fileset dir="./webclient/javascript" id="filesJavascript"/>
 		<fileset dir="./webclient/resources" id="filesResources"/>
+		<fileset dir="../icon/" id="filesGnuboatIcons">
+			<include name="gnuboat-256-256-transparent.png"/>
+		</fileset>
 
 		<copy todir="${builddir}/webclient">
@@ -28,8 +31,11 @@
 		<copy todir="${builddir}/webclient/resources">
 			<fileset refid="filesResources"/>
+			<fileset refid="filesGnuboatIcons"/>
 		</copy>
 	</target>
 	<target name="buildwebservice" depends="prepare">
-		<fileset dir="./webservice" id="filesWebservice"/>
+		<fileset dir="./webservice" id="filesWebservice">
+			<exclude name="mbtiles/*"/>
+		</fileset>
 		<fileset dir="./webservice/mbtiles" id="filesWebserviceMaps">
 			<!-- <exclude name=""/> -->
Index: src/webapp/test/gpsfake.log
===================================================================
--- src/webapp/test/gpsfake.log	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
+++ src/webapp/test/gpsfake.log	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -0,0 +1,9 @@
+$PMGNST,05.40,2,T,961,08.3,+04583,00*4C
+$GPGLL,4734.0000,N,01042.0000,E,125412.480,A*3A
+$GPGGA,125412.48,4734.0000,N,01042.0000,E,2,04,20.5,00269,M,,,,*12
+$GPRMC,125412.48,A,4734.0000,N,01042.0000,E,00.0,000.0,230506,00,E*4A
+$GPGSA,A,2,27,04,08,24,,,,,,,,,20.5,20.5,*12
+$GPGSV,3,1,10,13,81,052,,04,58,240,39,23,44,064,,24,43,188,36*75
+$GPGSV,3,2,10,02,42,295,,27,34,177,40,20,21,113,,16,12,058,*7F
+$GPGSV,3,3,10,08,07,189,38,10,05,293,,131,11,117,,120,28,209,*76
+$GPRMC,125412.48,A,4734.0000,N,01042.0000,E,00.0,000.0,230506,00,E*4A
Index: src/webapp/webclient/css/main.css
===================================================================
--- src/webapp/webclient/css/main.css	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/webapp/webclient/css/main.css	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -18,5 +18,6 @@
 body {
 	margin: 1em;
-	width: 58.3mm;
+	width: 14em;
+	border-color: 1px solid black;
 }
 
@@ -24,4 +25,9 @@
 	background-color: #93C0C0;
 	background-image: linear-gradient(#BCD9D9, #93C0C0);
+}
+
+.backgroundgreen {
+	background-color: #ACDFAC;
+	background-image: linear-gradient(#CCECCC, #ACDFAC);
 }
 
@@ -34,8 +40,17 @@
 }
 
+#title img {
+	height: 2em;
+	width: auto;
+	vertical-align: middle;
+	margin: 0.1em;
+	padding-left: 0em;
+	margin-left: -0.3em;
+}
+
 #display {
 	background-color: #E6E6E6;
 	width: 100%;
-	height: 38.2mm;
+	height: 9em;
 	font-size: 12pt;
 	font-weight: normal;
@@ -61,6 +76,6 @@
 #display #speedthroughwater {
 	position: absolute;
-	top: 2mm;
-	left: 2mm;
+	top: 0.5em;
+	left: 0.5em;
 }
 
@@ -72,29 +87,29 @@
 #display #speedoverground {
 	position: absolute;
-	top: 2mm;
-	left: 30mm;
+	top:  0.5em;
+	left: 7em;
 }
 
 #display #waterdepth {
 	position: absolute;
-	top: 21mm;
-	left: 2mm;
+	top: 5em;
+	left: 0.5em;
+}
+
+#display #watertemperature {
+	position: absolute;
+	top: 5em;
+	left: 7em;
 }
 
 #display #gpsfix {
 	position: absolute;
-	top: 21mm;
-	left: 46mm;
-}
-
-#display #watertemperature {
-	position: absolute;
-	top: 21mm;
-	left: 30mm;
+	top: 5em;
+	left: 11em;
 }
 
 #map {
 	width: 100%;
-	height: 76mm;
+	height: 24em;
 	border: 1px solid black;
 	margin-top: 1em;
@@ -105,7 +120,15 @@
 }
 
+form h2 {
+	text-align: center;
+	margin-top: 2em;
+	margin-bottom: 0.5em;
+	padding-top: 0.6em;
+	height: 2em;
+}
+
 form p {
-	margin-top: 1em;
 	height: 3em;
+	margin: 0em;
 }
 
@@ -114,9 +137,11 @@
 	height: 3em;
 	width: 100%;
+	font-weight: normal;
+	margin-top: 1em;
 }
 
 .formButtons {
 	text-align: center;
-	margin-top: 2em;
+	margin-top: 3em;
 }
 
Index: src/webapp/webclient/javascript/main.js
===================================================================
--- src/webapp/webclient/javascript/main.js	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/webapp/webclient/javascript/main.js	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -38,8 +38,9 @@
 			var value = lastValid[key];
 			if($.isNumeric(value)){
+				var text = value.toFixed(1);
 				if(key == "watertemperature"){
-					value = Math.round(value);
+					text = value.toFixed(0);
 				}
-				$("#display #"+ keys[i] +" #value").text(value.toString());
+				$("#display #"+ keys[i] +" #value").text(text);
 			}
 			else if(key == "gpsfix"){
Index: src/webapp/webclient/root/inc/header.php
===================================================================
--- src/webapp/webclient/root/inc/header.php	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/webapp/webclient/root/inc/header.php	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -37,6 +37,7 @@
 	<!DOCTYPE HTML>
 	<html>
-		<head>
+		<head profile="http://www.w3.org/2005/10/profile">
 			<meta charset="utf-8"/>
+			<link rel="icon" type="image/png" href="resources/gnuboat-256-256-transparent.png"/>
 			<title>GNUBoat <?php echo (empty($headerTitle)) ? "" : " - ". $headerTitle; ?></title>
 			<link rel="stylesheet" href="css/main.css" type="text/css"/>
Index: src/webapp/webclient/root/index.php
===================================================================
--- src/webapp/webclient/root/index.php	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/webapp/webclient/root/index.php	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -65,5 +65,5 @@
 require_once("inc/header.php");
 ?>
-	<h2 id="title" class="backgroundblue">GNUBoat</h2>
+	<h2 id="title" class="backgroundblue"><img src="resources/gnuboat-256-256-transparent.png" />Boat</h2>
 	<div id="display">
 		<div id="speedthroughwater">
@@ -89,8 +89,15 @@
 	</div>
 	<div id="map"></div>
+	<div id="shutdown">
+		<p id="shutdownMessage"/>
+		<form>
+			<button type="button" id="shutdownButton">SHUTDOWN</button>
+		</form>
+	</div>
 	<form method="post" action="./" enctype="multipart/form-data">
 		<div class="formTable">
+			<h2 class="backgroundgreen">Map Upload</h2>
 			<p>
-				<label>Upload Map (mbtiles format):</label><br/>
+				<label>MBTiles File:</label><br/>
 				<input class="file" type="file" name="mapFile" value=""/>
 			</p>
@@ -100,10 +107,4 @@
 		</div>
 	</form>
-	<div id="shutdown">
-		<p id="shutdownMessage"/>
-		<form>
-			<button type="button" id="shutdownButton">SHUTDOWN</button>
-		</form>
-	</div>
 <?php
 require_once("inc/footer.php");
Index: src/webapp/webservice/inc/Config.php
===================================================================
--- src/webapp/webservice/inc/Config.php	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/webapp/webservice/inc/Config.php	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -38,4 +38,10 @@
 	}
 	
+	public function shutdownRequestFile(){
+		if(array_key_exists("shutdownfile", $this->_config))
+			return $this->_config["shutdownfile"];
+		return "/var/spool/gnuboat/shutdown.request";
+	}
+	
 	public function dataDirectory(){
 		if(array_key_exists("datadirectory", $this->_config))
Index: src/webapp/webservice/index.php
===================================================================
--- src/webapp/webservice/index.php	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/webapp/webservice/index.php	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -92,4 +92,7 @@
 				if(!is_numeric($tmp[$key]) || is_nan($tmp[$key])){
 					$allValid = false;
+					if($debug > 1){
+						echo "Invalid value ". $key ." (". $tmp[$key] .") at time ". $time ."<br/>";
+					}
 				}
 				elseif(array_key_exists($key, $configRound) && is_integer($configRound[$key]))
@@ -98,9 +101,8 @@
 		}
 		// only add the timeframe to the track, if the values are valid and we had a gps fix at that time
-		if($allValid && $tmp["gpsfix"] != "-"){
-			echo "want to add ". $time ."<br/>\n";
-			if(!array_key_exists($time, $result["track"])){
+		if($allValid){
+ 			if(!array_key_exists($time, $result["track"])){
 				$result["track"][$time] = $tmp;
-			}
+ 			}
 			$lastTime = $time;
 		}
@@ -131,7 +133,7 @@
 $result = array();
 if($request == REQUEST_SHUTDOWN){
-	$handle = @fopen("/var/spool/gnuboat/shutdown.request", "w");
+	$handle = @fopen($config->shutdownRequestFile(), "w");
 	if($handle === false){
-		$message = "Could not create file to indicate shutdown to the daemon (Timezone: ". date_default_timezone_get() .")";
+		$message = "Could not create file (". $config->shutdownRequestFile() .") to indicate shutdown to the daemon (Timezone: ". date_default_timezone_get() .")";
 		if($debug > 0)
 			echo $message;
