Installing LinuxCNC and LitexCNC on a RaspberryPi

This sections describes the steps required to prepare your Raspberry-Pi for running LinuxCNC with the LitexCNC. There are several options for creating images:

  • LinuxCNC 2.9.2 running on Debian Bookworm with the PREEMPT kernel;

  • LinuxCNC 2.9.2 running on Raspbian Bookworm with the RTAI kernel;

  • LinuxCNC 2.8.4 running on Buster (legacy).

Note

This section is currently under development. Not all images are therefore described yet.

LinuxCNC 2.9.2 running on Debian Bookworm with the PREEMPT kernel

This version is fastest to install, as the image has largely already been created by the team of LinuxCNC. You can download the image containing LinuxCNC from their downloads page. The version to use depends on the type of Raspberry Pi:

These .xz files are directly readable by the Raspberry Pi imager application, although the settings from the Raspberry Pi imager, such as WiFi and enabling SSH are not set while flashing. Headless install is therefore not possible and a keyboard and monitor are required for configuration.

For both of these images:

  • User name: cnc

  • Password: cnc

Please run the following from the commandline to configure WiFi, timezones and other data:

sudo menu-config

After configuring the RaspberryPi, LinuxCNC can be installed with the following commands:

sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get install python3-pip python3-wheel python3-venv
python3 -m venv ~/.local --system-site-packages
echo -e "" >> ~/.bashrc
echo -e "# set PATH so it includes user's private bin if it exists" >> ~/.bashrc
echo -e "if [ -d \"$HOME/.local/bin\" ] ; then" >> ~/.bashrc
echo -e "    PATH=\"$HOME/.local/bin:$PATH\"" >> ~/.bashrc
echo -e "fi" >> ~/.bashrc
. ~/.bashrc
pip install litexcnc
litexcnc install_toolchain --user -a arm64
sudo env "PATH=$PATH" litexcnc install_driver
. ~/.bashrc