A Klipper module that enables a network connection with Cura.
Id, key, name are all synonymously used for the name property set as name in the zeroconf property dictionary.
Device refers to detected, usable printers, Machine refers to printers added in Cura.
- GCode
- Remote access (part 1)
- Remote access (part 2)
- Electronics
- Developer mode & Linux/Systemd
- Active leveling
Status strings as of DevBlog2:
- idle
- printing
- error
- maintenance
- booting
- assigned_to != None to be "active"
- setPrintJobState sends one of "print", "pause", "abort"
- timeTotal is a continuously updated estimate
- All status strings as of
KlipperNetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml
and DevBlog2 (indicaded by #)- wait_cleanup stopped (aborted or finished)
- finished
- sent_to_printer
- pre_print Active leveling?, Heating #
- aborting Unused by Cura Connect, used by Cura
- aborted see above
- pausing #
- paused #
- resuming #
- queued needed to show in Cura queue
- printing #
- post_print Cooling down, stopping #
BOM | printer_type |
---|---|
9066 | ultimaker3 |
9511 | ultimaker3_extended |
213482 | ultimaker_s3 |
9051 | ultimaker_s5 |
214475 | ultimaker_s5 |
- Figure out if it is really necessary to disguise as an Ultimaker3
Otherwise custom sizes will need to be set manually.
- The Output plugin detects networked printers via zeroconf
- They get checked for some values in the zeroconf property dict
- When the user adds that device, a new machine (Stack) is created
- Further communication happens via the IP address on HTTP
- On Startup missing material xml files are sent to the printer
- Every 2 seconds _update() is called on all device objects. This continuously requests printers and print_jobs status data
- When clicking Print over network the file is sent in a multipart POST request.
Executing install.sh
sets everything up as needed.
The following steps are made:
Install zeroconf:
pip3 install zeroconf
Root privileges are required to listen to port 80, the default HTTP port. Because of that we redirect packets to 8080 and listen to that instead. We then make these persistent with installing iptables-persistent. With the configurations set first the installation is automatic and the rules we just set are written to /etc/iptables/rule.v4.
sudo apt install iptables-persistent
sudo iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-ports 8008
sudo iptables-save -f /etc/iptables/rules.v4
Install mjpg-streamer from source:
git clone https://github.com/jacksonliam/mjpg-streamer.git
cd mjpg-streamer/mjpg-streamer-experimental
make
sudo make install
The systemd service mjpg_streamer.service in this directory can be used to start mjpg_streamer.
Most come from KlipperNetworkPrinting/src/Network/ClusterApiClient.py
Name | Type | URL (/cluster-api/v1 if not !) | Data (sent or requested) | Requested at | Implemented |
---|---|---|---|---|---|
getSystem | GET | !/api/v1/system | PrinterSystemStatus | At manual connection | False |
getMaterials | GET | /materials | [ClusterMaterial] | At startup | True |
getPrinters | GET | /printers | [ClusterPrinterStatus] | Periodically | True |
getPrintJobs | GET | /print_jobs | [ClusterPrintJobStatus] | Periodically | True |
setPrintJobState | PUT | /print_jobs/UUID/action | {action:(pause|print|abort)} | GUI | True |
movePrintJobToTop | POST | /print_jobs/UUID/action/move | {to_position:0,list:queued} | GUI | True |
forcePrintJob | PUT | /print_jobs/UUID | {force:True} | GUI (Override) | True |
deletePrintJob | DELETE | /print_jobs/UUID | None | GUI | True |
getPrintJobPreviewImage | GET | /print_jobs/UUID/preview_image | Image bytes (PNG file works) | At job creation | True |
startPrintJobUpload | POST | /print_jobs/ | owner & .gcode file (MIME) | "Print over Network" | True |
sendMaterials | POST | /materials/ | .xml.fdm-material file (MIME) | Sent if not on printer | True |
stream | GET | !/?action=stream | Redirect | Open stream | True |
snapshot | GET | !/?action=snapshot | Redirect | None | True |
? | GET | !/print_jobs | ? | Browser view | False |