Repository navigation
Installation
The requirements for this project are very low and not at all CPU, Memory or Storage intensive. It can run along side your desktop, in a virtual machine or on a low powered standalone box like a Raspberry Pi Zero.
At it's most basic all it needs is a working Apache installation with PHP installed with the xml and curl extensions
While this project will most likely run with any webserver that works with PHP it has only been tested in environments running Apache
If you don't want to dedicate a whole a box to this project:
- It is known to work well on the XAMPP Platform. As that is where it was originally developed. It can easily be run on server you may already have running other services.
- It has also been tested running in a Hyper-V VM
If you wish to run it on a Raspberry Pi we have a walk through for setting up a new system
These instructions assume installation on a Raspberry Pi setup as described in our walk through. Other Linux/Debian type operating systems will be similar
sudo apt install git
Change to your home directory
cd /home/pi
Clone the repository
git clone https://github.com/bren1818/TCPLightingWebInterface.git
You now have a copy of the base website
Change to the public_html of your virtual host if you created one i.e.
cd /var/www/html/lighting.local/public_html
or the default html directory if you didn't
cd /var/www/html/
copy the cloned project to this directory
cp -R /home/pi/TCPLightingWebInterface/* .
Edit the variables inconfig.inc.php as described in the config.inc.php Customization section below
vi config.inc.php
If you plan to use the IFTT Integration also copy the .htaccess file
cp -R /home/pi/TCPLightingWebInterface/.htaccess .
Edit .htaccess as described in the IFTT Integration documentation
vi .htaccess
Create blank config files and make them writeable by the web server
touch tcp.token
chmod 777 tcp.token
touch sched.sched
chmod 777 sched.sched
touch schedule.actioned
chmod 777 schedule.actioned
If you installed XAMPP using the defaults it created your document root at C:\xampp\htdocs
Download a copy of the project

Extract the files and place them in your document root. The htdocs folder should look something like

Edit the variables in config.inc.php as described in the config.inc.php Customization section below
If you plan to use the IFTT Integration edit .htaccess as described. Otherwise delete it
To achieve local control of your lights generally only one variable must be edited
define("LIGTHING_BRIDGE_IP", "192.168.1.TCP");
Edit 192.168.1.TCP to be the address of TCP Connected Bridge
If you want to test or only intend to use local control you can jump to Syncing the Gateway
Unless otherwise noted Variables are boolean values. (0 & 1)
All Variables have comments describing their function extended descriptions will listed below for a few of them
-
define("LOCAL_URL", "http://localhost");- If you have completed the Advanced Server setup you will want to change this url to the one you defined in the virtual host setup i.e. http://lighting.local
-
define("USE_TOKEN_FILE", 1);- If you would rather not use an external file to hold the token set this value to 0
- When you run the gateway sync you will need to populate
define("TOKEN", "PASTE_TOKEN_HERE_IF_NOT_USING_TOKEN_FILE");with the code that is generated
Variables related to IFTTT Integration and the Scheduler are described in the setup information for those functions
Once the files are installed open the URI of your new server in your browser of choice i.e. http://192.168.1.4
You should see an image like the one below.


-
Additional Project Information