Installation

Node.js Installation

First you need to install node.js which includes the package manager npm. The minimum version required for pimatic to run is version 4.6.x. If you are on v4 the recommended version is version 4.9.1. Otherwise, it is recommende to install the current LTS version (version 10.16.0 at the time of writing). If you are on the Raspberry Pi and running the standard Raspbian distribution you can use the following installation procedure. If you prefer using the package manager see "Installing Node.js via package manager" for details.

Pi Model A, B, B+ or Zero

wget https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-armv6l.tar.gz -P /tmp
cd /usr/local
sudo tar xzvf /tmp/node-v10.16.3-linux-armv6l.tar.gz --strip=1

Pi 2 Mode B or Pi 3 Model B

wget https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-armv7l.tar.gz -P /tmp
cd /usr/local
sudo tar xzvf /tmp/node-v10.16.3-linux-armv7l.tar.gz --strip=1

To install node on another platform than Raspberry Pi have a look at installing Node.js via package manager.

Check you Node.js version with:

/usr/bin/env node --version

Node.js Upgrade

If you plan to update your Node.js installation to a new major version at some point in time you need to completely reinstall pimatic. The recommended procedure is as follows:

cd /home/pi/pimatic-app/node_modules/pimatic
sudo npm unlink
cd /home/pi
sudo npm unlink pimatic
sudo rm -rf pimatic-app
sudo apt-get remove nodejs
sudo apt-get autoremove
sudo apt-get autoclean
sudo node_modules/pimatic/pimatic.js

pimatic Installation

You must have the gcc compiler or some other suitable compiler installed. Moreover, you need to have git installed. On Debian-based systems run:

sudo apt-get update
sudo apt-get install build-essential git

Once node.js and npm are installed you can run

cd /home/pi
mkdir pimatic-app
npm install pimatic --prefix pimatic-app --production

to install the pimatic framework.

Copy the default config file:

cd pimatic-app
cp ./node_modules/pimatic/config_default.json ./config.json

You should end up with these files in your pimatic-app directory:

config.json

the config file

node_modules

directory for the framework and plugins

node_modules/pimatic

the pimatic framework files

Now, you need to set the password for the admin user. Open the file config.json using a text editor (e.g., nano) and search for the string "users". Then, change the value of the password property for user "admin" below.