Index: src/daemon/gnuboat
===================================================================
--- src/daemon/gnuboat	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ src/daemon/gnuboat	(revision 1d2acb7b9085f6a3009b95a0264c72e6c9040420)
@@ -1,4 +1,3 @@
 #!/usr/bin/python
-# -*- coding: utf-8 -*-
 '''
     Copyright (C) 2016 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
@@ -23,29 +22,8 @@
 import time
 import threading
-import re
-import os
-import dateutil.parser
-import datetime
-from pytz import timezone
-import pytz
-import getopt
-import sys
-from EPD import EPD
-from PIL import Image
-from PIL import ImageDraw
-from PIL import ImageFont
+import os.path
 
-WHITE=1
-BLACK=0
-marginVertical = 10
-marginHorizontal = marginVertical
-
-# default values for command line arguments
-rrdfile = "/var/www/html/webservice/data/log-webservice.rrd"
-shutdownfile = "/var/spool/gnuboat/shutdown.request"
-logperiod = 1
-displayperiod = 5
-
-shutdownRequested = None
+rrdFile = "/home/jlan11/public_html/gnuboat/webservice/data/log-webservice.rrd"
+logPeriod = 1
 
 # Copied from https://gist.github.com/wolfg1969/4653340
@@ -73,13 +51,12 @@
    
   def run(self):
-    global logperiod
     try:
       while self._running:
         self._currentValue = self._session.next()
-        time.sleep(float(logperiod)/2.0)
+        time.sleep(float(logPeriod)/2.0)
     except StopIteration:
       pass
 
-def createDatabase(databaseFile):
+def createDatabase(databaseFile)
   rrdDataSources = [ 'DS:latitude:GAUGE:15:-90:90',
                      'DS:longitude:GAUGE:15:-180:180',
@@ -97,5 +74,5 @@
 
   if not os.path.isfile(databaseFile):
-    rrdtool.create(databaseFile,
+    rrdtool.create(rrdFile,
                    "--start",
                    "N",
@@ -105,138 +82,15 @@
                    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):
-  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]"
-  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"
-
-def main(argv):
-  global rrdfile
-  global shutdownfile
-  global logperiod
-  global displayperiod
-
-  try:                                
-    opts, args = getopt.getopt(argv, "hr:s:l:d:", ["help", "rrdfile=", "shutdownfile=", "logperiod=", "displayperiod="]) 
-  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
-    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)
-
-  epd = EPD()
-  epd.clear()
+if __name__ == '__main__':
+  createDatabase(rrdFile)
 
   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 logPeriod seconds print the current value
-      time.sleep(logperiod)
+      # In the main thread, every 5 seconds print the current value
+      time.sleep(logPeriod)
       latitude = gpsp.latitude()
       longitude = gpsp.longitude()
@@ -246,17 +100,9 @@
       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 round(time.time(),0) % displayperiod == 0:
-        displayValues(epd, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix)
-      #check for shutdown request
-      checkShutdownRequest(shutdownfile)
+      rrdtool.update(rrdFile, "N:%s:%s:%s:%s:%s:%s:%s" % (latitude, longitude, speedThroughWater, speedOverGround, waterDepth, waterTemperature, gpsFix))
        
   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
-
-if __name__ == "__main__":
-  main(sys.argv[1:])
+  print "Done.\nExiting."
Index: src/daemon/gnuboat-splashscreen
===================================================================
--- src/daemon/gnuboat-splashscreen	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ 	(revision )
@@ -1,70 +1,0 @@
-#!/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)
-  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()
-
-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"
-
-  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 __name__ == "__main__":
-  main(sys.argv[1:])
