workbee_cnc_router

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
workbee_cnc_router [09.08.2020 15:08] – [Workbee CNC Router] Pascal Suterworkbee_cnc_router [09.08.2020 23:32] Pascal Suter
Line 63: Line 63:
   * [[https://github.com/cncjs|CNC.js]] - nice web gui, touch probe support, "pendants" which are small ui's for small devices like phones etc. server can be run on a raspberry pi   * [[https://github.com/cncjs|CNC.js]] - nice web gui, touch probe support, "pendants" which are small ui's for small devices like phones etc. server can be run on a raspberry pi
   * [[https://github.com/vlachoudis/bCNC|bCNC]] - basic CAM built in, accepts not only gcode but also svg and dxf. curretly i do the CAM work on fusion 360 which is nice, but it might be simpler to have it integrated into the gcode sender, so it can be modified easily while standing at the machine.. the Fusion 360 interface needs quite a big screen to work with it smoothly and simple changes like changing the cutting speed means saving re-opening files etc. all the time.    * [[https://github.com/vlachoudis/bCNC|bCNC]] - basic CAM built in, accepts not only gcode but also svg and dxf. curretly i do the CAM work on fusion 360 which is nice, but it might be simpler to have it integrated into the gcode sender, so it can be modified easily while standing at the machine.. the Fusion 360 interface needs quite a big screen to work with it smoothly and simple changes like changing the cutting speed means saving re-opening files etc. all the time. 
 +
 +===== CNC.js =====
 +i've decided to try CNC.js. I am installing it on a Raspberry PI 3 (because i had one laying around). the idea is, to get the raspberry as close as possible to the grbl to keep the USB cable as short as possible. I've read that communications issues on the USB link cause by interference could cause the hang-ups i saw with UGS. in any case, the size of the raspberry makes it a practical choice anyway :) 
 +
 +so first i installed raspberry OS, there is pre-built rasbperry image from CNC.js but it has not been updated in the last two years, so I decided to go with a manual install. 
 +
 +here are the steps i went through: 
 +
 +[[install_raspbian_on_f2fs_root]] with my script, set wifi and hostname and enable ssh so we don't need to connect a screen to it ever :) 
 +
 +install git
 +  sudo apt update
 +  sudo apt install git
 +
 +install cncjs with npm which is installed via nvm. basically, just follow the instructions on the [[https://github.com/cncjs/cncjs|CNC.js github page]]
 +
 +create a systemd service that will start cncjs automatically: 
 +  sudo nano /etc/systemd/system/cncjs.service
 +here are the contents of the startup script:
 +<code>
 +[Unit]
 +Description=CNCjs
 +
 +[Service]
 +ExecStart=/bin/bash -c -l cncjs
 +Restart=always
 +RestartSec=10
 + # Output to syslog
 +StandardOutput=syslog
 +StandardError=syslog
 +SyslogIdentifier=cncjs
 +User=pi
 +Group=pi
 +
 +[Install]
 +WantedBy=multi-user.target
 +</code>
 +nwo start it: 
 +  sudo systemctl daemon-reload
 +  sudo systemctl --now enable cncjs
 +  systemctl status cncjs
 +
 +this should show that it's running now and you should be able to access it on port ''8000'' of your raspberry
 +
 +i'm lazy, so i don't want to type that port 8000 all the time, let's add a redirect using ''lightthpd'': 
 +
 +<code>
 +sudo apt install lighttpd
 +cd /etc/lighttpd
 +sudo nano conf-available/10-redirect.conf
 +</code>
 +put this in there: 
 +<code>
 +$HTTP["scheme"] == "http" {
 +    # capture vhost name with regex conditiona -> %0 in redirect pattern
 +    # must be the most inner block to the redirect rule
 +    $HTTP["host"] =~ ".*" {
 +        url.redirect = (".*" => "http://%0:8000$0")
 +    }
 +}
 +</code>
 +activate the config and restart the service
 +  cd conf-enabled
 +  sudo ln -s ../conf-available/10-redirect.conf
 +  sudo systemctl restart lighttpd.service
 +now you should be able to simply access the cncjs gui by entering the hostname of your raspberry in your browser
  
  • workbee_cnc_router.txt
  • Last modified: 23.12.2021 21:14
  • by Pascal Suter