1Set up the Raspberry Pi
2Electrical Connection of Sensores and Actuators
3Set up the Connection
4Heating Control

no warranty for any of the provided information

index

Is used by:
HV_Admin_Login

In the first line a session has to be started to use cookies for loggin in.


main

The main function has two purposes:

  1. Pagelayout
    With the strings $head and $foot the layout for all pages is centrally defined.
  2. Pagecontent
    What is shown is controlled via $what2do which indicates which functions should be executed by the switch-case structure.
    If $what2do is not set, the default page is shown. In any other case it is checked first whether the user authentificated herself such that $_SESSION['IamGod'] is set - if not the user is redirected to the login.


HV_Admin_Login

Function to login/logoff the user.
Special feature is the increasing delay if someone should try to steal the password.


HV_Admin_Login

Just to indicate that the pulling of the weather forecast works, this fuctions reads the last line of the weather logfile and shows its values.

<?php 
/* published under GPL www.gnu.org/licenses/gpl.html */
session_start();
$self = $_SERVER["PHP_SELF"];

main();

function main(){
  include("HV_setParameters.php");
  include("HV_Admin_Login.php");
  include("HV_serviceLog.php");
  include("HV_thermos200.php");
  global $self;
  $head="<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html>
<head>
<title>Jachens Haustechnik</title>\n
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<meta name='keywords' content='Arne, Jachens'>
<meta name='robots' content='noindex'>
<meta name='robots' content='nofollow'>
<meta name='autor' content='arne jachens'>
<!-- <link rel='STYLESHEET' href='.path.CMSlayout.css'>.extraStyle. -->
<style type='text/css'> 
form            { background-color:#eeffee; }
a,p,tt,h1       { font-family:sans-serif; }
a:link          { font-weight:bold; color:green; text-decoration:none; }
a:visited       { font-weight:bold; color:green; text-decoration:none; }
a:active        { font-weight:bold; color:green; text-decoration:underline; background-color:#dddddd; }
a:hover         { font-weight:bold; color:green; text-decoration:underline; background-color:#dddddd; }
</style>
<LINK REL='SHORTCUT ICON' HREF='./favicon.ico'>
</head>
<body>
<a href='$self'><h1>Jachens' Haustechnik</h1></a>\n";
  if(isset($_SESSION['IamGod']) AND $_SESSION['IamGod']){
    $form = "\n\n <p></p>";
    $form.= HV_Admin_Login();
    $foot = $form;
  }else{
    $foot ="";
  }
  $foot.="</body></html>";
  $what2do="showHouse"; #default
  if(isset($_GET['what2do'])){
    $what2do=$_GET['what2do'];
    if(!isset($_SESSION['IamGod']) 
       OR (isset($_SESSION['IamGod']) AND !$_SESSION['IamGod'])){
      $what2do="login";
    }
  }
  HV_readParameters();
  $content ="";
  switch($what2do){
  case "restart":
    include("HV_restart.php");
    $content.= HV_restart();
  break;
  case "login":
    $content.= HV_Admin_Login();
    if(!isset($_SESSION['IamGod'])){break;}
    if(!$_SESSION['IamGod']){
      break;
    }else{
      /* fall through */
    }
  case "showLog":
    include("HV_showLog.php");
    $content.= HV_showLog();
    break;
  case "menu":
    $content.= HV_showSwitches();
    $content.= VentControlPanel();
    $content.= "\n<p align='center'><a href='?what2do=showLog'>show Logfile</a></p>\n";
    break;
  case "editParams":
    $content.= HV_editParameters();
    $content.= HV_Admin_Login();
    $content.= "<p align='center'><a href='?what2do=restart'>restart heating control</a></p>";
    break;
  case "ventilation":

    break;
  case 'updateService':
    $fname="HV_serviceLog.dat";
    HV_serviceUpdateLog($fname);
    // fall through
  case 'showServiceLog':
    $fname="HV_serviceLog.dat";
    $content.=HV_serviceShowLog($fname);
    break;
  case "writeConfig":
    HV_writeConfig();
    /* fall through */
  default:
    include("readFilenames.php");
    include("HV_readOperationState.php");
    include("HV_showHouse.php");
    include("HV_showWeatherForecast.php");
    list($timeStamp,$sens,$act,$vent) = HV_readOperationState(6);
    $content.= HV_showHouse($sens,$act,$vent);
    $content.= "\n<p align='center'><a href='?what2do=showLog'>show Logfile</a></p>\n";
    $content.= "<p><em>".str_replace("T"," ",$timeStamp)."</em></p>";
    $content.= HV_showWeatherForecast();
  }
  /* show actual page */
  echo $head;
  echo $content;
  echo $foot;
}

?>
1HV_Admin_Login
2HV_colorMap
3HV_config
4HV_convertASCII
5HV_getSunPrediction
6HV_heatingControl
7HV_loop
8HV_readOperationState
9HV_readTemperatures
10HV_restart
11HV_serviceLog
12HV_setActuators
13HV_setParameters
14HV_showHouse
15HV_showLog
16HV_showRawValues
17HV_showWeatherForecast
18HV_thermos200
19HV_ventProg
20HV_writeLog
21index
22MoistAir
23readFilenames
24readNamedData
25tableInterpol

 

gnuplot

gnuplot is used to visualise the results - via script you can do infinite diagrams in 1 second.
Run 'test' in gnuplot to get an owerview of the available line- and symbolstyles.

Login
Valid HTML 4.01!