Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdpunkt committed Apr 5, 2014
1 parent bc2230e commit 0fffd01
Show file tree
Hide file tree
Showing 14 changed files with 1,007 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
.idea

pids
logs
results
.idea/
build/
node_modules/

npm-debug.log
npm-debug.log
62 changes: 60 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,60 @@
node-aquastreamxt
=================
Aquastream XT application for Linux
=================================

## Introduction

This is a Node.js application for displaying Aquastream XT pump information, such as water temperature, flow, current frequency, etc.
It is built on top of [node-aquastreamxt-api](node-aquastreamxt-api), which is a native Node.js addon I wrote for communicating with the hardware.

Currently it is *read-only*, so you can't change any settings yet. I still have some problems with writing data to the device but this is planned to be supported some day.

## Installation

This guide is for Debian based distros (Debian, Ubuntu. LMDE/Mint, ...) so you might have to adjust some of the commands if you are on a different box.

### Install g++ if not installed

$ sudo apt-get install g++


### Install Node.js

$ sudo add-apt-repository ppa:chris-lea/node.js
$ sudo apt-get update
$ sudo apt-get install python-software-properties python g++ make nodejs

(See [this manual](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) if you have problems)


### Install module dependencies
`cd` to the directory where you downloaded the `node-aquastreamxt` sources and install it:

$ npm install

This installs all required dependencies (including [node-aquastreamxt-api](node-aquastreamxt-api)).


### Done!
Run the app with

$ node app

and visit [http://localhost:8080](http://localhost:8080) - you should see the interface:

![screenshot](https://github.com/adick/node-aquastreamxt/master/screenshot.png)


## Troubleshooting

### Error: Couldn't find Aquastream XT!

* Make sure your current system user can access the USB device. On debian systems this can be done using an udev rule.
Create a new file `99-hiddev.rules` in `/lib/udev/rules.d/` with the following contents:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0c70", ATTRS{idProduct}=="f0b6", MODE="0666"


* reload udev system, if this doesn't help maybe a reboot is required

sudo udevadm control --reload-rules
sudo udevadm trigger
58 changes: 58 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* App
*
* @package node-aquastreamxt
* @author Alexander Dick <[email protected]>
*/
aquastreamApi = require('node-aquastreamxt-api');
conf = require('nconf');
fs = require('fs');

var express = require('express'),
http = require('http'),
socketio = require('socket.io'),
routes = require('./routes'),
path = require('path');

// Load config file
conf.file({file: 'config.json'});

app = express();

app.configure(function() {
app.set('port', conf.get('server:port'));
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
});

app.get('/', routes.index);

app.post('/config', function(req, res) {

var key = req.body.key;
var value = req.body.value;

conf.set(key, value);
conf.save();

res.send(conf.get());

});


var server = http.createServer(app).listen(app.get('port'), function(){
console.log("Server listening on port " + app.get('port'));
});

io = socketio.listen(server, {
log: false
});

io.sockets.on('connection', function (socket) {

});
23 changes: 23 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"server": {
"port": 8080
},
"ui": {
"updateInterval": 5000,
"chart": {
"period": 60
}
},
"aquastreamXt": {
"vendorId": "0x0c70",
"productId": "0xf0b6",
"report": {
"pumpDataTransfer": 4,
"settings": 6
},
"flowSensor": {
"impulsesPerLiter": "169",
"measuringImpulses": "8"
}
}
}
21 changes: 21 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "node-aquastreamxt",
"description": "Application for displaying Aquastream XT Pump information",
"version": "0.0.1",
"repository": {
"type": "git",
"url": "https://github.com/adick/node-aquastreamxt.git"
},
"private": false,
"scripts": {
"start": "node app"
},
"dependencies": {
"node-aquastreamxt-api": "git://github.com/adick/node-aquastreamxt-api.git",
"express": "3.5.1",
"jade": "1.3.1",
"ejs": "1.0.0",
"socket.io": "0.9.16",
"nconf": "0.6.9"
}
}
30 changes: 30 additions & 0 deletions public/css/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Some basic styles
*
* @package node-aquastreamxt
* @author Alexander Dick <[email protected]>
*/

.table th {
text-align: left;
}

.flow-sensor {

}

.flow-sensor fieldset {
border: 1px solid #ddd;
}

.flow-sensor legend {
display: inline;
width: auto;
margin: 0 20px;
padding: 0 5px;
border-bottom: 0;
}

.flow-sensor select {
width: auto;
}
Binary file added public/images/pump.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0fffd01

Please sign in to comment.