Skip to content

Add Edit Button

Minty Trebor edited this page Jul 11, 2022 · 12 revisions

Add/Edit Buttons

Buttons can trigger one of 5 types of action on click.

  1. Send a gcode command to the Duet board.
  2. Run a gcode Macro from the default macro folder
  3. Send a simple http request (stateless)
  4. Send an MQTT message* (stateless)
  5. Open a URL in a pop-up window

The add/edit Button window is detailed below:
enter image description here

Buttons have the following standard settings:

  • Button Type: gcode, Macro, http, MQTT*, Window
  • Button Label: (optional) Text to display in button
  • Hover Text: (optional) text to display when cursor hovers over the button - useful for additional info about the button
  • Icon: (optional) icon to display in button
  • Enabled In Job: Allow button to be clicked whilst a job is running.
  • Colour: Choose a colour for your button.

In addition the following settings are available depending on the button type:

gcode:

  • gcode command: (required) the gcode command to run on click of button

Macro:

  • Macro Name: (required) the file name of the macro in the default macro folder. Must end in .g eg Macroname.g

http:

  • URL: (required) the url for the request. (full url is required), further parameters will be displayed as required.
    • Post Data: Data to send with Post. Must be in JSON format (eg: {"keyname": "string"} or {"keyname": number} or {"keyname": boolean}
  • Show Popup window with results

MQTT*:

  • MQTT MSG: (required) text of the message to send
  • MQTT Topic: (required) topic to send the message to

Window:

  • Pop-Up URL: URL to open in a popup window
  • Window Height
  • Window Width

Please see Using Object Model Values, if you wish to inlcude data from the object model with HTTP or MQTT buttons.