Index: src/daemon/gnuboat
===================================================================
--- src/daemon/gnuboat	(revision 4ab1c0a91ed95286baef2a370dcab7a9e7d0d756)
+++ src/daemon/gnuboat	(revision 10edeb0338e940bcbf5904183c5c4b21477d4667)
@@ -1,3 +1,4 @@
 #!/usr/bin/python
+# -*- coding: utf-8 -*-
 '''
     Copyright (C) 2016 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
@@ -22,8 +23,22 @@
 import time
 import threading
-import os.path
+import re
+import os
+import dateutil
+from EPD import EPD
+from PIL import Image
+from PIL import ImageDraw
+from PIL import ImageFont
 
-rrdFile = "/home/jlan11/public_html/gnuboat/webservice/data/log-webservice.rrd"
+WHITE=1
+BLACK=0
+marginVertical = 10
+marginHorizontal = marginVertical
+rrdFile = "/home/joachim/public_html/gnuboat/webservice/data/log-webservice.rrd"
+shutdownFile = "/var/spool/gnuboat/shutdown.request"
 logPeriod = 1
+displayPeriod = 5
+
+shutdownRequested = None
 
 # Copied from https://gist.github.com/wolfg1969/4653340
@@ -58,5 +73,5 @@
       pass
 
-def createDatabase(databaseFile)
+def createDatabase(databaseFile):
   rrdDataSources = [ 'DS:latitude:GAUGE:15:-90:90',
                      'DS:longitude:GAUGE:15:-180:180',
@@ -82,14 +97,75 @@
                    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():
+  global shutdownRequest
+  # 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:
+    if (datetime.now() - shutdownRequested) > timedelta(seconds = 0):
+      os.system("sudo shutdown -r now")
+
 if __name__ == '__main__':
   createDatabase(rrdFile)
+
+  epd = EPD()
+  epd.clear()
 
   gpsp = GpsdPoller()
   try:
     gpsp.start()
-    print "Collecting data..."
     # gpsp now polls every .2 seconds for new data, storing it in self.current_value
     while True:
-      # In the main thread, every 5 seconds print the current value
+      # In the main thread, every logPeriod seconds print the current value
       time.sleep(logPeriod)
       latitude = gpsp.latitude()
@@ -100,9 +176,14 @@
       waterTemperature = random.randrange(15, 25) + 0.5;
       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))
+      # update display, if needed
+      if time.time() % displayPeriod == 0:
+        displayValues(epd, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix)
+      #check for shutdown request
+      checkShutdownRequest()
        
   except (KeyboardInterrupt, SystemExit): #when you press ctrl+c
-    print "\nKilling Thread..."
     gpsp.stop()
     gpsp.join() # wait for the thread to finish what it's doing
-  print "Done.\nExiting."
Index: src/daemon/gnuboat-splashscreen
===================================================================
--- src/daemon/gnuboat-splashscreen	(revision 10edeb0338e940bcbf5904183c5c4b21477d4667)
+++ src/daemon/gnuboat-splashscreen	(revision 10edeb0338e940bcbf5904183c5c4b21477d4667)
@@ -0,0 +1,50 @@
+#!/usr/bin/python
+'''
+    Copyright (C) 2016 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+'''
+
+import sys
+import os
+import getopt
+from PIL import Image
+from PIL import ImageOps
+from EPD import EPD
+
+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)
+
+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):
+    usage()
+    sys.exit(2)
+
+  epd = EPD()
+  epd.clear()
+  displayImage(epd, image)
+
+if __name__ == "__main__":
+  main(sys.argv[1:])
