Difference between revisions of "Spacecontrol/HomeAutomation Installation"

From Whitespace (Hackerspace Gent)
Jump to: navigation, search
(Installation)
(Configuration)
 
(5 intermediate revisions by 2 users not shown)
Line 11: Line 11:
 
</pre>
 
</pre>
 
To test if everything is working so far create a file /var/www/index.php with the following containing "<?php phpinfo(); ?>". Now browse to the device your installing on and you should see a overview page of your php installation.
 
To test if everything is working so far create a file /var/www/index.php with the following containing "<?php phpinfo(); ?>". Now browse to the device your installing on and you should see a overview page of your php installation.
 
Some usefull links:<br />
 
https://wiki.ubuntu.com/Lighttpd%2BPHP<br />
 
http://www.ubuntugeek.com/lighttpd-webserver-setup-with-php5-and-mysql-support.html
 
  
 
Then download the zip file containing the latest stable release from the website. That's version 2.0.2 in our case. Unzip and copy the entire content to /var/www. The ownership of all files was set to www-data.
 
Then download the zip file containing the latest stable release from the website. That's version 2.0.2 in our case. Unzip and copy the entire content to /var/www. The ownership of all files was set to www-data.
Line 21: Line 17:
 
</pre>   
 
</pre>   
  
/etc/php5/cgi/php.ini
+
The last step of the installation is to copy the configuration file and fill in the path of your installation. 
 +
<pre>
 +
cp /var/www/config_smaple /var/www/config.php
 +
</pre>
  
cp config_smaple config.php
+
== Configuration ==
 +
The rest of the configuration can be done through the webinterface. Just point your browser to your installation location. In our case that's http://gatekeeper.
 +
 
 +
/etc/php5/cgi/php.ini
  
 
date.timezone = Europe/Brussels
 
date.timezone = Europe/Brussels
/var/www/
 
  
 
<pre>
 
<pre>
grant all privileges on homeautomation.* to 'homeautomation'@'localhost' with grant option;
+
create database homeautomation;
 
create user 'homeautomation'@'localhost' identified by 'tellstick';
 
create user 'homeautomation'@'localhost' identified by 'tellstick';
 +
grant all privileges on homeautomation.* to 'homeautomation'@'localhost' with grant option;
 
</pre>
 
</pre>
  
Line 37: Line 39:
 
dpkg-reconfigure tzdata
 
dpkg-reconfigure tzdata
 
</pre>
 
</pre>
 +
 +
==Links:==
 +
https://wiki.ubuntu.com/Lighttpd%2BPHP<br />
 +
http://www.ubuntugeek.com/lighttpd-webserver-setup-with-php5-and-mysql-support.html
 +
 +
 +
 +
 +
Some ideas on HomeAutomation development can be found [[../HomeAutomation Development|here]]:

Latest revision as of 15:39, 5 September 2011

Installation[edit]

To run this software we will use the low power BeagleBoard we have laying idly by. This board is running Ubuntu 11.04. First step is to install all necessary packets, simply do:

sudo apt-get install lighttpd php5-cgi mysql-client mysql-server php5-mysql php5-cli at

Now we need to enable php support in lighttpd. The module needed to do this is called fastcgi. After that a reload is required so the changes take effect.

sudo lighty-enable-mod fastcgi 
sudo lighty-enable-mod fastcgi-php
sudo service lighttpd force-reload

To test if everything is working so far create a file /var/www/index.php with the following containing "<?php phpinfo(); ?>". Now browse to the device your installing on and you should see a overview page of your php installation.

Then download the zip file containing the latest stable release from the website. That's version 2.0.2 in our case. Unzip and copy the entire content to /var/www. The ownership of all files was set to www-data.

sudo chown www-data:www-data -R *

The last step of the installation is to copy the configuration file and fill in the path of your installation.

cp /var/www/config_smaple /var/www/config.php

Configuration[edit]

The rest of the configuration can be done through the webinterface. Just point your browser to your installation location. In our case that's http://gatekeeper.

/etc/php5/cgi/php.ini

date.timezone = Europe/Brussels

create database homeautomation;
create user 'homeautomation'@'localhost' identified by 'tellstick';
grant all privileges on homeautomation.* to 'homeautomation'@'localhost' with grant option;

After a while of not getting the times events to work I noticed that the time setting on the BeagleBoard was of because it was set to the wrong timezone. If you need to update the timezone setting in Ubuntu on the command line use this command.

dpkg-reconfigure tzdata

Links:[edit]

https://wiki.ubuntu.com/Lighttpd%2BPHP
http://www.ubuntugeek.com/lighttpd-webserver-setup-with-php5-and-mysql-support.html



Some ideas on HomeAutomation development can be found here: