Web application for centralized management of 3D printers via a Raspberry Pi and local server website.
Authors: Alan Burić, Filipa Bebek, Boris Vujica
- Printers:
- connect via serial ports
- detect them in the web application
- give names to printers
- Printer controls:
- auto home
- mesh bed leveling
- reset XYZ
- load filament, unload filament
- preheat for PLA, ABS, PET filament types
- cool down temperature
- pause, resume, cancel
- move up, down, left, right, forward, backward (XYZ +/-)
- print uploaded model
- Models:
- upload models onto the server
- rename models
- delete models
- print uploaded models
This application is intended for a computer with network access and ability to connect via serial ports to Prusa 3D printers. The applications were developed against the Prusa i3 MK2 printers.
Prerequisites: Node.js, NPM
In the backend directory define your .env by making a copy of the .env.example file.
Change the DATA_DIRECTORY=./app/data to DATA_DIRECTORY=/app/data if you'll be running the backend locally.
Then, install the NPM packages:
cd backend
npm cicd frontend
npm ciIf npm ci is causing issues, try using npm i instead.
Then, you can run the backend and frontend services in two separate terminals:
cd backend
npm run devcd frontend
npm run devThat's it, the website should be available at http://localhost by default, and the changes you make to the backend and frontend cause the services to restart upon save.
Building is usually only used for deployment, but it's important to check that your backend and frontend services properly compile after you've made code changes.
You can use the build scripts in the frontend and backend directories for that, e.g. npm run build.
You can even start the built files using npm run start.
Prerequisites: Ansible, Docker
Ansible automates the deployment and environment setup of whatever computers you specify in an inventory.yml file.
It doesn't work on Windows, but does in e.g. WSL.
Install Python3, pipx and finally Ansible. Here is the documentation in greater detail.
Docker containerizes and isolates the application's services.
You'll need it to build the images, while the control node will need Docker engine to run them.
If you wish to override the pre-defined environment variables in compose.yml, create an .env file next to it.
-
If you're on Windows, enable the experimental Docker build for the target platform option:
docker buildx create --use
Otherwise, you may get issues like these when deployed:
backend-1 | exec /usr/local/bin/docker-entrypoint.sh: exec format error frontend-1 | exec /docker-entrypoint.sh: exec format error -
Build the Docker images for Raspberry Pi (ARM64) locally:
docker compose build
-
Save the Docker images to .tar files:
docker save -o frontend.tar printsync3d-frontend docker save -o backend.tar printsync3d-backend
-
Configure Ansible
ansible-examples/inventory.ymlwith your target computers for deployment, locally adaptansible-examples/deployment.ymlif needed. -
If this is the first time deploying the web application onto the target devices, run the Ansible deployment script with the following options, e.g.:
cd ansible-examples ansible-playbook -i inventory.yml deployment.yml --tags setupOtherwise, if you're just updating the web application, and won't need Internet access:
cd ansible-examples ansible-playbook -i inventory.yml deployment.yml --skip-tags setup -
Once done, both services should be deployed and started. To test, you can access the IP address of the target computer in your browser to see the website.
-
To manage or view logs for your services, SSH into your Raspberry Pi and run:
sudo -i su cd ~/printsync3d docker compose logs -f