From: Bernhard Tittelbach Date: Wed, 17 Apr 2013 04:39:41 +0000 (+0000) Subject: raspberry kiosk X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=6e8fff305273eb943f7f4d905524dee40625941e;p=svn42.git raspberry kiosk --- diff --git a/documents/statuten/main.pdf b/documents/statuten/main.pdf index 0315f6d..025c614 100644 Binary files a/documents/statuten/main.pdf and b/documents/statuten/main.pdf differ diff --git a/documents/statuten/main.tex b/documents/statuten/main.tex index c976ad4..36825a8 100644 --- a/documents/statuten/main.tex +++ b/documents/statuten/main.tex @@ -25,7 +25,7 @@ %-------------------------PACKAGES------------------------------- % Load Babel language support -\usepackage[austrian, german]{babel} +\usepackage[austrian, ngerman]{babel} \usepackage[utf8]{inputenc} \usepackage{textcomp} \usepackage{amsmath} diff --git a/raspberry-kiosk/kiosk.css b/raspberry-kiosk/kiosk.css new file mode 100644 index 0000000..91e34b7 --- /dev/null +++ b/raspberry-kiosk/kiosk.css @@ -0,0 +1,173 @@ + +body { + font-family: "Droid Sans", Helvetica, Arial, Sans; + color:black; + font-size:22px; + padding:0; + margin:0; + background-color: white; +} + +div { + width: 100%; + padding: 0; +} + +div#siteheader { + text-align: center; + font-size: 1.2em; + font-weight: bold; + color: white; + //background-color: #36373B; + background-color: rgb(118, 20, 7); + font-size:40px; + margin-top:10px; +} + +img.headerphoto { + width:100%; + margin: -60px 0 0 0px; +} + +div.headerphoto { + display:block; + width: 100%; + height: 350px; + overflow: hidden; + padding: 0.1em 0; + text-align: center; + margin-top:10px; +} + +div.status { + display:block; + width: 98%; + margin-top:10px; + margin-left:auto; + margin-right:auto; +} + +table.status { + width:571px; + display:inline; + margin-left: 0; + margin:right: 0; + margin-top:0; + margin-bottom:1ex; +} + +p.anwesenheit_status { +} + +td.anwesenheitsstatus { + height:100px; + text-align:center; + margin-left:105px; + margin-right:auto; + vertical-align:middle; + display:table-cell; + font-weight:bold; + font-size:30px; +} + +p.topic { + width: 100%; + margin-bottom:1ex; + margin-top:0px; + margin-left:0px; + margin-right:0px; + font-weight: bold; + font-variant:small-caps; + font-size: 110%; + color: white; + text-align:center; + background-color: #36373B; +} + +div.calendars { + display:block; + width: 100%; + height: 15em; + margin-top:10px; + margin-left:0px; + margin-right:0px; +} + +div.calendar { + //width: 48%; + width: 99%; + height: 15em; + overflow: hidden; + border:1px solid #333; + margin-bottom:0ex; + margin-top:0ex; + margin-left:5px; + margin-right:5px; +} + +div.sensorgraphs { + display:block; + text-align:center; + border:1px solid #333; + width:99%; + //height:35em; + padding-bottom:2px; + background-color:#fff; + margin-top:10px; + margin-bottom:10px; + margin-left:auto; + margin-right:auto; +} + +div.sensorelem { + display:block; + width:571px; + margin-top:2px; + margin-bottom:0; + margin-left:auto; + margin-right:auto; +} + +img.sensorimg { + margin:0; + padding:0; + border:0px none black; + width:571px; +} + +div.even { + background-color: white; +} + +div.odd { + background-color: #E0E0E0; +} + +div#dateclock { + text-align: center; + font-size: 1.2em; + font-weight: bold; + color: white; + background-color: #36373B; + font-size:48px; +} + +span.start,span.end,span.showname { + font-weight: bold; + margin: 0.1em 0.22em; +} + +span.start,span.end { + font-size: 0.75em; + margin-left: 1em; + margin-right: 1em; +} + +span.start { + float: left; +} + +span.end { + float: right; +} + diff --git a/raspberry-kiosk/kiosk.html b/raspberry-kiosk/kiosk.html new file mode 100644 index 0000000..8a5b0e2 --- /dev/null +++ b/raspberry-kiosk/kiosk.html @@ -0,0 +1,48 @@ + + + + Realraum Kiosk Seite + + + + + + +
+ +
+ +
+
+
+

Upcoming Events

+
Loading calendar ...
+
+ +
+ +
+ +
+

Sensor Data

+
+ + + +
Loading ...
Loading ...
+
+ +
+ +
+
+ +
+
+ + diff --git a/raspberry-kiosk/kiosk.js b/raspberry-kiosk/kiosk.js new file mode 100644 index 0000000..15fe505 --- /dev/null +++ b/raspberry-kiosk/kiosk.js @@ -0,0 +1,163 @@ + +function writeCalendar(data, elem) +{ + var calhtml = ""; + for (var s=0; s dt) + { + when = "JETZT"; + } + else + { + var stime = data[s].starttime; + while (stime.substring(stime.length-3,stime.length) == ":00") + { + stime=stime.substring(0,stime.length-3); + } + when = data[s].start +", "+stime+" Uhr"; + } + calhtml += '
  • '+"\n"; + } + elem.innerHTML=''; +} +function loadCalendar() +{ + //old URI: //grical.realraum.at/s/?query=!realraum&limit=9&view=json + var calcontainer=document.getElementById("grical_upcoming"); + calcontainer.innerHTML="Calendar loading ...
    please wait a second or two"; + $.getJSON('/shmcache/grical_realraum.json', function(data){ + writeCalendar(data, calcontainer); + }); +} + +function writeAnwesenheitStatus(data) +{ + var html=""; + var sensorshtml=""; + var sensorstd=""; + if (data.open) + { + iconuri=data.icon.open; + statuscolor="lime"; + } + else + { + iconuri=data.icon.closed; + statuscolor="red"; + } + html='
    '+data.status+'
    '; + document.getElementById('anwesenheit_status').innerHTML=html; + + if (data.sensors) + { + for (var s=0; s
    '+swhere+': '+svalue+''; + }); + }); + } + } + if (sensorstd != "") + { + sensorshtml=''+sensorstd+'
    '; + document.getElementById('sensor_status').innerHTML=sensorshtml; + } +} + +function updateAnwesenheitStatus() +{ + //var req = new XMLHttpRequest(); + url = "/status.json"; + //req.open("GET", url ,false); + //google chrome workaround + //req.setRequestHeader("googlechromefix",""); + //req.send(null); + var jqxhr = $.getJSON(url, writeAnwesenheitStatus); +} +var anwesenheit_timer = window.setInterval("updateAnwesenheitStatus()", 10000); + +function updateSensors() +{ + //reloadImg(document.getElementById("tempsensor")); + reloadImg(document.getElementById("movementsensor")); + reloadImg(document.getElementById("lightsensor")); +} + +var timer; +var seconds = 0; +var schedule = Array() + +$(document).ready(function() +{ + updateDateClock(new Date()); + setInterval("clock()", 500); + updateAnwesenheitStatus(); + loadCalendar(); + setInterval("updateAnwesenheitStatus()", 10000); + setInterval("loadCalendar()", 100000); + setInterval("updateSensors()", 50000); +}); + +function updateDateClock(now) +{ + var daynames = new Array('So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'); + var datetimestr = daynames[now.getDay()]; + datetimestr += ' ' + now.getDate(); + datetimestr += '.' + (now.getMonth() + 1); + datetimestr += '.' + now.getFullYear(); + datetimestr += (now.getHours() > 9 ? ' ' : ' 0') + now.getHours(); + datetimestr += (now.getMinutes() > 9 ? ':' : ':0') + now.getMinutes(); + datetimestr += (now.getSeconds() > 9 ? ':' : ':0') + now.getSeconds(); + $('#dateclock').html(datetimestr); +} + +function highlightEntry(idx, color, value) +{ + if(value == 0) { + if(idx%2 == 0) + $('#upnext' + idx).css('background-color', 'white'); + else + $('#upnext' + idx).css('background-color', '#E0E0E0'); + } else { + $('#upnext' + idx).css('background-color', color); + } +} + + +function clock(now) +{ + var now = new Date(new Date().valueOf() + 300); + updateDateClock(now); + seconds++; + if(seconds >= 20) { + seconds = 0; + } +} + +//function updateSchedule() +//{ +// $.ajax({type: "GET", url: "/export/schedules.php", data: "days=3&start=-1", dataType: "xml", error: showError, success: parseXml}); +//} + +function showError(XMLHttpRequest, textStatus, errorThrown) +{ + alert("Error: " + textStatus); +} + +function reloadImg(element) +{ + //var image = document.getElementById("theText"); + if(element.complete) { + var new_image = new Image(); + //set up the new image + new_image.id = element.id; + new_image.src = element.src; + element.parentNode.insertBefore(new_image,element); + element.parentNode.removeChild(element); + } +} diff --git a/raspberry-kiosk/restart-kiosk b/raspberry-kiosk/restart-kiosk new file mode 100644 index 0000000..cb6f3fb --- /dev/null +++ b/raspberry-kiosk/restart-kiosk @@ -0,0 +1,4 @@ +# cron.d/restart-kiosk - restart midori and unclutter (memory gets filled up...) +# +42 4 * * 1 pi /usr/local/bin/start-kiosk.sh +10 19 * * 5 pi /usr/local/bin/start-kiosk.sh diff --git a/raspberry-kiosk/start-kiosk.sh b/raspberry-kiosk/start-kiosk.sh new file mode 100644 index 0000000..475ceff --- /dev/null +++ b/raspberry-kiosk/start-kiosk.sh @@ -0,0 +1,23 @@ +#!/bin/sh +KIOSKURI="http://www.realraum.at/kiosk.html" +#KIOSKURI="http://grical.realraum.at" +#KIOSKURI="http://radi-o-matic.helsinki.at/nextshows/index.php?len=11" +sleep 1 + +killall midori 2> /dev/null +killall unclutter 2> /dev/null +killall chromium 2> /dev/null + +sleep 5 +export DISPLAY=:0.0 + +xset dpms 0 0 0 +xset dpms force on +xset s off +xset s noblank + +unclutter & +#midori -e Fullscreen -a "$KIOSKURI" +chromium --kiosk --incognito "$KIOSKURI" + +exit 0