PI Installation
Hardware
This guide is specifically tailored to installing HivePrint on a Raspberry Pi, running a Raspbian based OS.
If you are looking for instructions for installing HivePrint on a Qidi X-max 3 printer, please see here.
System Requirements
HivePrint is designed to work with most devices running Klipper. Though it is in our pipeline to support more firmwares such as Octoprint and Marlin, Klipper is our main use case. Please join our Discord if you want more updates on when these may be supported.
Operating System
- Debian and Ubuntu based Linux Distributions (Bookworm, Bullseye, Raspbian, Armbian)
For Rock64 boards, we are using the images from here. We use a Balena Etcher, and a good quality SD card.
These are the only OS's that we have tested and use in production, yours may work!
NodeJS
Our Single Board Computer (SBC) program operates using NodeJS. As such, NodeJS is required. At time of writing, we support NodeJS version 18.x, however it may work with older and newer versions.
Installation instructions
We follow the instructions from NodeSource. You may be able to use whatever method you want, but we know that the following work.
Run the following commands as the pi
user on your pi.
1. Download and import the Nodesource GPG key
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
If you receive an error that matches the following:
File '/etc/apt/keyrings/nodesource.gpg' exists. Overwrite? (y/N)
Enter new filename:
gpg: no valid OpenPGP data found.
gpg: dearmoring failed: File exists
(23) Failed writing body
You may need to do the following:
sudo mv /etc/apt/keyrings/nodesource.gpg /etc/apt/keyrings/nodesource.gpg.backup
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
2. Create deb repository
NODE_MAJOR=18
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
3. Run Update and Installation
sudo apt-get update
sudo apt-get install nodejs -y
These instructions are coming directly from the NodeSource repo above. Please reference their documentation if you have any issues.
4. Ensure you are running NodeJS 18, and can run npm
node --version
v18.14.2 # You may see something different, ensure 18+.
npm --version
9.5.1 # You may see something different, ensure 9+.
5. Enable corepack
sudo corepack enable
HivePrint Pi
As mentioned above, the HivePrint code runs on the SBC, using node. You will need to download and install the HivePrint package.
Installation Instructions
If you need to re-run these instructions for whatever reason, you should follow the uninstallation instructions first.
1. Set up the projects directory.
cd ~
mkdir projects
cd projects
2. Add the public GitLab NPM registry for HivePrint.
echo @hiveprint:registry=https://gitlab.com/api/v4/packages/npm/ >> ~/.npmrc
echo @dovetail-digital:registry=https://gitlab.com/api/v4/projects/28900673/packages/npm/ >> ~/.npmrc
3. Run the create script.
pnpm create @hiveprint/create-hiveprint-starter
This will prompt you for some information, namely the access token, printer IP, and server URL.
access token
This will be generated for you by someone on the HivePrint team. This is what allows you to grab updates.
printer ip
This is the IP of your printer. This will link to the Home button on the printer card within HivePrint. This will only be useful
if you have UI that resolves to the printer IP. If you don't, just put 1.1.1.1 or literally anything.
server url
This will be generated for you by someone on the HivePrint team. This is the server that will be responsible for your instance of HivePrint.
All your SBC's will connect to this instance.
4. Copy the service file to /etc/systemd/system/
This instruction assumes your node executable is at /usr/bin/node. You can check
using which node
. If it is different, edit the hiveprintpi.service file
replacing the node path with your node path.
There are more than one type of printer we have a service file for. For most cases, if the pi running klipper is
the pi
user, you can use the service file in the generic-pi
directory. If you need a different one, please
create your own, or copy one from one of the existing directories in the templates
directory.
cd hiveprint-pi
sudo cp config/generic-pi/hiveprintpi-latest.service /etc/systemd/system/
5. Start the script with systemctl
sudo systemctl enable hiveprintpi.service
sudo systemctl start hiveprintpi.service
You may need to ensure that your pi user is able to run the sudo command without
entering a password. If you are prompted for a password, add this to /etc/sudoers
file
pi ALL=(ALL) NOPASSWD: /bin/systemctl restart hiveprintpi.service
6. Restart moonraker if necessary
Sometimes the HivePrint Pi can trigger a bit too early on start up, or if the printer was rebooted. Manually restarting moonraker is the fix.
7. Updating
For updating, please follow the updating guide.