This guide describes how to setup an optional Single Board Computer (SBC) with Duet 3, allowing the Duet to run in 'SBC mode'. If you don't have, or don't want to connect, an SBC to your Duet, it is not necessary; you can run your Duet in 'standalone' mode, and ignore this guide.
Duet 3 mainboards support connecting a Single Board Computer (SBC) such as a Raspberry Pi. The SBC runs its operating system (Raspberry Pi OS in the case of Raspberry Pi), with the Duet Software Framework (DSF) running on the Raspberry Pi OS. DSF is the bundle of software programs that connects to and controls the Duet 3.
SBC mode allows part of the functionality to be handled by the SBC. This offers a number of benefits:
This guide assumes you are using a Raspberry Pi and the SD card image specifically set up for Duet 3 in SBC mode. In the future other SBCs may be officially supported.
If you want to install DSF on an existing Raspberry Pi OS installation, or on a custom Debian board/installation, please see this page: Duet Software Framework (DSF) on other boards
Duet 3 mainboards are supplied with an SD card that is set up for standalone mode (ie a Duet mainboard without a connected SBC). You will need to flash the SD card with the SBC image; see step 1 below.
Duet 3 mainboards are supplied with an SD card split into two partitions; one FAT32 partition with the files needed for standalone mode, and one partition pre-loaded with the Raspberry Pi OS + DSF, suitable for use with Raspberry Pi 3 or 4.
Most of the time you can start at Step 2 below, as you will receive an SD card pre-flashed with the Raspberry Pi OS + DSF. If you want to use the whole capacity of the SD card for an SBC installation, start at step 1.
If your SD card supplied with the Duet 3 mainboard becomes damaged or lost, start at step 1.
If you are planning to use the SBC for more than plain 3D printing or if you have an SBC with little RAM + external display, it is HIGHLY recommended to obtain a class A1- or A2-rated microSD card instead of the shipped SD card. If your SD card speed is insufficient, you may experience occasional problems when data between the SBC and Duet is exchanged.
OK
when done.This step is unnecessary if you have set up WiFi in the Raspberry Pi Imager.
This method of setting up WiFi is also not supported for the current 'Bookworm' images, only older 'Buster' versions.
This step is optional if you are going to connect to the SBC using an Ethernet network, or if you are going to plug a monitor, keyboard and mouse into the SBC.
Navigate to the “boot” partition on the SD card (note on Windows the other partition will be inaccessible and give an error if you try and access it, this is normal as it is formatted in a filesystem that Windows does not support).
Create a new file named “wpa_supplicant.conf” (exact naming is critical, do not have a ".txt" at the end of the file).
In a text editor add the following:
country=GB
update_config=1
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="SSID_OF_NETWORK"
psk="PASSWORD_OF_NETWORK"
}
Replacing the SSID_OF_NETWORK with your wifi SSID and PASSWORD_OF_NETWORK with your password.
Save and safely eject the SD card.
Note: these steps assume the hostname of your SBC is "duet3". If you have changed it then the mDNS resolution will be the new hostname, not "duet3".
Turn on power to Duet and SBC.
If you have a screen attached when power is applied you will see the SBC boot up. Once bootup is complete the Chromiun browser will launch DuetWebControl in full screen. Press F11 if you want to exit fullscreen.
If you are connecting over the network then go to http://duet3.local/
note the SBC takes about 1 minute to boot for the first time and about 30 seconds subsequently.
If http://duet3.local/
does not show Duet Web Control (DWC) then follow these trouble shooting steps:
If you do not have a screen/keyboard attached to your SBC and your browser cannot connect over wifi all, you will get a message in your browser similar to the one on the right.
If you get a "HTTP ERROR 500 - This page is not working" response either when going to http://duet3.local/
or to the IP address, then the SBC is on the network, but Duet Software Framework (the Duet3 software that runs on the SBC) is not operating correctly.
Ensure there is no SD card in the Duet itself. In order to run in SBC connected mode, the Duet SD card slot must be empty. If an SD card is present in the Duet, it will attempt to start in standalone mode.
Note: this step is optional if you have a screen and keyboard attached to the SBC
Note: this step assumes the username of your SBC is "duet3" and password is "raspberry". If you have changed these, use the new ones in place of "duet3" and "raspberry".
In RRF 3.5 and later, most of the required interaction between a user and the Duet 3, including the SBC, can be done through Duet Web Control. In RRF 3.4.x and earlier, it is necessary to have either a ssh command line, or VNC connection, in order to update the Duet Software Framework software that runs on the SBC.
DuetPi lite (no GUI) has SSH enabled by default and wpa_supplicant.conf is present on the boot partition, because usually you don't have a display attached to those setups.
DuetPi (with GUI) does not have SSH enabled by default, but you can enable it by:
M586 P2 T1 S1
. This makes a persistant change, DO NOT add this line to config.g.Under Windows the easiest way is via “Putty”:
Download & Install Putty.
Enter duet3.local or your SBC IP address and select ssh.
Agree to the security alert - it is Putty Saying it has never connected to this SSH server before.
Login with username “pi” and password “raspberry”
Under macOS and Linux the "ssh" program is accessible from the command line. macOS guide here.
ssh pi@duet3.local
For all systems, once connected, you will be presented with a command line:
pi@duet3:~ $
To update the Duet Software Framework and other system components type:
sudo apt update
(the sudo password is raspberry)
Then
sudo apt upgrade
If you prefer a desktop environment to a command line then you can use the realVNC client to connect.
First follow the steps above in "Connecting via SSH" until you are at a command line on the pi.
type
sudo raspi-config
Navigate to Interfacing Options.
Install the realVNC client on the machine you want to use to connect. You can use the free version non commercially.
Once installed open the realVNC client, go to "file" -> "new connection" and use duet3.local or the IP address of your SBC to connect. the username and password are the same as for ssh.
For a full list of SBC-related commands, see this page in the DSF Github repository.
Rather than just yanking the power cord from the SBC, from RRF 3.4, you can command a 'graceful' shutdown or reboot of the SBC from DWC, by sending:
M999 B-1 P"OFF" ; Shut down SBC
M999 B-1 ; Reboot SBC
Or connect via SSH, or open a terminal, and send sudo systemctl poweroff
to shutdown, or sudo systemctl reboot
to reboot.
If you have a keyboard and monitor connected to your SBC, or connect via VNC, you can simply use the Operating system shutdown and reboot menu option.
Once your Raspberry Pi has established an internet connection, it is recommended to install the latest updates. The following commands will install the latest software components and the latest RepRapFirmware version on your Duet 3. You can do this regularly to update the system as new firmware is released.
In RRF 3.5 and later, users running the latest Bookworm-based DuetPi image can use M997 S2
to install the latest DSF and security-related packages on DuetPi (via apt update
/unattended-upgrade
). Note that this M-code only installs security- and Duet-related software updates.
In RRF 3.4.x and earlier, or users running on earlier Buster-based DuetPi images, connect via SSH or VNC (see above) to your Raspberry Pi or open a terminal (if you have keyboard and monitor connected) and run:
sudo apt update
sudo apt upgrade
In RRF 3.5 and later, users running the latest Bookworm-based DuetPi image can use M997 S2
with two optional parameters to switch between release versions.
F"<feed>"
- Set package feed for DSF packages where <feed>
can be stable
(default), unstable
, stable-x.y
, or unstable-x.y
where x.y corresponds to a version. e.g. 3.4 or 3.5.V"<version>"
- Install a specific DSF/RRF combination (may not be used together with M997 F
). Example: M997 S2 V"3.5.0-rc.2"
For example, M997 S2 F"unstable"
switches to the 'unstable' package feed, and M997 S2 V"3.5.0-rc.2"
downgrades to the specificied DSF/DWC/RRF version.
In RRF 3.4.x and earlier, to switch between stable/release package feed and unstable/beta package feed, see DSF installation.
By this step you should have Duet Web Control showing when you go to http://duet3.local/
or the IP address of your SBC.
The default SD card image does not come with the system files configured for your printer - there are many different types of machines that are supported so you need to generate a config.g, homing files, and other system macro files that are required.
The online RepRapFirmware configuration tool has been updated to support the generation of config files for RRF3. Though you may still need to manually implement some of the more advanced features.
The changes required to create a set of Duet 3 config files is outside the scope of this guide. Please see the Migrating from RRF2 to RRF3 guide for a list of the gcodes that need changing to get a config.g setup for duet 3.
Once you have a set of system files they can be uploaded via the "system" tab in DWC.
This is a list of commands whose use differs from when used in standalone mode. See the Gcode dictionary entry for usage.
In SBC mode and RRF v3.4 or newer these commands may be used to mount/unmount block devices or remote endpoints using the mount command. These commands should go in dsf-config.g NOT config.g.
M21 Mount device (Initialize SD card)
M22 Unmount device (Release SD card)
M540 and M550 commands, if needed, should go in dsf-config.g NOT config.g.
M540 Set MAC address
M550 Set Name (see 'Changing the SBC hostname' below)
Sending any of the following command makes a persistent change. They do not need to be added to dsf-config.g. They should NOT be included in config.g.
M552 Set IP address, enable/disable network interface
M553 Set Netmask
M554 Set Gateway
M586 Configure network protocols
M587 Add WiFi host network to remembered list, or list remembered networks
M588 Forget WiFi host network
M589 Configure access point parameters
This is an optional step if you only have a single duet3 on your network. It is required if you have more than one duet 3 as each duet 3 on a network needs a unique host name.
Send M550 to change the hostname, in SBC mode this change is permanent and M550
does not need to be put in config.g
unless you wish to use a slightly different name with spaces and/or alternative casing (e.g. to change the displayed hostname ender3pro
to Ender 3 Pro
, use M550 P"Ender 3 Pro"
).
In order to change the SBC hostname, the DuetPiManagementPlugin must be running.
The name of the printer is its hostname on the network, you will need to connect to the SBC over SSH or VNC (as described above) in order to run the Raspberry Pi configuration utility and change the hostname. Note that you cannot use the gcode command M550 to set your printer hostname
sudo raspi-config
When you next boot with a screen, or log in with VNC, Chromium may give you the following warning. Select “unlock Profile and Relaunch”.