Skip to content

Backend framework making Velbus accessible using Web Sockets

License

Notifications You must be signed in to change notification settings

pdpotter/node-velbus-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-velbus-server

This project should be used in combination with a client, such as node-velbus-client.

Supported modules

Installation on Raspberry Pi

Using Raspbian Jessie Lite (download, installation, expand filesystem, update, static IP address)

Install node (LTS version)

# add nodejs repository
echo 'deb https://deb.nodesource.com/node_4.x jessie main' | sudo tee --append /etc/apt/sources.list.d/nodesource.list
# add nodejs repository key
wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
# enable https repositories
sudo apt-get install apt-transport-https
# update installation sources
sudo apt-get update
# install nodejs
sudo apt-get install nodejs

Install node-velbus-server

# update installation sources
sudo apt-get update
# install git
sudo apt-get install git
# clone this project
git clone https://github.com/pdpotter/node-velbus-server.git
# install dependencies
$(cd node-velbus-server; npm install)
# install initial config
$(cd node-velbus-server/server; cp config.sample.js config.js)

Update node-velbus-server

If node-velbus-server is running as a daemon (see below), stop the daemon before updating and start it again after updating.

# update node-velbus-server
$(cd node-velbus-server; git pull)
# update dependencies
$(cd node-velbus-server; npm install)

Configure node-velbus-server

The server can be configured by editing the settings in node-velbus-server/server/config.js. The default settings are:

(function() {
  exports.velbus = {
    device: '/dev/ttyACM0'
  };

  exports.websocket = {
    port: '8001'
  };

}).call(this);

Device

Check which device the Velbus is connected to by checking the results of

ls /dev/ | grep ttyACM

If necessary, edit the velbus.device setting (the default value is ttyACM0).

Websocket port

The port on which node-velbus-server is reachable using a websocket can be changed by editing the websocket.port setting (the default value is 8001).

Run node-velbus-server as a daemon

(based on init-script-template)

If node-velbus-server was not installed in the home directory of the pi user, update the dir setting on line 12 in node-velbus-server/daemon/node-velbus-server accordingly.

# copy daemon file
sudo cp node-velbus-server/daemon/node-velbus-server /etc/init.d
# make it executable
sudo chmod 755 /etc/init.d/node-velbus-server

To start the daemon, execute

sudo /etc/init.d/node-velbus-server start

To stop the daemon, execute

sudo /etc/init.d/node-velbus-server stop

To run the daemon on startup, execute

sudo update-rc.d node-velbus-server defaults

About

Backend framework making Velbus accessible using Web Sockets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published