thinkyhead shitcreek Teddyz

M118 - Serial print

hosts Send text to serial


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


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

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


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



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


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


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.


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


Echo “Yello World!” in the console

M118 E1 Yello World!

Tell OctoPrint to cancel the print job

M118 A1 action:cancel