Demo sites:
- http://dev.thebedlab.com/~martin/brewmonitor/ (PHP - Stable)
- http://dev.thebedlab.com/brewmonitor/ (Node - Unstable)
- http://www.pjrc.com/teensy/td_libs_OneWire.html
- http://milesburton.com/Main_Page?title=Dallas_Temperature_Control_Library
- PHP Backend
- http://dev.thebedlab.com/~martin/brewmonitor/api/help (to be added but this is a placeholder)
- http://dev.thebedlab.com/~martin/brewmonitor/api/readings (GET)
- http://dev.thebedlab.com/~martin/brewmonitor/api/readings (POST)
- as URL parameters
http://dev.thebedlab.com/~martin/brewmonitor/api/readings/?device=1&temp=20.0&heaton=1.0
- Node.js Backend
- http://dev.thebedlab.com/brewmonitor/api/v1.0/help
- http://dev.thebedlab.com/brewmonitor/api/v1.0/list (GET)
- http://dev.thebedlab.com/brewmonitor/api/v1.0 (POST)
{ "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/
- Install apache2 mysql php5 php5-mcrypt php5-apache2 php5-zip php5-mysql php5-pdo-mysql phpmyadmin composer
composer self-updatecomposer global require "laravel/installer=~1.1"- add ~/.composer/vendor/bin to $PATH in .bash_profile
cd Backendwget https://github.com/laravel/laravel/archive/master.ziprm -r laravelunzip master.zipmv laravel-master laravelcd laravelgit checkout .composer installcd ../../Frontend/brewmonitor/jsmkdir graphingcd graphingwget 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- Configure your username/password settings in
Backend/laravel/app/config/database.php - Create database table and seed it with some sample data
- Use phpmyadmin to create table called
brewmonitor cd Backend/laravelphp artisan migratephp artisan db:seed
- Use phpmyadmin to create table called
- That's it! You should now be able to see a graph in your browser at http://domain/Frontend/brewmonitor/ once apache2 and mysql are running
Make sure Mongo is installed and running. A dump of the DB was created in Backend using:
cd Backend
mongodump -d brewThis can be loaded locally using:
cd Backend
mongorestoreDownload 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.jsIf 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/brewmonitorYou can do this using:
a2enmodand/etc/apache2/sites-enabled/000-default.conf(Ubuntu)- Or all in your
httpd.conffile by adding the text as above (codio.com) - Either way, remember to restart Apache afterwards so that the settings can take effect
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.shThis 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