Index: externals/epaper-driver/debian/changelog
===================================================================
--- externals/epaper-driver/debian/changelog	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ externals/epaper-driver/debian/changelog	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -1,2 +1,11 @@
+epd-fuse (0.1-4) unstable; urgency=low
+
+  * Added auto switch to systemd for debian jessie (8.0) or initd for
+    version before jessie
+  * Added Apache 2.0 as license and also added copyright information
+  * epd-fuse-* provides virtual package epd-fuse and python-epd depends on that virtual package
+
+ -- EngSaS - Joachim Langenbach <info@engsas.de>  Thu, 21 Jul 2016 17:00:00 +0000
+
 epd-fuse (0.1-3) unstable; urgency=low
 
Index: externals/epaper-driver/debian/control
===================================================================
--- externals/epaper-driver/debian/control	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ externals/epaper-driver/debian/control	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -3,5 +3,5 @@
 Priority: optional
 Maintainer: EngSaS - Joachim Langenbach <info@engsas.de>
-Build-Depends: debhelper (>= 9), dh-python, python-all, python3-all, python-all-dbg, python3-all-dbg, python-setuptools, python3-setuptools, python-support (>= 0.90), python-pil
+Build-Depends: debhelper (>= 9), lsb-release, dh-python, dh-systemd (>= 1.5), python-all, python3-all, python-all-dbg, python3-all-dbg, python-setuptools, python3-setuptools, python-support (>= 0.90), python-pil
 Standards-Version: 3.9.5
 Homepage: https://github.com/repaper/gratis
@@ -13,4 +13,5 @@
 Package: epd-fuse-v230-g2
 Architecture: any
+Provides: epd-fuse
 Depends: ${shlibs:Depends}, ${misc:Depends}, libfuse-dev
 Description: EPD driver for repaper display
@@ -20,5 +21,5 @@
 Section: python
 Architecture: any
-Depends: ${python:Depends}, ${misc:Depends}, ${shlibs:Depends}, epd-fuse-v230-g2
+Depends: ${python:Depends}, ${misc:Depends}, ${shlibs:Depends}, epd-fuse
 Description: Python module for the repaper display epd-fuse driver
  It provides an API to use the repaper displays with epd-fuse driver
@@ -28,5 +29,5 @@
 Section: python
 Architecture: any
-Depends: ${python3:Depends}, ${misc:Depends}, ${shlibs:Depends}, epd-fuse-v230-g2
+Depends: ${python3:Depends}, ${misc:Depends}, ${shlibs:Depends}, epd-fuse
 Description: Python module for the repaper display epd-fuse driver (Python 3)
  It provides an API to use the repaper displays with epd-fuse driver 
Index: externals/epaper-driver/debian/copyright
===================================================================
--- externals/epaper-driver/debian/copyright	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ externals/epaper-driver/debian/copyright	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -1,38 +1,24 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: epd-fuse
-Source: <url://example.com>
+Source: https://github.com/repaper/gratis
 
 Files: *
-Copyright: <years> <put author's name and email here>
-           <years> <likewise for another author>
-License: <special license>
- <Put the license of the package here indented by 1 space>
- <This follows the format of Description: lines in control file>
+Copyright: Copyright 2013-2015 Pervasive Displays, Inc
+License: Apache-2.0
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
  .
