This page gives RepRapFirmware’s codes for its network interfaces, WiFi networks, MQTT, serial and SPI links, firmware compatibility mode and LED strips, from the Duet3D G-code dictionary as read on 3 December 2026. RRF means RepRapFirmware, and version numbers are its versions. Standalone mode means the board runs on its own; SBC mode means a single board computer is attached and runs Duet Software Framework (DSF).
M540, M550 and M551: address, name and password
| Command | Parameters and effect |
|---|---|
M540 | MAC address as six hex bytes separated by colons: P the address, I interface (default 0). Without P it reports. Ethernet Duet boards in standalone mode only; a WiFi module keeps its own fixed address. The default is made from the processor’s unique ID. Send it before other network commands. From 3.7 in standalone mode P may be a string expression |
M550 P"name" | Machine name, shown by Duet Web Control; quotes recommended, and ; cannot be used. The mDNS (name.local) and NetBIOS names are made from it in lower case, keeping letters, digits, - and _, and cut to 15 characters |
M551 P"password" | Password, asked for on connection when it differs from the default reprap; quotes recommended, ; not allowed. It is stored and sent unencrypted and gives no real security |
M540 PDE:AD:BE:EF:CA:FE
M550 P"Godzilla"
M551 P"my-very-secret-word"
In SBC mode M540 and M550 belong in
dsf-config.g, not config.g.
M552: interface and IP address
I chooses the interface (default 0; on a Duet 3 MB6HC 1.02 or
later with the WiFi module, 0 is Ethernet and 1 WiFi). Alone,
M552 reports the state and address.
| Parameter | WiFi interface | Ethernet interface |
|---|---|---|
S | 0 networking off, 1 on as a client, 2 on as an access point, −1 WiFi module off | 0 off, 1 on; without S the state is unchanged |
P | (1.20) SSID to join, registered before with M587; without it, the strongest registered network | IP address; 0.0.0.0 asks DHCP |
T (3.7, with S) | 1 enable TLS, 0 none (default), −1 delete the certificate and key held by the module. Needs an ESP32 module with WiFi firmware 2.4.0 | Standalone: 1 enable TLS with /sys/server.crt and /sys/server.key, 0 none (default), −1 delete both files securely; −1 acts only while config.g runs at start-up |
M552 S1 P"MyNetwork"
M552 S1 P192.168.1.14
M552 I1 S1 P0.0.0.0
- A WiFi network’s address, gateway and netmask are set by
M587;M553andM554do not apply. - When both certificate files are on the card, each
M552 T1 S1on WiFi copies them into the module and deletes them from the card. - TLS is not remembered after a restart, so keep
T1inconfig.g. On WiFi,M552 S1withoutT1clears the setting. On Ethernet, only the firstM552 S1after start-up sets it: changing it needs a restart. T1only enables TLS support; each secure protocol is then switched on withM586 … T1. The dictionary reports a Chromium browser bug that breaks large TLS transfers to these boards and advises Firefox.- From 3.7 in standalone mode no protocol is on by default: add
M586 P0 S1(orM586 I1 P0 S1for the optional WiFi interface) for Duet Web Control. - In SBC mode the change is persistent: send it once, not from
config.g, andI1chooses the computer’s second interface.
M553 and M554: netmask, gateway and DNS
| Command | Parameters |
|---|---|
M553 | P netmask; I interface, SBC mode only |
M554 | P gateway; S DNS server (DSF 3.3 with the DuetPi system configuration plugin); I interface, SBC mode only |
M553 P255.255.255.0
M554 P192.168.1.1
In standalone mode I is ignored and both set only the Ethernet
interface; without P they report that stored setting, not what
DHCP supplied. A restart may be needed. From 3.7 in standalone mode
P may be a string expression. In SBC mode the change is
persistent; set a static address before a gateway or DNS server.
M555: compatibility mode
M555 Pn makes input and, above all, replies resemble
another firmware, only on the channel that sends it: 0 or 1 RepRapFirmware,
2 Marlin, 3 Teacup, 4 Sprinter, 5 Repetier (3 to 5 end replies with
ok, as 2 does), 6 nanoDLP (2.02).
M575: serial ports
| Parameter | Meaning |
|---|---|
P | Channel. From 3.7: 0 main (typically USB), 1 second USB port, 2 first auxiliary serial port (PanelDue, usually io0 on Duet 3), 3 second auxiliary port (RS485, usually io1). Up to 3.6: 0 main, 1 and 2 the auxiliary ports |
B | Baud rate, default 57600; ignored on a true USB port |
S | Mode, in the table below |
C"port" | Transmit/receive control pin of an RS485 transceiver for Modbus RTU in mode 7; not needed with built-in or automatically switching transceivers (which some Modbus devices do not work with) |
F (3.7) | Device mode only: 0 8 data bits, no parity (default), 1 even parity, 2 odd parity |
S | Mode | Since |
|---|---|---|
| 0 | PanelDue | |
| 1 | PanelDue, checksum or CRC required (default) | |
| 2 | Raw | 3.01 |
| 3 | Raw, checksum or CRC required | 3.01 |
| 4 | PanelDue, CRC required | 3.4 |
| 5 | Disabled | 3.6 |
| 6 | Raw, CRC required | 3.4 |
| 7 | Device, such as Modbus or raw UART | 3.6, some boards |
Auxiliary ports stay off until M575 enables them. From 3.6.0 USB
can be put in PanelDue mode. In PanelDue mode replies are wrapped in JSON with
field names, which resists noise and lost data; in raw mode they are plain
text. The check data is described under
line syntax.
M575 P2 B57600 S1
M575 P3 B9600 S7
M114
{"seq":6,"resp":"X:10.000 Y:50.000 Z:1.000 … Bed comp 0.000\n"}
M576 and M576.1: the link to a single board computer
M576 parameter (3.4, SBC mode) | Meaning |
|---|---|
S | Maximum delay between full SPI transfers, ms; default 25, maximum 4000 |
F | The same while a file is open, default 5; removed in 3.7 |
P | Number of events needed to skip the delay, default 4 |
B (3.7) | Burst window in ms, default 50: after an expression evaluation, variable assignment or macro request, transfers continue at the burst delay this long |
D (3.7) | Delay in burst mode, ms, default 2 |
M576.1 Pversion (3.7, SBC mode, Duet 3 MB6HC, MB6XD and
Mini 5+) moves the computer link from SPI to the USB channel it arrives on.
version must be the firmware’s protocol version (7 in 3.7.0). It
fails with “Unsupported protocol version” without P, with another
version or with a computer already connected. It is not a user command: DSF
sends it when the board started without an SD card and nothing is on SPI.
M586: network protocols
| Parameter | Meaning |
|---|---|
P | 0 HTTP or HTTPS, 1 FTP or SFTP, 2 Telnet or SSH, 3 multicast discovery (specific to some makers), 4 MQTT |
S | 0 disable (both plain and secure), 1 enable; without it the state is reported |
T | With S1: 0 plain (default), 1 TLS |
R | With S1: TCP port; the default depends on protocol and T (80, 21 and 23 plain) |
H | Remote server address, MQTT only |
I (3) | Interface, default 0; standalone mode only |
C"site" (3.2) | Set or reset the site allowed for cross-origin (CORS) HTTP requests |
In standalone mode TLS needs 3.7, an Ethernet interface or ESP32 WiFi module
and M552 T1; it gives HTTPS, FTPS and TelnetS on ports 443, 990
and 992, enabled separately from the plain ones. In SBC mode the secure forms
are HTTPS, SFTP and SSH, settings persist (keep them out of
config.g) and per-interface limits need a firewall on the
computer. Versions 1.18 to 3.6 enable only HTTP (or HTTPS where supported) by
default; 3.7 in standalone mode enables nothing.
M586 P0 S1
M586 P1 S0
M586 P0 S1 T1
M586.4: MQTT client
From 3.5 on Duet 3 WiFi boards in standalone mode with WiFi server 2.1; SBC
mode and Duet 3 Ethernet from 3.6.0. The broker’s address and port are given
with M586 P4, and messages are published with
M118 P6.
| Parameter | Meaning |
|---|---|
U"user" | User name, for brokers that refuse anonymous login |
K"password" | Password; read only with U |
C"id" | Fixed client ID, used with persistent sessions; not in 3.5 standalone mode |
W"message" | Will message sent to subscribers if the board drops off without disconnecting; none by default |
T"topic" | Topic of the will message, with W |
Q, R | With W: quality of service 0 to 2 and retain flag 0 or 1, both default 0 |
S"topic" | Add a subscription |
O | With S: maximum quality of service of the subscription, 0 to 2 |
N (3.6, standalone) | Clean session flag, default 1; N0 asks for a persistent session |
In standalone mode the parameters may be spread over several lines. In SBC
mode, 3.5 needs C, U and K and
everything on one line; 3.6 makes them optional and allows several lines.
M586.4 C"duet"
M586.4 U"username" K"password"
M586.4 S"subscription" O2
M586 P4 R1884 H192.168.10.244 S1
M118 P6 S"message" T"topic"
M586 P4 S0
M587 and M588: remembered WiFi networks
M587, its sub-codes and M588 must not be used in
config.g: it is a security risk, repeated writing can wear out the
WiFi module’s flash, and the module is only started when config.g
has finished. Use a macro. The module must be out of reset, so send
M552 S0 first if it has not been started.
M587 parameter | Meaning |
|---|---|
S"ssid" | Network name, case sensitive, always quoted |
P"password" | Password, case sensitive, always quoted; required even for an open network, where it is ignored but must be empty (standalone only) or at least 8 characters |
I, J, K | Fixed address, gateway and netmask; J and K are used only with I. With no or zero address, DHCP supplies all three |
L, C | DNS server, and WiFi country code if not set before (DuetPi with DSF 3.3) |
F | Listing format: 0 text (default), 1 JSON |
X (3.5, standalone) | Authentication: 0 WPA2-PSK (default), 1 EAP-TLS (ESP32-S3 modules only), 2 EAP-PEAP-MSCHAPv2, 3 EAP-TTLS-MSCHAPv2 |
E"file" | Enterprise modes: CA validation certificate in /sys |
A"identity" | Anonymous identity; required for EAP-TLS, optional for the other two |
U, P, Q | EAP-TLS: client certificate file and private key file in /sys, and the key’s password. EAP-PEAP and EAP-TTLS: U user name and P password |
Enterprise authentication is experimental and needs 3.5 with WiFi server 2.1.
From 1.19.2, inside a quoted string a single quote makes the next character
lower case, for senders that upper-case everything, and two single quotes stand
for one. Plain letters, digits and simple punctuation are safest in names.
Without parameters, M587 lists the names but not the passwords. In
SBC mode (DSF 3.3) there is no separate address per network, and the change is
persistent.
| Command | Parameters and effect |
|---|---|
M587.1 | (3.5, WiFi firmware 2.0) Start a network scan; none. The current connection drops until it ends |
M587.2 | (same) Wait for the scan and return the result: F0 text (default), F1 JSON |
M588 S"ssid" | Forget a network and its password; S"*" forgets all, and in standalone mode also resets the module to factory settings. Forgetting the current network does not disconnect it |
M587 S"Network-ssid-123" P"Password123" I192.168.1.200
M587 X2 E"ca.pem" S"test-ap" U"bob" P"hello"
M588 S"Network-ssid-123"
M589: access point settings
| Parameter | Meaning |
|---|---|
S"ssid" | Name to use as an access point; S"*" deletes the stored details (standalone mode) |
P"password" | At least 8 characters; WPA2 by default |
I | IP address |
C | Channel, optional |
T (standalone) | Maximum transmit power, 0 to 20.5 dBm; ignored together with S |
Send it once from the console or a macro; the module keeps the settings. Not in
config.g, which instead uses M552 S2 to start the
access point. Start the module with M552 S0 first if needed.
M589 S"DuetSSID" P"password" I192.168.0.1 C1
M150: LED strips
| Parameter | Meaning |
|---|---|
R U B | Red, green and blue, 0 to 255 |
W | White, 0 to 255, RGBW NeoPixel only (3.3) |
P or Y | Brightness, 0 to 255 with P or 0 to 31 with Y |
S | How many LEDs get these values, default 1; always give it, as early versions fill a whole board-dependent chunk without it |
F | F0 last command for the strip (default), the next starts at the beginning again; F1 more follow for the LEDs further along |
E (3.5) | Strip number, default 0, defined with M950 |
X (up to 3.4) | LED type, remembered: 0 DotStar (default before 3.2), 1 RGB NeoPixel (default from 3.2), 2 bit-banged RGB NeoPixel, 3 RGBW NeoPixel (3.3), 4 bit-banged RGBW. Not every board has every type; on Duet 3 Mini, 1 and 3 are the board’s NeoPixel output and 2 and 4 the LEDs of some 12864 displays |
Q (up to 3.4) | SPI frequency in Hz, read only with X; NeoPixels need 2.4 to 4 MHz |
LEDs that no command reaches keep their earlier colour. NeoPixel strips are
supported on Duet 3 from RRF 3 and on Duet 2 from 3.3, and from 3.5 on any
low-voltage digital output. Where the pin cannot make the timing in hardware
(any Duet 2 pin, or a pin other than the Duet 3 LED port), RRF waits for motion
to stop and disables interrupts while sending, which can lose serial input.
Some strips order colours differently: swap R and U,
or from 3.7 set the order with the K parameter of
M950.
M950 E0 C"led" T1 Q3000000
M150 E0 R255 P128 S20 F1
M150 E0 U255 B255 P255 S20
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