thinkyhead shitcreek Teddyz

M118 - Serial print

hosts Send text to serial

Description

Send a message to the connected host for display in the host console or to perform a host action.

Notes

The E, A, and P parameters must precede the message.

Can also send the message to the serial port for hosts to display.

Usage

M118 [A1] [E1] [Pn<0|1|2>] [string]

Parameters

[A1]

Prepend // to denote a comment or action command. Hosts like OctoPrint can interpret such commands to perform special actions. See your host’s documentation.

[E1]

Prepend echo: to the message. Some hosts will display echo messages differently when preceded by echo:.

[Pn<0|1|2>]

Send message to host serial port (1-9).

  • Pn0:

    Send message to all ports.

  • Pn1:

    Send message to main host serial port.

  • Pn2:

    Send message to secondary host serial port. Requires SERIAL_PORT_2.

[string]

Message string. If omitted, a blank line will be sent.

Examples

Echo “Yello World!” in the console

M118 E1 Yello World!

Tell OctoPrint to cancel the print job

M118 A1 action:cancel