Maybe there's a way to do this elsewhere, in OctoPrint's UI, possibly... but I think OctoPod would be the best place for this, for me:
I'd like a programmable button that will execute a custom command or set of commands. The instance that comes to mind is for changing filament. I'd like to heat up the hotend, wait for it to get to temperature, speedily retract 450mm of filament (give or take), and then shut down the hotend. That way I can just head over to the printer and change the spool at my leisure.
I'm not familiar with OctoPod, but I think I remember seeing that it supports custom controls that are configured in OctoPrint's config.yaml, but I might be wrong.
OctoPrint allows you to add custom controls to the โControlโ tab of its interface. Control types reach from simple buttons which trigger sending of one or more lines of GCODE to the printer
That's exactly what I'm looking for... although having that same capability in OctoPod would suit me better.
Looks good, just make sure that the indentation is done with all spaces. When I copied it over it looked like there were a couple of tabs in there, but that could have been because of grabbing it from email. Also, make sure to match the number of spaces currently in your config.yaml. For example, my config.yaml on my development machine is 4 spaces per indentation instead of 2.
Good catch on both counts... yes, there were some tabs present despite the fact that I read "no tabs." And the spacing in my added code was short. Thanks!
Modification failed, in that I could no longer connect to the printer via the browser. The browser UI would come up, and the contents of the "Controls" tab was no different from default. I could SSH in and see that the code was inserted in config.yaml between appearance: and feature: despite the fact that I added it to the end of the file. I could not connect to the folders on Pi from Windows at all.
I deleted that section in the script editor, saved, and rebooted. Only then could I connect to the printer through the browser UI.
The only thing I can think of is that something's wonky with my syntax.
EDIT: I tried again with some edited spacing. Here's my config.yaml file in its entirety:
Still doesn't work. Worse, in fact, the UI doesn't even load with this file. I deleted the additions and OctoPrint loads fine. I'm so glad I put my power supply on a remote over the weekend...
I can see how that would be the case... plugin, you say? I didn't know there was such a thing. Downloading now.
You haven't steered me wrong yet, but I don't know why a comment would be causing issues. I'll play with the Custom Control Editor and see how badly I can mess things up...
Oh, I actually already had above... but unfortunately the buttons don't work in either the browser UI or in OctoPod yet. The buttons click in the browser UI but don't actually do anything. In OctoPod, I get a "script not found" error. Odd.
This is getting me close, though. I'll continue to work on it.
EDIT: I'll bet instead of Script, I need to use Command. I thought "Command" meant a single command, but upon selecting it, the input field is labeled "Commands" (plural). I'm in the middle of another print or else I'd test it. Making some facemask holders for the folks at the local grocery...