Hacklab JKL has a 3D printing cabinet with a printer inside and a printer on top. These printers are used by members of the Hacklab for all sorts of projects, and the one inside the cabinet is available for printing remotely (via web). There is a fire alarm inside the 3D printing enclosure which is set up in such a way that in case of a fire, the power to the 3D printers will be shut off. There is also an automatic timer that shuts of the power if 30 minutes passes without any printing going on (more accurately, if the computer is inactive for 30 minutes).

As of 2026-02-12 the timed shutoff is disabled, since it was shutting down the system in the middle of multi hour print jobs.

Note: It’s also possible to use the printers via the buttons on the 3D printers themselves should you wish to do so.

OctoPrint

OctoPrint is a program that lets you print with 3D printers from a computer. That way you don’t have to fiddle around with the buttons on the 3D printer itself, which can be tedious.

Octoprint is installed on the 3D printing computer in /home/octoprint/octoprint-venv.

There are two instances of OctoPrint running on the machine.

Primary: Controls the printer inside the enclosure, and is available for remote printing

Secondary: Controls the printer on top of the enclosure, and is only available from the 3D printing computer

The two instances of OctoPrint start when the machine boots, prompted by the services /etc/systemd/system/octoprint-primary.service and /etc/systemd/system/octoprint-secondary.service.

The OctoPrint server is launched like so: /home/octoprint/octoprint-venv/bin/octoprint -b /home/octoprint/.octoprint-primary

This command launches an instance of OctoPrint which reads configuration and reads/writes data in the specified folder.

The configuration/data folders are /home/octoprint/.octoprint-primary and /home/octoprint/.octoprint-secondary for the primary and secondary instance of OctoPrint, respectively.

Changing the settings of OctoPrint

Sometimes you might want to change the settings of an OctoPrint instance.

Perhaps we are replacing a 3D printer with another and need to change the printer profile and serial connection details, add some special GCODE instructions, etc.

Configuring the OctoPrint instances can be done in two ways, via the GUI or config files.

Via the GUI

1. Click the user button in the top right corner, click Logout

2. Click on ”Login” and log in as the admin user (credentials should be saved in Firefox)

3. Click the spanner symbol to open the settings window.

Via the config files

The config files are located in /home/octoprint/.octoprint-primary and /home/octoprint/.octoprint-secondary, respectively. config.yaml holds most of the settings, but there is also GCODE scripts in /scripts/gcode and printer profiles in /printerProfiles, for example. Edit these files and then restart the octoprint instance with this command

systemctl restart octoprint-primary

Note: This command will switch off and on the power to both printers! Do not do this while someone is printing!

Settings

Printer profiles

A printer profile is a configuration for a printer device defining fields such as print volume and bounding box for the movement of the axes. It can be configured under ”Printer profiles” in OctoPrint or under

/home/octoprint/printerProfiles

Serial devices

The printers are identified by OctoPrint through a serial device id. This can be configured under ”Serial Connection” in OctoPrint, or under the serial field in /home/octoprint-primary/config.yaml. The printers are set up with symlinks so that they can be uniquly identified with a non-changing, human-readable identifier. At the time of writing this is /dev/prusa (the i3 MK3S) and /dev/prusa-mk4 (the MK4).

In order to list these devices, you can run this command:

ls /dev/ttyACM* /dev/prusa* -l

If both printers are connected with USB you should see /dev/prusa and

/dev/prusa-mk4 listed here. If not, try restarting them or unplugging/pluggin the USB back in.

Adding a new serial device

If you have a new printer and wish to add such a symlink, first see if you can find it listed as /dev/ttyACM*, where * is a number.

Then you can run this command to see more details:

udevadm info /dev/ttyACM1

This will list a whole bunch of details about the printer. You will want to take note of the value listed as ID_SERIAL_SHORT, such as 91351875815-1231123

In order to add a new symlink you need to edit to the /etc/udev/rules.d/80-octoprint.rules file. Add a line like this:

ACTION=="add|change", ATTRS{serial}=="91351875815-1231123", SYMLINK+="my-printer", GROUP="octoprint"

After that your printer will be available as /dev/my-printer. You can verify this by running

ls /dev/ttyACM* /dev/my-printer -l

After that you can add the printer under the additionalPorts field in config.yaml or ”Additional fields” under ”Serial Connection” in the settings panel.

Power automation

The power to the cabinet is manipulated with the program /home/octoprint/virta/virta.

This can be called like so:

/home/octoprint/virta/virta stop

It accepts three different arguments:

start

stop

init

This program is called from various locations in order to turn on/off the power to the power brick that the 3D printers are connected to.

Notably, /etc/systemd/system/octoprint-primary.service uses the virta program to turn on/off power to the 3D printer cabinet.

Timed shutoff

The automatic shutoff of the power was unstable. It probably periocially checked for system activity, and was reported to shut off the power after 30 minutes, but repeated malfunctioning led us to disable that feature.