Config.yaml editing basics

The yaml is valid, but not correctly ordered...

- children:
  - command: M109 S%(temp)
    input:
    - default: 200
      name: Temp (200-300)
      parameter: temp
      slider:
        max: 300
        min: 200
    name: Set Temperature
  layout: horizontal
  name: Extruder

OK, that works, but only in the sense that the server comes up with the new control installed, as shown in the screenshot below. However, the printer's M109 command is never sent, and the temperature never moves off ambient.

I thought it might be because no extruder had been specified. So I sent the temperature change command M109 T0 S222 using the terminal SEND facility, and this did, in fact, move the T0 extruder temperature.

Am I missing something?

Frank

Any ideas?

You didn't mention that was the necessary command. Appears you need to tell your printer what hot end to use, so you need to make sure that is the command that is getting sent.

- children:
  - command: M109 T0 S%(temp)
    input:
    - default: 200
      name: Temp (200-300)
      parameter: temp
      slider:
        max: 300
        min: 200
    name: Set Temperature
  layout: horizontal
  name: Extruder

Hmm, still no go. The controls show up properly, but the command never shows up in the terminal, and the temperature plot never changes. However, if I send ' M109 T0 S220 from the terminal, it immediately takes effect.

I was able to compare the 'Set Temperature' command layout with an identical (but working) section for 'Set Fan Speed'

- children:
- command: M106 S%(speed)s
input:
- default: 255
name: Speed (0-255)
parameter: speed
slider:
max: 255
min: 0
name: Enable Fan
- command: M107
name: Disable Fan
layout: horizontal
name: Fan
- children:
- command: M109 T0 S%(temp)
input:
- default: 200
name: Temp (200-300)
parameter: temp
slider:
max: 300
min: 200
name: Set Temperature
layout: horizontal
name: Extruder

AFAICT, the two sections are absolutely identical, except for the lowercase 's' following the closing paren on the command: line! When I changed M109 T0 S%(temp) to M109 T0 S%(temp)s, it all started working.

Looking at the Octoprint docs for custom controls here, the trailing lowercase s appears after every parameterized command. Is there any reference that explicitly explains this requirement?

TIA,

Frank

my bad, that is what I missed. There was a link on the docs I think to the python format syntax that it's using, but I think s is probably all you will need because that's what technically you are sending via gcode.

Yes, it works fine for me now with the 's' appended, but it is a bit frustrating to have to learn three new languages (Gcode, YAML, Python) to get just one small thing done ;-).

Thanks for all your help - I would still be swimming upstream and getting nowhere without your input.

Frank

So I have been progressing along the learning curve for my MakerGear M3-ID custom control development, and I now see there are some very significant differences between the YAML syntax used by the Octoprint on the M3-ID and the YAML syntax shown in the Octoprint.org docs.

Parameterized commands require a trailing 's' in order to be actually sent to the printer. This doesn't show up at all in the docs.

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 docs:

 - 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:

- 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

This seems so wildly different as to completely invalidate the Octoprint.org docs as development examples, but yet that's all I have to go by (other than some miscellaneous posts on the M3-ID forum). Is there something I'm missing here, or is it really this different across printer implementations?

TIA,

Frank

It shows exactly this in the example listed for the intput. https://docs.octoprint.org/en/master/features/custom_controls.html#sec-features-custom-controls

This example has a space indentation issue. Is this a direct copy/paste from the docs? It should be the following I think.

 - 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