Skip to content

Manual Installation (Linux)

Claudio Prezzi edited this page Nov 13, 2023 · 8 revisions

Install Node 12.x

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

Confirm you have the correct Node and npm version

node -v

NodeJS version should be >= 12.22.5

npm -v

NPM version should be >= 6.14.15

Install git

sudo apt-get install git

Install Chromium

sudo apt install chromium

Download & install LaserWeb

cd /home/pi
git clone https://github.com/LaserWeb/lw.comm-server.git
cd lw.comm-server
sudo npm audit fix
sudo npm install

Manually start the server

cd /home/pi/lw.comm-server
node server.js   

You should get the following console response:

***************************************************************
        ---- LaserWeb Comm Server 4.1.000 ----
***************************************************************
  Use  http://192.168.1.100:8000 to connect this server.

* Updates:
  Remember to check the commit log on
  https://github.com/LaserWeb/lw.comm-server/commits/master
  regularly, to know about updates and fixes, and then when ready
  update accordingly by running git pull

* Support:
  If you need help / support, come over to
  https://plus.google.com/communities/115879488566665599508
***************************************************************

Press CTRL-C to stop the server. Now that you know it's working, you can setup the autostart of the service.

Setup Systemd to automatically start the server

# Move to the directory with the .service file
cd ~/lw.comm-server/

# Create the symlink
sudo ln -s `pwd`/lw.comm-server.service /etc/systemd/system

# Reload the service files so the system knows about this new one
sudo systemctl daemon-reload

# Enable and start the service
sudo systemctl enable lw.comm-server.service
sudo systemctl start lw.comm-server

You can check the status of the server with

sudo systemctl status lw.comm-server

You can restart the server with

sudo systemctl restart lw.comm-server

You can stop the server with

sudo systemctl stop lw.comm-server

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

USB access rights

On most Linux distros you need to give your user "dialout" rights to be able to access a USB/serial port. The following command adds a user to the dialout group:

sudo adduser {username} dialout

Replace {username} with the user under which the LaserWeb server is running.

Start the frontend

  • Connect your machine to one of the USB ports
  • Open Chromium on the LaserWeb server or any other PC in your network.
  • Open the URL serverIP:8000 (replace serverIP with the IP of your LaserWeb server)
  • Click on Comms tab
  • Click on "Server Connection"
  • Change Server-IP to serverIP:8000 (replace serverIP with the IP of your LaserWeb server)
  • Click connect

-> You should see a green message "Server connected" in the log area at bottom right.

Then:

  • Set the "Machine Connection" dropdown to USB
  • Choose the correct serial port in the "USB / Serial Port" dropdown (e.g. /dev/ttyACM0)
  • Check that the baud rate is set correctly (as in the firmware)
  • Click connect below

-> You should get a green message "Machine connected" in the log area, followed by a green line with the detected firmware. If you get some red messages insted of the green firmware line, you probably have selected the wrong port or the firmware is not supported.