Homepage: http://thebedlab.com/brewmonitor-the-arduino-and-cloud-based-homebrewing-controller/
Demo sites:
http://dev.thebedlab.com/~martin/brewmonitor/api/readings/?device=1&temp=20.0&heaton=1.0
{ "userid": 0, "devid": 0, "temps": [{"sensid": 0, "temp": 20.2}, {"sensid": 1, "temp": 20.8}], "timestamp": "2014-11-15T16:56:08.506Z" }
First thing to do is to clone this repository. All paths are given relative to the root of the repository. From here on it is also assumed that the root of the repository will show up at http://domain/
composer self-update
composer global require "laravel/installer=~1.1"
cd Backend
wget https://github.com/laravel/laravel/archive/master.zip
rm -r laravel
unzip master.zip
mv laravel-master laravel
cd laravel
git checkout .
composer install
cd ../../Frontend/brewmonitor/js
mkdir graphing
cd graphing
wget http://dev.thebedlab.com/~martin/brewmonitor/js/graphing/angular-moment.min.js; wget http://dev.thebedlab.com/~martin/brewmonitor/js/graphing/angular-moment.min.js.map; wget http://dev.thebedlab.com/~martin/brewmonitor/js/graphing/line-chart.min.js; wget http://dev.thebedlab.com/~martin/brewmonitor/js/graphing/moment.min.js
Backend/laravel/app/config/database.php
brewmonitor
cd Backend/laravel
php artisan migrate
php artisan db:seed
Make sure Mongo is installed and running. A dump of the DB was created in Backend
using:
cd Backend
mongodump -d brew
This can be loaded locally using:
cd Backend
mongorestore
Download and extract node-red zip file from http://nodered.org/ to Backend/node-red
cd Backend/node-red
npm install --production
npm install mongodb
rm settings.js
ln -s ../settings.js
If you have any complications or want to install Additional Nodes, check the instructions on http://nodered.org/docs/getting-started/installation.html
Configure Apache with the following settings:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
ProxyPreserveHost On
ProxyRequests Off
ProxyPass /brewmonitor/comms ws://127.0.0.1:8123/brewmonitor/comms
ProxyPass /brewmonitor http://127.0.0.1:8123/brewmonitor
ProxyPassReverse /brewmonitor http://127.0.0.1:8123/brewmonitor
You can do this using:
a2enmod
and /etc/apache2/sites-enabled/000-default.conf
(Ubuntu)httpd.conf
file by adding the text as above (codio.com)After that, check that your node-red app/server settings match up. This can be found in Backend/settings.js
:
uiPort: 8123,
httpRoot: '/brewmonitor',
You may as well allow AJAX calls from other servers at this point too, if required (Ionic app for instance...)
httpNodeCors: {
origin: "*",
methods: "GET,PUT,POST,DELETE"
},
Make sure MongoDB and Apache are running, then run the following command:
./startNodeRed.sh
This launches the Node-Red server which can then be found at http://domain/brewmonitor/. To run it as a daemon, do the following (sudo may be required for global npm install):
cd Backend/node-red
npm install forever -g
forever start red.js ../BrewMonitor.json