Direkt zum Hauptinhalt

Raspberry Pi 4 Model B "cnc-pi" - Basic Setup

Konfigurationsübersicht Raspberry Pi:

  • Modell: Raspberry Pi 34 Model B
  • Architecture: armv71 (32 Bit) / armel
  • OS: RasbpianRasbperry GNU/Linux (buster)Pi Desktop
  • Festplatte: 16 GB SHDC Karte
  • Hostname: "cnc-pi" (original: "raspberrypi")
  • SSH-Port: 22
  • Setup: by Mathieu Ermuth und Mario Voigt
  • Letztes Image:  03.09.2025

Konfiguration

bCNC physischer Monitor

Setup
modesudo "1280x1024"mkdir geometry-p 1280/opt/bCNC/
1024sudo 1280chown 1024$USER:$USER 32/opt/bCNC/
timingscd 0/opt/bCNC/
0python3 0-m 0venv 0venv
0./venv/bin/pip3 0install rgba--upgrade 8/16,8/8,8/0,8/24git+https://github.com/vlachoudis/bCNC
endmode

Desktop Icon

vim /home/$USER/Desktop/bCNC.desktop
[Desktop Entry]
Encoding=UTF-8
Exec=/opt/bCNC/venv/bin/bCNC
Icon=/opt/bCNC/venv/lib/python3.11/site-packages/bCNC/icons/bCNC.gif
Categories=Graphics;Office;
Comment=Open-source 2D plotting software
MimeType=image/svg+xml;
Keywords=cutter;cnc;2D;3D;
Type=Application
Terminal=false
Name=bCNC
GenericName=bCNC
StartupNotify=false
chmod +x /home/$USER/Desktop/bCNC.desktop

Setup VNC Server / Desktop Environment

VNC

TODO Server

sudo apt install xfce4 xfce4-goodies tightvncserver
vncserver #set a secure password
vncserver -kill :1
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
vim ~/.vnc/xstartup
#!/bin/bash
xrdb $HOME/.Xresources
startxfce4 &
sudo chmod +x ~/.vnc/xstartup
mv ~/.vnc /home/flcuser/
vim /etc/systemd/system/vncserver@.service
[Unit]
Description=Start TightVNC server at startup
After=syslog.target network.target

[Service]
Type=forking
User=flcuser
Group=flcuser
WorkingDirectory=/home/flcuser/
#PAMName=login
PIDFile=/home/flcuser/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x1024 :%i
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable vncserver@1.service

Set GPU memory to maximum for fluent display

sudo raspi-config
#1. set GPU memory to 256 MB
#2. set boot to GUI + automatic login with user "pi"
#3. enable VNC server

sudo reboot

Add special user desktop user

wayvnc

The standard raspberry pi has sudo rights. He should not be accesible because the user is logged in into an open environment with mouse and keyboard.

sudo adduser --gecos "" -uid 4444 flcuser

usermod -a -G dialout,cdrom,audio,video,plugdev,input,netdev,spi,i2c,gpio flcuser #required for USB access for example

Configure autologin for "flcuser" user

Change the name "pi" to "flcuser" each

vim /etc/systemd/system/autologin@.service
vim /etc/lightdm/lightdm.conf