[Guide] Config PrusaSlicer to send/print to Octoprint on button press, including PROPER limited API permissions and key
 
Notifications
Clear all

[Guide] Config PrusaSlicer to send/print to Octoprint on button press, including PROPER limited API permissions and key  

  RSS
William
(@william)
New Member
[Guide] Config PrusaSlicer to send/print to Octoprint on button press, including PROPER limited API permissions and key

Here's a guide on how to setup PrusaSlicer to send g-code and/or print to Octoprint. This guide shows how to properly set it up using an application key and a custom user, rather than the not security conscious global API key.

 

Short TLDR version: Under Access Control create a user with only 3 permissions (clear out operator default group first). Permissions needed are Status, File Upload, Print. Under Application Keys, select user and generate key. In PrusaSlicer printer settings, edit physical printer and enter the info. Optional but recommended: Set PrusaSlicer to autogenerate thumbnails of each gcode file to view in Octoprint! See step 21

 

Long excruciatingly detailed version:

Step 1: Goto the normal URL for your octoprint and login to octoprint with the normal admin account (if you only know one account to login, use that one)

Step 2: Click on Settings icon (little wrench shape at the top of the page)prusa1

Step 3: Click Access Control on left

Step 4: Click add userprusa2

Step 5: Pick a username, in this example its PrusaSlicer).

Step 6: Type in a complex password. Maybe even generate a nice 16 character one from https://passwordsgenerator.net/ Then put that password in. No need to remember or record it.prusa3

Step 7: Click on Groups tab and clear the default checkmark on Operator permissionprusa4

Step 8: click on Additional Permissions tab.prusa5

Step 9: Put a checkmark on 3 permissions. Status (so the PrusaSlicer can complete the test verify successfully), File Upload (so PrusaSlicer can upload the gcode files), and optionally Print (if you want PrusaSlicer to be able to start a print after upload. If you don't ever intend to do this you can skip the Print permission).prusa6

Step 10: Click Confirm lower part of dialog box to create user. It should show no groups and 3 permissions, as in this screenshot.prusa6b

Step 11: Click Application Keys on left.

Step 12: Under Manually Generate an Application key, click on dropdown next to User. Select user just created (example PrusaSlicer). Fill in anything for Application Identifier (example PrusaSlicerApp), and click Generate.prusa7

Step 13: A dialog will popup with an freshly generated application key. Click the copy button there then click close.prusa8

 

Step 14: Click Save on the octoprint config dialog.prusa9

Step 15: Open up PrusaSlicer.

Step 16: Click Printer Settings.prusa10

Step 17: Select your printer in dropdown if you have multiple (or your preferred custom preset if you have one). Then click the little gear icon (the Add Physical Printer button).prusa11

Step 18: Put a name in for the printer (example Octoprint), verify OctoPrint is selected for Host Type, fill in the hostname or IP you use to access the octoprint (such as octoprint.local). Then finally paste in the Application API key you copied from step 13.prusa12

Step 19: Click the Test button next to hostname/IP. This should show a success dialog if the steps above are done correctly. [If you have special network settings such as a proxy, hovering over the hostname field will give more info how to do that. If you don't know what this means, it probably doesn't apply to you so ignore this italics part.]prusa13

Step 20: You'll see your printer now has a new name with a star next to it. That means it's not saved, go save it by clicking on the little disk button circled in screenshot.prusa14

Step 21: Optional but highly recommended. While on the Printer Settings page, fill in a thumbnail size next to G-Code Thumbnails option, such as 256x256 (any other square size should work too). Then install the PrusaSlicer Thumbnails plugin. prusa15

This will allow you to see preview thumbnails of each gcode file in octoprint! Basically what the mini does, but inside octoprint. prusa16

Step 22: Now after you slice something, you'll see a new button appear next to the Export G Code. This new button will upload your g-code to your Octoprint! You can also mark the checkbox to start automatically printing it after you upload it, without having to even open octoprint to start a print. Just be careful because PrusaSlicer will save the state of that button for the next slice, and you may not be prepared to start printing a new item!prusa17

Posted : 18/04/2021 8:27 pm
cjnaz
(@cjnaz)
New Member
RE: [Guide] Config PrusaSlicer to send/print to Octoprint on button press, including PROPER limited API permissions and key

Thanks much for this guide.  Well done. 

Some constructive additions/feedback...

  • The default OctoPrint install has the server webUI at port 5000.  I found that I needed the port specification when configuring the Physical Printer in step 18, such as "192.168.0.80:5000".  Without a port specification the default in port 80, I assume.
  • When setting up the thumbnails in step 21, one must be in Expert mode in order to see the G-code thumbnails field.
  • I suspect that the PrusaSlicer Thumbnails plugin has been renamed Slicer Thumbnails.
Posted : 03/07/2021 7:43 pm
Share: