Get started with heimcontrol.js on your Raspberry Pi
heimcontrol.js has two dependencies: Node.js and MongoDB. Unfortunately, neither are currently available in the Raspbian repositories.
This can be dealt with in several ways, each of which has benefits and trade-offs:
The first two options are described below.
First, install the following packages, which are required for the compilation.
You may also want to use tmux:
Now, if your SSH connection is interrupted, you can reconnect and use tmux attach
to continue the shell session.
The next step is to compile and install Node.js on your Raspberry Pi from the official sources:
Try node --version
— it should of course output the version.
If you are using a Raspberry Pi with 256MB RAM, then you have to edit the file /etc/dphys-swapfile
and change the value of CONF_SWAPSIZE
from 100
to 200
.
You can find a Raspberry Pi version of MongoDB on GitHub: Rick Pannen’s mongopi has been working well, despite having been last updated in 2012.
With the following command you can build an install it:
Now add the MongoDB binary directory to the PATH
, for example by adding the following to /etc/environment
:
Finally you have to create a MongoDB user, the MongoDB database directory, and an init script:
If the service starts successfully, you can move on to installing heimcontrol.js.
Once again the disclaimer: You should be aware that installing packages from untrusted third parties is dangerous. The sources listed below do work and appear safe at the time of this writing, but the contents could change anytime.
So if you’re using heimcontrol.js for something mission-critical, a) tell us what — because that sounds cool! — and b) compile everything yourself from official sources.
With that out of the way, the actual installation is really easy: Simply download and install node_arm by Nathaniel Johnson and mongodb-armhf-deb by Tom Janson as follows:
If the node binary is present (and returns the expected version) and the MongoDB service starts successfully, you’re all set. (If not, please file an issue.)
You only have to clone the GitHub repository and run npm install
to install homecontrol.js:
(If you have Python 3 installed, run npm config set python python2.7
to make node-gyp play along.)
Now you can run heimcontrol.js by typing node heimcontrol.js
.
Generation of the API description and the gh-pages.
The source code documentation is automatically generated using YUIDoc. You can find the latest documentation here: /heimcontrol.js/api/index.html
Or you can generate the documentation from the source code.This will generate the documention in the docs
directory of the project.
The gh-pages that you are currently reading can be found in the gh-pages
branch of the project. They are generated from Jade-Templates using http://jnordberg.github.com/wintersmith/. To regenerate the documentation cd in your heimcontrol.js repository and type: