-
Notifications
You must be signed in to change notification settings - Fork 1
Operating The Printer
Make sure your printer is set up and primed.
The printer workflow employs a RESTful design pattern. A POST request is sent from the web application and is received by the OctoPrint API. This request tells the printer to begin printing and includes the name of the file to be printed in the format “XX.gcode” or “X.gcode” where X is a letter. OctoPrint then parses the request, looks up the file to be printed in OctoPi, sends the file through USB to the Ultimaker 2 Extended, and then tells the printer to start printing. OctoPrint has this step all built-in to its API.
A typical POST request looks like:
POST http://octopi.local/api/files/local/CS.gcode
With the headers X-Api-Key set to the API key of OctoPrint (found in its settings) and Content-Type set to application/json.
The body of the POST request looks like:
{
"command": "select",
"print": true
}
Where the “command”: “select” tells OctoPrint to find the gcode file specified in the URL of the request and “print” : true has OctoPrint immediately send a print command to Ultimaker 2 Extended once the file is found.
Some examples of the printing process:
An Early Test of Printing Cupcake Frosting on an Oreo
https://www.youtube.com/watch?v=SWbs7Qv8N7U
Printing Cake Frosting in Front of Kids at Engineering Open House 2016