source/projects/tentacles/README.md

48 lines
1.7 KiB
Markdown
Raw Normal View History

2023-05-13 22:58:17 +00:00
# Tentacles
A simple queue system for OctoPrint, designed to receive jobs and forward them to connected OctoPrint instances as they are available and ready.
## Workflow
Username+Password users
2023-05-19 06:52:07 +00:00
API keys mapped to users (same thing as sessions actually)
2023-05-13 22:58:17 +00:00
Users mapped to job priority
API keys mapped to user sub-priority
User-facing API can upload gcode files to storage and create a file entry in the DB
Jobs can be created from new or existing file entries in the DB
Jobs are mapped to the priority of the API key (and user) who created them
Jobs get Runs - which track assigning a pending Job to a Printer
Highest priority job schedules first/next non-Running Job to the first available printer.
This requires copying the gcode file to the target device, and starting it running.
Running Runs are polled to detect loss/failure. Lost or failed Runs are deleted, and the Job returns to the queue.
A priority penalty may be called for.
## Notes
Checking bed status on a printer
$ curl 'http://10.0.0.6/api/plugin/bedready' \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json; charset=UTF-8' \
2023-05-19 06:52:07 +00:00
-H 'Authorization: Bearer ...No creds
' \
2023-05-13 22:58:17 +00:00
--data-raw '{"command":"check_bed","reference":"reference_2023-05-11T05:22:40.212Z.jpg"}' \
| jq .
Uploading a file and starting to print it
- https://github.com/prusa3d/PrusaSlicer/blob/0384d631d6ef1aaadcb68da031eba9a586b102ed/src/slic3r/Utils/OctoPrint.cpp#L936
- https://docs.octoprint.org/en/master/api/files.html#upload-file-or-create-folder
- &print=true
Doesn't appear possible to execute request/response g-code through the API? Can't detect when the printer's offsets aren't calibrated?