missingfiles
authorBernhard Tittelbach <xro@realraum.at>
Wed, 17 Dec 2014 01:22:52 +0000 (01:22 +0000)
committerBernhard Tittelbach <xro@realraum.at>
Wed, 17 Dec 2014 01:22:52 +0000 (01:22 +0000)
documents/tür.odt [new file with mode: 0644]
raspberry-kiosk/kiosk1440x900.html [new file with mode: 0644]
raspberry-kiosk/kiosk768x1366sensors.html [new file with mode: 0644]
sensor_graph/get_sensor_movement.pl [new file with mode: 0755]
sensor_graph/sensor-movement.cgi [new file with mode: 0755]

diff --git a/documents/tür.odt b/documents/tür.odt
new file mode 100644 (file)
index 0000000..415946b
Binary files /dev/null and "b/documents/t\303\274r.odt" differ
diff --git a/raspberry-kiosk/kiosk1440x900.html b/raspberry-kiosk/kiosk1440x900.html
new file mode 100644 (file)
index 0000000..135e44c
--- /dev/null
@@ -0,0 +1,50 @@
+<html>
+  <head>
+  <meta charset="utf-8">
+  <title>Realraum Kiosk Seite</title>
+  <link rel="stylesheet" href="kiosk.css" type="text/css" />
+  <script type="text/javascript" src="/jquery.min.js"></script>
+  <!--script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script-->
+   <script type="text/javascript" src="https://www.google.com/jsapi"></script>
+   <script type="text/javascript">
+      google.load('visualization', '1', {packages: ['corechart']});
+  </script>
+  <script type="text/javascript" src="kiosk.js"></script>
+ </head>
+ <body style="max-width:900px; max-height:1440px;">
+  <div id="dateclock"></div>
+  <div id="siteheader">Neuigkeiten auf <span style="font-size:110%;">http://realraum.at</span></div>
+  <div id="headerphoto" class="headerphoto">
+  <img class="headerphoto" src="http://realraum.at/wiki/lib/exe/fetch.php?media=xro:realraum_hdr.jpg"></img>
+  </div>
+  <!-- Calendar ------------------------ -->
+  <div class="calendar">
+    <p class="topic">Veranstaltungskalender</p>
+    <div id="grical_upcoming_kiosk">Kalendar lädt ...</div>
+  </div>
+ <table border="0" cellpadding="0" cellspacing="0"><tr>
+ <!-- Sensor Data ------------------------ -->
+ <td style="vertical-align:top; padding-right:2px;">
+  <div class="sensorgraphs">
+    <p class="topic">Sensordaten</p>
+    <div class="sensorelem">
+    <table class="status" style="">
+    <tr><td id="anwesenheit_status_kiosk" style="height:100px; border:0px none black;">Lädt ...</td></tr>
+    <tr><td id="sensor_status" style="border:0px none black; margin-top:5px;">Lädt ...</td></tr>
+    </table>
+    </div>
+    <div class="sensorelem" id="tempgooglegraph" style="height:300px;"></div>
+    <div class="sensorelem" id="lightgooglegraph" style="height:300px;"></div>
+  <div class="sensorelem" id="movementgooglegraph" style="height:300px;"></div>
+  </div>
+
+  </td><td style="vertical-align:top;">
+   <!-- Google Plus Wall ------------------------ -->
+   <div class="gpluswall">
+    <p class="topic">Google+</p>
+    <div id="gplusevents">Lädt ...</div>
+   </div>
+  </td></tr>
+  </table>
+</body>
+</html>
diff --git a/raspberry-kiosk/kiosk768x1366sensors.html b/raspberry-kiosk/kiosk768x1366sensors.html
new file mode 100644 (file)
index 0000000..cfdc786
--- /dev/null
@@ -0,0 +1,42 @@
+<html>
+  <head>
+  <meta charset="utf-8">
+  <title>Realraum Kiosk Seite</title>
+  <link rel="stylesheet" href="kiosk.css" type="text/css" />
+  <script type="text/javascript" src="/jquery.min.js"></script>
+  <!--script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script-->
+  <!--script src="/purl.js"></script-->
+  <script type="text/javascript" src="kiosk.js"></script>
+ </head>
+ <body style="max-width:768px; max-height:1366px; font-size:19px;">
+  <div id="dateclock"></div>
+  <div id="siteheader">Neuigkeiten auf <span style="font-size:110%;">http://realraum.at</span></div>  
+  <div id="headerphoto" class="headerphoto">
+  <img class="headerphoto" src="http://realraum.at/wiki/lib/exe/fetch.php?media=xro:realraum_hdr.jpg"></img>
+  </div>
+  <!-- Calendar ------------------------ -->
+  <div class="calendar">
+    <p class="topic">Veranstaltungskalender</p>
+    <div id="grical_upcoming_kiosk">Kalendar lädt ...</div>
+  </div>
+   <!-- Sensor Data ------------------------ -->
+  <div class="sensorgraphs"  style="width:100%;">
+    <p class="topic">Sensordaten</p>
+    <div class="sensorelem">
+    <table class="status" style="">
+    <tr><td id="anwesenheit_status_kiosk" style="height:100px; border:0px none black;">Lädt ...</td></tr>
+    <tr><td id="sensor_status" style="border:0px none black; margin-top:5px;">Lädt ...</td></tr>
+    </table>
+    </div>
+    <div class="sensorelem">
+     <img id="tempsensor" class="sensorimg" src="http://realraum.at/shmcache/temp0.png"/>
+    </div>
+    <div class="sensorelem">
+      <img id="lightsensor" class="sensorimg" src="http://realraum.at/shmcache/light0.png"/>
+    </div>
+    <div class="sensorelem">
+      <img id="movementsensor" class="sensorimg" src="http://realraum.at/shmcache/movement.png"/>
+    </div>
+  </div>
+</body>
+</html>
diff --git a/sensor_graph/get_sensor_movement.pl b/sensor_graph/get_sensor_movement.pl
new file mode 100755 (executable)
index 0000000..f4c7ffb
--- /dev/null
@@ -0,0 +1,71 @@
+#!/usr/bin/perl -w
+#
+#
+
+use strict;
+use utf8;
+require LWP::UserAgent;
+my $ua = LWP::UserAgent->new(env_proxy => 1,
+                              keep_alive => 1,
+                              timeout => 30,
+                             );
+use HTTP::Cookies;
+use LWP;
+$ua->cookie_jar({});
+
+###############
+$sensor::url_refresh = "http://slug.realraum.at/cgi-bin/sensor-movement.cgi";
+$sensor::url_image = "http://slug.realraum.at/movement.png";
+$sensor::localpath = "/tmp/movement.png";
+$sensor::mintime = 0.0015;
+###############
+
+sub output_saved_image
+{
+  return 0 if ( not -e $sensor::localpath);
+  my $fh;  
+  print STDOUT "Content-type: image/png\n\n";
+  open($fh,"<$sensor::localpath") or exit;
+  while (<$fh>) {print $_};
+  close($fh);
+  return 1;
+}
+
+sub output_remote_image_and_save
+{
+  my $response;
+  $response = $ua->get($sensor::url_refresh);
+  return 0 unless (defined $response);
+  $response = $ua->get($sensor::url_image);
+  if (defined $response and $response->content =~ /^\x89PNG/)
+  {
+    my $fh;
+    open($fh,">$sensor::localpath");
+    print $fh $response->content;
+    close($fh);
+    print STDOUT "Content-type: image/png\n\n";
+    print $response->content;
+    $response->clear;
+    return 1;
+  }
+  return 0;
+}
+
+sub output_error
+{
+  print STDOUT "Status: 404 Not Found\n";
+  print STDOUT "Content-type: text/html\n\n";
+  print STDOUT "<html><body><h1>Sorry</h1><h2>The picture you requested could not be found</h2></body></html>\n"; 
+  return 1;
+}
+
+if (-e $sensor::localpath and -M $sensor::localpath < $sensor::mintime)
+{
+  exit if (&output_saved_image);
+}
+else
+{
+  exit if (&output_remote_image_and_save);
+  exit if (&output_saved_image);
+}
+&output_error;
diff --git a/sensor_graph/sensor-movement.cgi b/sensor_graph/sensor-movement.cgi
new file mode 100755 (executable)
index 0000000..976711c
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/rrdcgi
+<HTML>
+<BODY>
+<RRD::GOODFOR 30>
+<RRD::GRAPH ../movement.png
+  --imginfo '<IMG SRC="/%s" WIDTH="%lu" HEIGHT="%lu" >'
+  --color="BACK#d0d0af" --color="CANVAS#ffffff" 
+  --color="SHADEA#dfdfdf" --color="SHADEB#525252" 
+  --color="AXIS#761407" --color="FONT#272727" --color="MGRID#b65447"
+  --color="ARROW#761407" --color="GRID#d0d0af"
+  --title="Movement Sensor" --lazy
+  --start=now-36h --end=now --width=490
+  DEF:cel=/home/sensormovement.rrd:movement:LAST
+  LINE2:cel#1407e2:"Movements / Minute">
+
+</BODY>
+</HTML>
+