This page gives RepRapFirmware’s codes for talking to a host and its user, and
to attached devices: reports and diagnostics, messages, sounds, servos,
babystepping and the I2C, Modbus and UART transfers, from the Duet3D G-code
dictionary as read on 3 December 2026. RRF means RepRapFirmware, and version
numbers are its versions. Temperature waiting (M116) is on
RepRapFirmware temperature and fans.
M110, M112, M120 and M121
| Command | Parameters and effect |
|---|---|
M110 N | Set line number: accepted and ignored. RRF takes each line’s number from its own leading N and does not check that numbers follow on |
M112 | Emergency stop: moves end at once, motors and heaters go off and the board shuts down; the supply switched by PS_ON stays on so that fans can run. Restart with M999, reset or power cycle. To drop power too, a trigger macro runs M81 before M112 |
M120 | Push the feed rate, absolute or relative modes (moves and extrusion separately), inch or mm units, arc plane and M596 motion system; done automatically on entering a macro |
M121 | Pop the last state pushed |
PanelDue sends M112 followed by the bytes F0 0F, which RRF watches
for as characters arrive, ahead of any buffered commands: on both serial ports
from 3.7, except one in M575 S7 device mode, and on the first only
before.
M111: debug output
| Parameter | Meaning |
|---|---|
P | Module number |
S | S0 off (as D0), S1 all flags on |
D | Set or clear individual flags |
B | 3.6: CAN board. 3.5: debug buffer size, redirecting output |
F | (3.6) Debug buffer size in bytes, a power of 2; takes output from interrupts too and drains to USB, dropping what does not fit |
Alone it lists the modules and their state. In SBC mode, from 3.6.0,
M111 P-1 sets Duet Software Framework logging: S is
trace, debug, info, warning,
error or fatal, and O1 shows log lines in
the web interface. Debug traffic can hurt print quality, and a buffer under heavy
output can cause web disconnections.
M111 P4 S1
M111 P4 D2
M114, M115 and M119: reports
| Command | Parameters and reply |
|---|---|
M114 | Positions at the end of the last processed move, which may not have run yet. E without a number is the virtual extruder position (advanced only in M82 mode, reset when a print starts), E0, E1… each extruder, Count motor microstep positions, Machine coordinates after offsets and compensation |
M115 | Firmware name, version, board and date. B CAN address of another board (RRF 3 on Duet 3). P declared the hardware and is gone from 3.5: in 1.x P0 automatic, P1 to P3 Duet 0.6, 0.7 and 0.85 |
M119 | Endstop states, after any inversion |
M114
X:10.000 Y:20.000 Z:5.000 E:51.000 E0:51.0 E1:0.0 Count 800 1600 2000 Machine 10.000 20.000 5.000 Bed comp 0.000
No agreed format exists for the M114 reply; programs for RRF 3
should query the object model with M409 instead.
M122: diagnostics
M122 prints diagnostics. B chooses a board by CAN
address (default 0), "DSF" asks for immediate Duet Software
Framework diagnostics on an SBC system, and P picks a special report
(as of 3.7.0):
P | Report or action |
|---|---|
| 1 | Factory test: T MCU temperature and V input voltage as min:max, required; W 12 V rail and F inductive sensor kHz where the board has them |
| 100, 101 | Recent moves (builds with move logging); DueX status (Duet 2) |
| 102 | Maths timings (MB6HC; expansion boards square roots only) |
| 104 | SD write timing, S megabytes (default 10), C1 with CRC |
| 105 to 108 | Object sizes; object addresses; CRC-32 timing; step clock read timing |
| 109 | Simulate under-voltage to test power loss pausing |
| 110, 111 | Cubic and quartic solver timings (MB6HC, 3.7) |
| 200 | Allocated pins (LPC and STM32 ports only) |
| 500 | Cortex-M4 write buffer: S0 off, S1 on, none reports; on expansion boards 501 turns it off and 502 on |
| 900 | Exhaust the output buffers until reset |
| 1000 and up | Do not use: mostly deliberate crashes. 1001 watchdog, 1002 stuck loop, 1003 blocked USB, 1004 divide by zero, 1005 unaligned access, 1006 invalid memory, 1007 read or write words (A address, R count, V value), 1008 exhaust memory, 1009 (3.6.4) jam I2C to test recovery |
M117 and M118: messages
M117 "text" (quotes recommended) shows text
on an attached display, or else in the web interface, and from 3.2.0 logs it at
level INFO. Messages sent in quick succession may not all appear.
M118 (1.21) sends a message to a chosen target:
| Parameter | Meaning |
|---|---|
S"text" | Required, at most 255 characters |
P | 0 generic (default), 1 USB, 2 PanelDue or UART, 3 HTTP, 4 Telnet, 5 second UART, 6 MQTT (3.5 on Duet 3 with Wi-Fi, 3.6 on all Duet 3), 7 second USB (3.7) |
L (3.2) | Log level: 0 none, 1 warn, 2 info, 3 debug (default). L without P only logs |
T"topic" | MQTT topic |
Q R D | MQTT quality of service 0 to 2, retain flag and duplicate flag, each default 0 |
M118 P0 S"message" L1
M291 and M292: message boxes
M291 parameter | Meaning (1.19; later ones marked) |
|---|---|
P"text" | The message, quotes doubled inside; under 250 characters, within the whole line limit (256 from 3.4, 200 in 3.3, 160 in 2.x) |
R"title" | Title, up to 100 characters from 3.5; PanelDue shows 50 |
S | Mode: 0 no buttons, 1 Close (default); blocking: 2 OK, 3 OK and Cancel, and from 3.5: 4 list of choices, 5 integer, 6 number, 7 string entry |
T | Timeout in seconds, 0 none; default 10 for modes 0 and 1, none otherwise. Applies to modes 0, 1 and those with Cancel. S0 T0 is refused |
X Y Z… | 1 adds jog buttons for that axis, modes 2 and 3 only |
K{"a","b"} (3.5) | Choices, required for mode 4 |
L H (3.5) | Minimum and maximum value (modes 5 and 6) or length (7, default 1 and 10); mode 5 minimum defaults to 0, mode 6 to 0.0, maxima unlimited |
F (3.5) | Default choice, counting from 0, or default value |
J (3.5) | Modes 4 and up: 0 no Cancel (default), 1 Cancel or timeout ends the whole job or macro stack, 2 (3.6.0) sets result to −1 and carries on, so test it on the next line. J2 works in mode 3, which always has Cancel |
The answer is in the input constant. A box requested from USB,
Telnet or serial is also echoed back as text (3.6: first USB, Telnet, second
serial; 3.7 adds second USB and first serial). On SBC systems blocking boxes need
Duet Software Framework 3.1.1.
M292 is what a user interface sends to answer: P0
continue or P1 cancel (mode 3), R{value}
(3.5) the choice or entry, which overrides P, and S
(3.5) the sequence number of the box, needed to dismiss a non-blocking one.
M291 R"Title" P"Message" K{"Yes","No"} S4
if (input == 1)
echo "No chosen"
M300: beep
S frequency in Hz, P duration in ms, C"port"
(3.6) a PWM-capable buzzer port. The sound plays on an attached touch screen,
otherwise in the web interface. Between notes add a G4 at least as
long as the tone.
M300 S2000 P200
G4 P200
M300 S2500 P300
M280: servos
P servo, in RRF 3 a general output port made with M950
(in 2.x the pin number as for M42); S below 544 is an
angle (capped at 180), otherwise a pulse width in µs (capped at 2400), and a
negative value stops the pulses. The angle is a conversion shared with other
firmware and rarely the true servo angle: 1000 to 2000 µs, about 44.2 to 141.2,
covers many servos. RRF 2 took I1 to invert, needed on every
command; in RRF 3 invert the pin in M950.
M950 S0 C"io4.out"
M280 P0 S80
M290: babystepping
(1.18) S, or Z (1.21), shifts Z in mm, positive moving
head and bed apart; other axis letters (2.03) shift those axes; R1
adds (default) and R0 sets the total (1.21). It also reaches queued
moves where possible. A relative step is limited to 10 mm per axis (1 mm up to
3.6.1) and refused for an axis that must be homed first (M564 H);
R0 is accepted but moves only homed axes. Alone it reports. Up to
1.19 homing or probing cleared the offset; since 1.21 only M290 R0 S0
does.
M290 S0.05
M290 R0 S0
M260 and M261: I2C
1.21 and later; on Duet 3 from 3.7.0 (Mini 5+ 1.01, MB6HC and MB6XD 1.02), using
io2.out as SDA and io2.in as SCL with the IO2 input
bypass jumper fitted, 3.3 V devices only; the pins stay reserved until
restart.
| Command | Parameters |
|---|---|
M260 | A address, hex as A"x7F" (2.02); B bytes to send, colon-separated, or S"text" (under 34 characters, ignored with B); R bytes to read (2.02); V"name" (3.6.0) new variable for them, else printed. At most 34 bytes in all |
M261 | Deprecated since 2.02: A address, B byte count, V as above |
M260.1 to M261.2: Modbus and UART
From 3.6. P is the serial port numbered as in M575,
which must first put it in device mode: 2 and 3 are the auxiliary ports from 3.7,
1 and 2 in 3.6. A is the Modbus device address,
S"text" sends characters in place of
B (and is ignored if B is present), and
V"name" stores a reply in a new variable.
| Command | Parameters and effect |
|---|---|
M260.1 | Modbus write: A; F function 5 (one coil), 6 (one register), 15 (coils), 16 (registers, default); R first number; B one 16-bit value per register, or zero and non-zero per coil, or S |
M261.1 | Modbus read: A; F 1 coils, 2 discrete inputs, 3 holding registers, 4 input registers (default); R start; B count; V |
M260.4 | Non-standard Modbus exchange: A; B or S data without address and CRC, which RRF adds; R reply bytes excluding them, which RRF checks and strips; V |
M260.2 | UART write: B bytes (values over 255 keep the low byte) or S |
M261.2 | UART read: B byte count, B0 discards what is waiting; V |
M260.3 | Duet 3, Nordson Ultimus V dispenser: B or S data; RRF does the handshake, adds start byte, length, checksum and end byte, reads the result and closes the transaction |
M260.1 P2 A8 R20 B123:456
M261.1 P2 A80 R10 B2 V"modbusData"
M260.4 P2 A1 B{0x06, 0x00, 0x01, 0x12, 0x34} R5
M260.2 P2 S"Hello world"
M409, M408 and M404
M409 K"path" F"flags"
queries the object model; the reply is JSON with key,
flags and result, null for a bad path. An array in the
path takes [n] or [] for all,
and a leading # returns an array’s length. R passes the
request through to RRF on SBC systems (3.5.2); I is reserved.
| Flag | Effect |
|---|---|
f, v, n, o | Only frequently changing values; include rare ones; include nulls; include obsolete fields (3.3) |
dn | Depth limit; default 1 for an empty key without f |
an | For a large array, start at element n; next in the reply says where to resume, 0 when done |
i, s, p | With f, include the message box; bitmaps as integers; trim for PanelDue (3.6.0) |
From 3.5.0 move.axes is cut to 5 entries (6 with p)
unless f is given; ask with a0 for all. From 3.6.0 some
numbers use exponent notation, and from 3.7.0 certain board and network fields
need v.
M409 K"move.axes[0]" F"v,n,d4"
M409 K"#move.axes"
M408 Stype Rsequence is the older
one-line JSON status: types 0 (short) to 5 up to 3.5, only 0 and 1 in 3.6, gone
in 3.7.0; R is ignored in 3.6. Type 0 carries status
(I idle, P printing, S stopped,
C configuring, A paused or cancelling, D
pausing, R resuming, B busy, F updating,
O off, M simulating, T changing tool),
heaters, active, standby,
hstat (0 off, 1 standby, 2 active, 3 fault), pos,
machine, sfactor, efactor,
babystep, tool, probe,
fanPercent (current tool’s fan first), fanRPM,
homed, msgBox. fields (mode −1 for none) and, while
printing, fraction_printed and timesLeft. Type 1 adds
geometry, axes, totalAxes,
axisNames, volumes, numTools,
myName and firmwareName.
M404 Nmm sets or, alone, reports a nominal filament
width used only to read usage from Pathio and very old KISSlicer files. It is
deprecated from 3.6 in favour of M200, from which it was separate;
D, a nozzle diameter, is ignored from 3.4.0.
Sources
- G-code dictionary – Duet3D’s documentation of RepRapFirmware’s commands, published under a Creative Commons attribution share-alike licence; this page is written in our own words