Domotiga/Clients

Webclient

Installation of webclient

I have build an webclient using apache and PHP5 to display device status using ajax, json and xmlrpc, resulting in on-the-fly page updates without refreshing. Very spiffy if I may say so myself ;-)

NOTE: you need to run DomotiGa 0.1.163 and Gambas 2.12 minimal.

To use it you need an apache or lighttpd server configured with the right modules. Read [here] how to install one of these. Next you need to copy the file inside webclient to a directory below you web root.

For example domotiga, so you can access it by browsing to  http://yourserver.org/domotiga

NOTE: The directory /var/www is the default webroot for Ubuntu.

$ sudo cp -r domotiga/webclient /var/www/domotiga

Next setup Apache user authentication, very important since the webclient nor DomotiGa's xml-rpc server have a buildin authentication mechanism!

Create an auth file to store users and passwords in, and create a guest user:

$ sudo htpasswd -c /var/users guest
New password:
Re-type new password:
Adding password for user guest

Now make sure you have checked the contents of the htaccess.example file inside /var/www/domotiga And rename it to the correct filename to activate it (notice the point before htaccess!)

$ cd /var/www/domotiga
$ sudo mv htaccess.example .htaccess

NOTE: I have to check how this works with lighttpd.

Now edit the config.php.example file, and set the connect string to point to your domotiga server and correct port:

$ sudo vi config.php.example
..
$rpc_connect="http://192.168.100.2:9009";
..

Or point it to localhost if you run it on the same server:

$ sudo vi config.php.example
..
$rpc_connect="http://127.0.0.1:9009";
..

Then rename it to activate it:

$ sudo mv config.php.example config.php

You should now have a working web client! Browse to the url above and you should get a login window first.

It only contains a device status page for now, but I will expand it for sure, tips and suggestions are welcome!