respond: An extra for sending messages to the printer host. (#1053)

I have made one change to `gcode.py` to support quoted parameter
values.

I have added support for the basic `M118` command (see
https://reprap.org/wiki/G-code#M118:_Echo_message_on_host). I have
also added a `RESPOND` command that takes extended parameters.
`ECHO` might be a better name than `RESPOND` but is already defined
in `gcode.py`.

Signed-off-by: Alec B. Plumb <alec@etherwalker.com>
This commit is contained in:
Alec B. Plumb
2019-01-02 14:45:35 -08:00
committed by KevinOConnor
parent f6c9150349
commit 59e9b6562f
4 changed files with 81 additions and 2 deletions

View File

@@ -273,3 +273,19 @@ section is enabled:
may lead to internal software errors. This command may invalidate
future boundary checks; issue a G28 afterwards to reset the
kinematics.
## Send message (respond) to host
The following commands are availabe when the "respond" config section is
enabled.
- `M118 <message>`: echo the message prepended with the configured default
prefix (or `echo: ` if no prefix is configured).
- `RESPOND MSG="<message>"`: echo the message prepended with the configured default
prefix (or `echo: ` if no prefix is configured).
- `RESPOND TYPE=echo MSG="<message>"`: echo the message prepended with `echo: `.
- `RESPOND TYPE=command MSG="<message>"`: echo the message prepended with `// `.
Octopint can be configured to respond to these messages (e.g.
`RESPOND TYPE=command MSG=action:pause`).
- `RESPOND TYPE=error MSG="<message>"`: echo the message prepended with `!! `.
- `RESPOND PREFIX=<prefix> MSG="<message>"`: echo the message prepended with `<prefix>`
(The `PREFIX` parameter will take priority over the `TYPE` parameter)