- <Including paragraphs>
-
-# If you want to use GPL v2 or later for the /debian/* files use 
-# the following clauses, or change it to suit. Delete these two lines
-Files: debian/*
-Copyright: 2016 EngSaS - Joachim Langenbach <info@engsas.de>
-License: GPL-2+
- This package 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 2 of the License, or
- (at your option) any later version.
+      http://www.apache.org/licenses/LICENSE-2.0
  .
- This package 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.
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
  .
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>
- .
- On Debian systems, the complete text of the GNU General
- Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
-
-# Please also look if there are files or directories which have a
-# different copyright/license attached and list them here.
-# Please avoid to pick license terms that are more restrictive than the
-# packaged work, as it may make Debian's contributions unacceptable upstream.
+ On Debian systems, the full text of the Apache Software License version 2 can
+ be found in the file `/usr/share/common-licenses/Apache-2.0'.
Index: externals/epaper-driver/debian/patches/series
===================================================================
--- externals/epaper-driver/debian/patches/series	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ externals/epaper-driver/debian/patches/series	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -1,2 +1,3 @@
 add-python-setup.diff
 fix-make-gnu-standards.diff
+switch-service-file.diff
Index: externals/epaper-driver/debian/patches/switch-service-file.diff
===================================================================
--- externals/epaper-driver/debian/patches/switch-service-file.diff	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
+++ externals/epaper-driver/debian/patches/switch-service-file.diff	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -0,0 +1,74 @@
+Index: epd-fuse-0.1/Makefile
+===================================================================
+--- epd-fuse-0.1.orig/Makefile
++++ epd-fuse-0.1/Makefile
+@@ -2,6 +2,7 @@
+ 
+ DESTDIR ?= ""
+ PREFIX ?= /usr/local
++SERVICE ?= initd
+ 
+ PANEL_VERSION ?= NOT-SET
+ EPD_IO ?= epd_io.h
+@@ -77,10 +78,10 @@ version-check:
+ 
+ .PHONY: rpi raspberrypi
+ rpi raspberrypi: version-check
+-	$(MAKE) DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) PLATFORM=../RaspberryPi PANEL_VERSION="${PANEL_VERSION}" EPD_IO="${EPD_IO}" -C driver-common
++	$(MAKE) DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) SERVICE=$(SERVICE) PLATFORM=../RaspberryPi PANEL_VERSION="${PANEL_VERSION}" EPD_IO="${EPD_IO}" -C driver-common
+ 
+ rpi-%: version-check
+-	$(MAKE) DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) PLATFORM=../RaspberryPi PANEL_VERSION="${PANEL_VERSION}" EPD_IO="${EPD_IO}" -C driver-common $*
++	$(MAKE) DESTDIR=$(DESTDIR) PREFIX=$(PREFIX) SERVICE=$(SERVICE) PLATFORM=../RaspberryPi PANEL_VERSION="${PANEL_VERSION}" EPD_IO="${EPD_IO}" -C driver-common $*
+ 
+ 
+ # BeagleBone Black targets
+Index: epd-fuse-0.1/driver-common/Makefile
+===================================================================
+--- epd-fuse-0.1.orig/driver-common/Makefile
++++ epd-fuse-0.1/driver-common/Makefile
+@@ -2,6 +2,7 @@
+ 
+ DESTIR ?= ""
+ PREFIX ?= /usr/local
++SERVICE ?= initd
+ 
+ include ../directories.mk
+ 
+@@ -57,7 +58,7 @@ install: check-compiled
+ 	install --group=root --mode=750 --owner=root epd_fuse "${DESTDIR}${SBINDIR}"
+ 	test ! -d "${DESTDIR}${SYSCONFDIR}/default" && mkdir -p "${DESTDIR}${SYSCONFDIR}/default"
+ 	[ -e "${DESTDIR}${SYSCONFDIR}/default/epd-fuse" ] || install --group=root --mode=644 --owner=root epd-fuse.default "${DESTDIR}${SYSCONFDIR}/default/epd-fuse"
+-ifeq (YES,${IS_ARCH})
++ifeq (systemd,${SERVICE})
+ 	test ! -d "${DESTDIR}${LIBDIR}/systemd/system" && mkdir -p "${DESTDIR}${LIBDIR}/systemd/system"
+ 	install --group=root --mode=644 --owner=root epd-fuse.service "${DESTDIR}${LIBDIR}/systemd/system/epd-fuse.service"
+ else # otherwise Debian
+@@ -77,10 +78,7 @@ endif
+ remove:
+ 	[ -x "${DESTDIR}${SYSCONFDIR}/init.d/epd-fuse" ] && "${DESTDIR}${SYSCONFDIR}/init.d/epd-fuse" stop
+ 	rm -f "${DESTDIR}${SBINDIR}/epd_fuse"
+-ifeq (YES,${IS_ARCH})
+-	-systemctl stop epd-fuse
+-	-systemctl disable epd-fuse
+-	-systemctl daemon-reload
++ifeq (systemd,${SERVICE})
+ 	rm -f "${DESTDIR}${LIBDIR}/systemd/system/epd-fuse.service"
+ else # otherwise Debian
+ 	rm -f "${DESTDIR}${SYSCONFDIR}/init/epd-fuse.conf"
+Index: epd-fuse-0.1/driver-common/epd-fuse.service
+===================================================================
+--- epd-fuse-0.1.orig/driver-common/epd-fuse.service
++++ epd-fuse-0.1/driver-common/epd-fuse.service
+@@ -10,9 +10,9 @@ SyslogLevel=err
+ # make sure panel size matches installed EPD panel
+ Environment=EPD_MOUNTPOINT=/dev/epd EPD_SIZE=2.0 "EPD_OPTS=-o allow_other -o default_permissions"
+ EnvironmentFile=/etc/default/epd-fuse
+-ExecStartPre=/usr/bin/mkdir -p ${EPD_MOUNTPOINT}
++ExecStartPre=/bin/mkdir -p ${EPD_MOUNTPOINT}
+ ExecStart=/usr/sbin/epd_fuse --panel=${EPD_SIZE} $EPD_OPTS ${EPD_MOUNTPOINT}
+-ExecStop=/usr/bin/umount /dev/epd
++ExecStop=/bin/umount ${EPD_MOUNTPOINT}
+ KillSignal=SIGQUIT
+ KillMode=mixed
+ 
Index: ternals/epaper-driver/debian/postinst
===================================================================
--- externals/epaper-driver/debian/postinst	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ 	(revision )
@@ -1,1 +1,0 @@
-update-rc.d epd-fuse defaults
Index: ternals/epaper-driver/debian/postrm
===================================================================
--- externals/epaper-driver/debian/postrm	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ 	(revision )
@@ -1,3 +1,0 @@
-if [ "$1" = purge ]; then
-  update-rc.d epd-fuse remove
-fi
Index: externals/epaper-driver/debian/rules
===================================================================
--- externals/epaper-driver/debian/rules	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ externals/epaper-driver/debian/rules	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -4,17 +4,23 @@
 export PYBUILD_NAME = epd
 PANEL_VERSION := V230_G2
-DESTDIR := $$(pwd)/debian/epd-fuse-v230-g2
+DESTDIR := $(CURDIR)/debian/epd-fuse-v230-g2
 PREFIX := /usr
+RELEASE := $(shell lsb_release -rs)
+
+SERVICE = initd
+ifeq "8.0" "$(word 1, $(sort 8.0 $(RELEASE)))"
+        SERVICE = systemd
+endif
 
 %:
-	dh $@ --with quilt,python2,python3 --buildsystem=pybuild
+	dh $@ --with quilt,systemd,python2,python3 --buildsystem=pybuild
 
 override_dh_auto_build:
 	dh_auto_build
-	$(MAKE) PANEL_VERSION=$(PANEL_VERSION) PREFIX=$(PREFIX) DESTDIR=$(DESTDIR) rpi-epd_fuse
+	$(MAKE) PANEL_VERSION=$(PANEL_VERSION) PREFIX=$(PREFIX) DESTDIR=$(DESTDIR) SERVICE=$(SERVICE) rpi-epd_fuse
 
 override_dh_auto_install:
 	dh_auto_install
-	$(MAKE) PANEL_VERSION=$(PANEL_VERSION) PREFIX=$(PREFIX) DESTDIR=$$(pwd)/debian/epd-fuse-v230-g2 rpi-install
+	$(MAKE) PANEL_VERSION=$(PANEL_VERSION) PREFIX=$(PREFIX) DESTDIR=$(DESTDIR) SERVICE=$(SERVICE) rpi-install
 
 #override_dh_strip:
Index: externals/epaper-driver/epaper-package
===================================================================
--- externals/epaper-driver/epaper-package	(revision 2925c4a8a48723d6c3c3266571ca9c7a2c90335e)
+++ externals/epaper-driver/epaper-package	(revision 04de4a42898159e1d3b538a6d8acdcf9637945b7)
@@ -18,5 +18,5 @@
 
 echo "Installing dependencies"
-sudo apt-get install debhelper dpkg-dev lintian libfuse-dev
+sudo apt-get install debhelper lsb-release dh-python dh-systemd python-all python3-all python-all-dbg python3-all-dbg python-setuptools python3-setuptools python-support python-pil
 echo "Preparebuild environment"
 mkdir "${BUILD_DIR}"
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;
