6. Setup a webpage that allows visitors to see and control your lights

In order for people to view and control your lights, you need a webpage for them to visit.  You'll need the following:

1. A basic web hosting package that supports PHP.  Most basic hosting packages support this.  Don't choose a Microsoft/IIS hosting package as it may not support PHP.

NOTE: PHP v7.0 or higher is required.  As of this writing, the website code has been tested and works with PHP v7.4.22. 

2. A domain name for your website.

 

Once you have a website, download the control system here.  Unzip this file into a folder on your computer.

 

In this folder, edit the following files:

 

SEQUENCES.TXT

In this file, list all of the sequences that you are using.  Each line contains four parts, separated by commas. 

  1. The first part is an informal name of your sequences that website visitors will see.  For instance, if your sequence named silentNight.fseq, this first part can be called "Silent Night". 

    NOTE: Do not use commas in the informal name!   Spaces are OK, though.

  2. The second part is the filename of a small graphic/icon that represents your sequence.  This can be in JPG or PNG format.



  3. The third part is the exact name of your sequence, such as "silentNight.fseq".

    NOTE: Sequence names are case sensitive!  Type the sequence filename exactly as it is shown in Falcon Player.  Also, sequence name must not contain commas nor spaces.

  4. The fourth part is the media file that (optionally) accompanies the sequence, such as "silentNight.mp3" for an audio file.  Video media files (such as .mp4) are also permitted.

    NOTE: Media filenames are case sensitive!  Type the media filename exactly as it is shown in Falcon Player.  Also, media filename must not contain commas nor spaces.  

    NOTE: If your sequence does not use a media file, enter "none" for the media filename.


  5. The fifth part is the length of the sequence, in seconds.  You can get this information while viewing your sequence in xLights.

 

Here is an example of a sequence.txt file:

Silent Night,sequencePics/silentNight.png,silentNight.fseq,silentNight.mp3,30
Jingle Bells,sequencePics/jingleBells.png,jingleBells.fseq,jingleBells.mp3,20
Hark The Herald Angels Sing,sequencePics/harkHeraldAngelsSing.png,harkHeraldAngelsSing.fseq,harkHeraldAngelsSing.mp3,35
Santa Claus Is Comin To Town,sequencePics/santaClausIsCominToTown.png,santaClausIsCominToTown.fseq,santaClausIsCominToTown.mp3,25

 

Next, save the graphic/icon's JPG/PNG files from Step 2 to the sequencePics folder.

 

INDEX.PHP

In this file, you can change the title of the webpage from "Tom's Internet Controlled Christmas Lights" to something else.  This is at line 26.  You can edit other text that appears on the front page as well, using basic HTML programming skills.  If you are not sure how to do this, contact me and I'll help. 



NOTE: Be very careful when editing this file, as errors/typos can break the entire voting system!  In particular, do not modify anything within the "<? php" and "?>" sections nor within the "<iframe>" sections.

This file also defines the video feed address so that website visitors can see your lights via a webcam.  This is at line 156.  In my scenario, I have a network/IP camera that sends a video feed to www.twitch.tv, using a free account that I created there.  The Twitch video feed can be embedded right into your website control webpage, using a command like this:

src="https://player.twitch.tv/?channel=tominohio&parent=itwinkle.org"



This was explained in detail earlier in these instructions.

Note: Twitch requires that your Internet control website has SSL (HTTPS) enabled.

 

HIDDEN.PHP

In this file, you can choose when to disable Internet control of your lights.  By default, the lights are controllable from Thanksgiving Day to the second full week of January, from 6:00-11:30 p.m.  This can be changed to other dates/times by editing lines 78-122, though it requires knowledge of PHP programming.  If you are not sure how to do this, contact me and I'll help. 

NOTE: Be very careful when editing this file, as errors/typos can break the entire voting system!  In particular, do not modify anything within the "<? php" and "?>" sections.

 

PREPLAYACTIONS.PHP

If you are using sequences with music, most likely you are using MP3 files stored on Falcon Player for playback.  The website control system defaults to MP4 audio files, so you will need to change ".mp4" on line 189 to ".mp3" instead.


NOTE: Be very careful when editing this file, as errors/typos can break the entire voting system!  In particular, do not modify anything within the "<? php" and "?>" sections.

 

VOTEACTION.PHP

The Internet is full of "bots" which are computer programs that constantly scan websites, stealing email addresses and clicking links as if they are real people.  The voting system includes an "anti-bot" feature to prevent bots from creating fake votes.  The first time someone attempts to vote, he/she is challenged for a passphrase.  Once a correct passphrase is entered, they can vote the rest of the day without hassle. 

By default, the passphrase question is "To prove that you are human, please enter the first six letters of CHRISTMAS" and the answer is "Christ".  If you wish to change the question and answer, edit lines 11 & 12 in this file. 

NOTE: Be sure not to change the text outside the quotes, otherwise it can break the voting system!

 

Next, copy the entire folder's contents to your web host via FTP.  In my scenario, I created a folder named "control-lights" on my web host, then copied the contents of the zip file into this folder using FileZilla, a popular FTP program.



At this point, your Internet control webpage is almost ready to use!  To view the website, open a web browser then type your domain name / folder name to view it.  In my scenario, my domain name is www.itwinkle.org and I created a folder for the Internet control system called "control-lights", so I would enter "www.itwinkle.org/control-lights" to view my webpage.  We still need to modify Falcon Player to finish preparing Internet control, as the website and Falcon Player "talk" to each other.

Last modified on Wednesday, 25 August 2021 02:38

Go to top
JSN Boot template designed by JoomlaShine.com