Octoprint Custom Control Development

General discussion topics
Post Reply
paynterf
Posts: 28
Joined: Wed Sep 25, 2019 2:42 am

Octoprint Custom Control Development

Post by paynterf » Mon Jan 04, 2021 5:06 pm

<r>Hi,<br/>
<br/>
I've just started working on some custom controls for the Octoprint web interface to my M3-ID printer. I've added the Custom Controls Editor plugin to my Octoprint setup, and have used it to create some very basic controls, but it isn't very well documented, and is no longer being supported. <br/>
<br/>
I also managed to create some custom controls by directly editing the config.yaml file on the Octoprint server, but this too has it's problems. One big problem is the apparent difference between the YAML syntax recognized by the M3-ID variant of Octoprint and the syntax described in the Octoprint.org documents pertaining to YAML. <br/>
<br/>
the order of the lines comprising a command section appears to be reversed from the docs: For instance, this is an example command section from the Octoprint.org docs:<br/>

- name: Example for multiple commands
children:
- name: Move X (static)
confirm: You are about to move the X axis right by 10mm with 3000mm/s.
commands:
- G91
- G1 X10 F3000
- G90
- name: Move X (parametric)
commands:
- G91
- G1 X%(distance)s F%(speed)s
- G90
input:
- default: 10
name: Distance
parameter: distance
- default: 3000
name: Speed
parameter: speed

And this is the arrangement that actually works on the M3-ID:<br/>

- children:
- commands:
- G91
- G1 X10 F3000
- G90
name: Move X (static)
- commands:
- G91
- G1 X%(distance)s F%(speed)s
- G90
input:
- default: 10
name: Distance
parameter: distance
- default: 3000
name: Speed
parameter: speed
name: Move X (parametric)
layout: horizontal
name: Example of multiple commands


As you can see, they are almost inverses of each other, rendering most of the Octoprint.org examples nearly useless for learning.<br/>
<br/>
Does anyone know how/why there are such large differences in YAML syntax, and if there any docs or references that describe the M3-ID variant of Octoprint YAML syntax?<br/>
<br/>
TIA,<br/>
<br/>
Frank</r>

Post Reply