Skip to content
This repository has been archived by the owner on Jan 29, 2018. It is now read-only.

Install: Raspberry Pi (Raspbian)

Claudio Prezzi edited this page Apr 21, 2017 · 5 revisions

Start from a clean Rasbian image, on a Raspberry Pi 2 or 3

Install Node 6.x

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
apt-get install -y nodejs

Confirm you have the correct Node version

npm -v

NPM version should be >= 3.10.10

node -v

NodeJS version should be >= 6.9.4

Install/update git

sudo apt-get update
sudo apt-get install git

Download LaserWeb

cd /home/pi
git clone https://github.com/openhardwarecoza/LaserWeb3.git
cd LaserWeb3
npm install

Manually start the server

cd /home/pi/LaserWeb3
node server.js   

Start the frontend

  • Open Chrome (or Chromium) on any PC in your network.
  • Open URL RasPi-IP:8000 (replace RasPi-IP with the IP of your RasPi)
  • Click on Comms tab
  • Click on "Server Connection"
  • Change Server-IP to RasPi-IP:8000 (replace RasPi-IP with the IP of your RasPi)
  • Click connect

You should see a green message "Server connected" in the log area (bottom right)

Setup Systemd to automatically start the server

First, open laserweb3.service in a text editor and correct the path for node according to your system (probably /usr/bin/node instead of /usr/local/bin/node).

Then, execute the following console commands:

cp /home/pi/LaserWeb3/laserweb3.service /etc/systemd/system/laserweb3.service
sudo systemctl enable laserweb3.service
sudo systemctl start laserweb3

You can check the status of LaserWeb with

sudo systemctl status laserweb3

You can restart LaserWeb with

sudo systemctl restart laserweb3

The logs will get added to /var/log/syslog

Clone this wiki locally