For Part 2 you will either need two seperate machines, one with the ebusd configured in part 1 and a second with the LAMP stack installed. Or you can just have one machine with both, however I would suggest you use the Raspberry PI 2 or better or use a Raspberry PI for the ebus interface and ebusd software and a 2nd faster machine running Debian or Ubuntu for the Web/MySQL server with the full LAMP stack installed.
- git clone https://github.com/john30/vwmon
- cd vwmon
- gcc vwmon-client.c http_fetcher.c http_error_codes.c -o vwmon-client
- mkdir /usr/bin/vwmon
- cp vwmon-client /usr/bin/vwmon
- mkdir /etc/vwmon
- cp vwmon-client.cfg /etc/vwmon
- Now edit vwmon-clieng.cfg. You now need to change the following values:
Error_Email (Your email address to send errors to, you need to install and configure postfix to relay emails first!),
VWMonServer_URL (URL of the server with Apache/LAMP stack installed and php configured), VWMonServer_Key (this server key is a passcode that needs to match the key in vwmon-server.php, so you need to change the key in both!)
At the bottom are commands for your device that will be queried. These will need to be amended for your own devices. HINT: look at your csv files. However, the same named field needs to exist in your MySQL Database table vwmon_history. So if you change the name you need to add/change the field in that table as well otherwise it won't work.
Import the sql database file into MySQL. You will need to create the vwmon database and give the vwmon user permissions to read and write to it. Then import the sql database from
Now run vwmon-client to test with verbose output:
/usr/bin/vwmon/vwmon-client -v -c /etc/vwmon/vwmon-client.cfg -r 0
- Now, if everything has been configured correctly, ebusd should now be run by vwmon-client and you should get data in the MySQL table. If it all works, you can then let it run in the background:
/usr/bin/vwmon/vwmon-client -c /etc/vwmon/vwmon-client.cfg &
You will want to configure vwmon-client to start at boot time, perhaps via a cron job.
- Now you want to copy the vwmon-control.php and vwmon-server.php files to your web server, the one you specified in the vwmon-client.cfg file. You will need to edit the php files to enter the correct information such as
$db_host, $db_name, $db_user, $db_pass,
mypass (you need to set passwords for user1 and user2 or it will fail)
$serverkey (Set it to the same key that you set on vwmon-client.cfg)
Then in your Web Browser enter the URL:
Then enter your credentials you set.