This WeekTimer project has 3 parts.
In this example I have put the webserver, mosquitto and gpio weektimer in a raspberry pi, and the nexa weektimer on a random pc on the same network.
But you could put it all on the Raspberry PI.
Follow all the instructions on the mosquitto page.
Please note that you need a version of mosquitto that is compiled with web socket support, and since websockets support in mosquitto is experimental it is not used in most prebuilt packages. This is the reason why I use a build-script to build mosquitto.
Install and configure lighttpd as webserver.
cd ~/funtech/FT_Tools/ sudo ./pkg.raspian.lighttpd.sh sudo adduser $USER www-data
Then check so the webserver is running either with your pc, or locally with curl, you should see a "placeholder page".
Activate group settings (restart the system).
Then put FunTechHouse_Web project in the www dir and use it.
cd /var/www git clone firstname.lastname@example.org:jsiei97/FunTechHouse_Web.git funweb chown -R $USER.www-data funweb/ sudo sed -i 's/\"\/var\/www\"/\"\/var\/www\/funweb\"/g' /etc/lighttpd/lighttpd.conf sudo service lighttpd force-reload
Now check that lighttpd loads FunTechHouse_Web and not the "placeholder page".
Then we can get the WeekTimer that is using gpio over sysfs.
cd ~/funtech/ git clone email@example.com:jsiei97/FunTechHouse_WeekTimer_Nexa.git -b sysfs_gpio WeekTimer_gpio cd WeekTimer_gpio git submodule init git submodule update
qmake make -j
For now start it with.
Now you can go over to the webpage and talk to him...
The WeekTimer has a focus on what day of week it is, and has an option to force it either on or off for a specified time.
The basic timer is programmed by a couple of "timer lines", where each "line" has a starting day of week, hour, minute and a ending day of week, hour, minute. Each "line" is then separated from each other with a ';'.
Valid wildcards for day of week.
|1..7||mon to sun|
|8||mon to fri aka weekday|
|9||sat to sun aka weekend|
A timer that is on all weekends between 21:00 and 22:30 would look like.
And if we also would like it to be on during Friday nights, we would add another line.
Then let's say you would like it turn be on all mornings between 7 and 9, we would add.
9:21:00-9:22:30; 5:21:00-5:22:30; 0:07:00-0:09:00;