MCPcopy Index your code
hub / github.com/PrintSpool/PrintSpool

github.com/PrintSpool/PrintSpool @v0.16.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.16.2 ↗ · + Follow
1,138 symbols 2,498 edges 449 files 44 documented · 4%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Print Spool

A bold new way to 3D print over WiFi.

Get started at https://printspool.io

Warning: Print Spool is in active development and not yet production-ready. It may have substantial bugs.

If you find any please me know in the issues! Even if it is a known issue an upvote for the bug helps me prioritize what to work on next.

Dev Environment

Dev Environment Setup

For completeness this documentation lists all the dependencies to get a development environment running on a fresh Ubuntu 18.04 install. You may opt to skip the dependencies you have installed already.

  1. Install nvm
  2. Install Rust
  3. [OPTIONAL] Install the mold linker for faster builds
  4. Install the development dependencies: bash sudo apt update sudo apt install build-essential \ clang \ libclang1 \ cmake \ pkg-config \ python \ tmux \ qemu \ qemu-user \ qemu-user-static \ binutils-arm-linux-gnueabihf \ gcc-arm-linux-gnueabihf \ fuse-overlayfs \ g++-arm-linux-gnueabihf \ libbsd-dev \ protobuf-compiler \ postgresql \ postgresql-contrib \ `# Belt Engine Dependencies` \ libgeos-dev \ libblas-dev \ liblapack-dev \ gfortran \ libxslt1-dev \ libxml2-dev \ libjpeg-dev \ zlib1g-dev
  5. Allow serial port access via the dialout group and then restart your computer: sudo gpasswd --add ${USER} dialout
  6. Increase the max_user_watches: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
  7. Set up Postgres for passwordless local development: https://gist.github.com/p1nox/4953113
  8. Install cargo-watch, sqlx, node 10 and yarn with: ./scripts/bootstrap

Running the Development Servers

Disable any other copies of teg and run ./scripts/start-tmux

It's recommended you do this in a dev environment with at least 16GB of ram.

./scripts/start-tmux:

  • starts all the services required for a hot reloading development 3D print using your /etc/teg-dev/ configs
  • starts a hot reloading instance of the web ui

Once you have start-tmux running you can create an invite code to access your dev instance by running:

cd ./crates/ && cargo run --bin teg-invite

Building Releases

Releases are built through Github Actions CI

To update the changelog and create a release tag run: ./scripts/release

Test Releases

  • Alternatively, you can compile release builds locally using cargo build --release
  • Make sure to enable Github Actions in the repo settings for your fork
  • Then to build a test release via CI first fork this repo and then push an annotated tag to your fork: bash git tag -d tag-test; git tag -a tag-test -m "CI Testing / Do not Use" && git push fork -f tag-test
  • Once the build is complete you can install it by setting the PRINTSPOOL_GITHUB envirnoment variable too point to your fork. Eg: bash export PRINTSPOOL_GITHUB="D1plo1d/print-spool-release-test"
  • Then you can install PrintSpool from your fork just like a normal install: bash bash <(curl -s https://raw.githubusercontent.com/PrintSpool/PrintSpool/develop/scripts/install)

Developer Rapsberry Pi Setup

Note: Print Spool is in Limited Closed Beta testing at the moment. These instructions are for my own personal use and will very likely not work on your computer.

Part 1: Setting up a Rapsberry Pi

Note: Pi Bakery may be an easier alternative to the steps bellow Windows and Mac users. See: https://www.pibakery.org/

  1. Use the https://www.raspberrypi.org/downloads/ to install the latest Raspberry Pi OS
  2. Recommended Generate a password hash (openssl passwd -6) and replace the pi's password in /YOUR_SD_CARD/etc/shadow on your sd card
  3. Optional, if using Wifi Set up wifi: https://desertbot.io/blog/headless-raspberry-pi-3-bplus-ssh-wifi-setup
  4. Optional Add a ssh file to the boot partition to enable SSH ( See: https://www.raspberrypi.org/documentation/remote-access/ssh/README.md )
  5. Optional Set a host name: https://raspberrypi.stackexchange.com/a/44963

Part 2: Installing Print Spool

  1. Start your Raspbery Pi
  2. On the Raspberry Pi (via SSH or with a monitor and keyboard) install Print Spool using: bash <(curl -s https://raw.githubusercontent.com/PrintSpool/PrintSpool/develop/scripts/install)

Troubleshooting

Enabling the RaspberryPi Camera

To enable the PiCam on the Raspberry Pi run: sudo modprobe bcm2835-v4l2

You should not need to do this for a USB webcam.

Source: https://www.raspberrypi.org/forums/viewtopic.php?t=62364

Known Issues

  • The print button can take 40 seconds or more to start a print when teg is running in development. This is due to some optimizations Cargo and Rust disable in development that strongly effect the performance of Nom's parsers and async Streams. Running teg in release (eg. cargo run --release) solves this issue.

Extension points exported contracts — how you extend this code

Record (Interface)
(no doc) [11 implementers]
crates/json-store/src/record.rs
Model (Interface)
(no doc) [11 implementers]
crates/config_form/src/model.rs
MachineHooks (Interface)
(no doc) [2 implementers]
crates/machine/src/machine/machine_hooks.rs
IdentifyFirstLast (Interface)
(no doc) [1 implementers]
crates/data_channel/src/iter/identify_first_last.rs
MaterialHooks (Interface)
(no doc) [1 implementers]
crates/material/src/material_hooks.rs
DefaultTheme (Interface)
(no doc)
frontend/teg-web-ui/src/App.tsx
Configurable (Interface)
(no doc) [5 implementers]
crates/config_form/src/configurable.rs
DecodeFuture (Interface)
(no doc)
crates/data_channel/src/saltyrtc_chunk.rs

Core symbols most depended-on inside this repo

useMutation
called by 39
frontend/teg-web-ui/src/common/auth/useSignallingGraphQL.ts
send
called by 33
crates/marlin/src/serial_manager.rs
var
called by 31
crates/common/src/paths.rs
get
called by 30
crates/json-store/src/record.rs
get_data
called by 28
crates/machine/src/machine/messages/get_data.rs
insert
called by 23
crates/json-store/src/record.rs
stop
called by 21
crates/machine/src/machine/resolvers/mutation_resolvers.rs
useLiveSubscription
called by 17
frontend/teg-web-ui/src/printer/_hooks/useLiveSubscription.ts

Shape

Method 542
Function 285
Class 258
Enum 42
Interface 11

Languages

Rust80%
TypeScript20%

Modules by API surface

crates/protobufs/src/protos/teg_protobufs.rs26 symbols
frontend/slicer-render/src/lib.rs23 symbols
crates/machine/src/config/machine_config.rs20 symbols
crates/marlin/src/state_machine/ready_state.rs19 symbols
frontend/slicer-render/src/model_preview.rs18 symbols
crates/marlin/src/state_machine/mod.rs18 symbols
crates/machine/src/machine/resolvers/machine_resolvers.rs18 symbols
frontend/teg-web-ui/src/webrtc/WebRTCSocket.ts16 symbols
crates/print-queue/src/part/part.rs15 symbols
crates/marlin/src/state_machine/context.rs15 symbols
crates/machine/src/task/task_status.rs15 symbols
crates/json-store/src/record.rs15 symbols

For agents

$ claude mcp add PrintSpool \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page