When installing on a Raspberry Pi you first need to ugprade node.js. By default the node package in Raspian is very old:
npm -v
1.4.21
node -v
v0.10.29
To upgrade the RPI to the latest node / npm.
Do not use Node 10 yes! It gives problems with compiling of socket and serial port libraries.
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt install nodejs
The new versions should became: (or higher)
node -v
v9.4.0
npm -v
5.0.3
source: http://thisdavej.com/beginners-guide-to-installing-node-js-on-a-raspberry-pi/
git clone https://github.com/basvdijk/domusto-server.git
DOMUSTO server has some dependencies which needs to be installed.
npm install
Copy the config file template in the src
folder to your own:
cp src/config.example.ts src/config.ts
Edit this config file according your needs.
In order to use the DOMUSTO client ./domusto.js
you need to have Git installed
sudo apt-get install git
If you have multiple USB devices connected, sometimes the order of the USB assignmets change after a reboot e.g. ttyUSB0 is suddenly ttyUSB1 and vice versa.
These pages on the Domoticz wiki show how to solve this issue by assigning fixed ports:
- https://www.domoticz.com/wiki/Assign_fixed_device_name_to_USB_port
- https://www.domoticz.com/wiki/PersistentUSBDevices
npm run start
npm run dev
npm test