Installing and Updating Firmware
Instructions to update the main firmware on Duet 2 WiFi, Ethernet and Maestro boards, Duet Web Control (DWC) and the WiFi firmware on Duet 2 WiFi boards.
Notes before you start
- This section is for Duet Maestro and Duet 2 (WiFi and Ethernet) firmware only. The Duet 3 stand-alone process is similar; the Duet 3 + Pi process is quite different. See Getting Started with Duet 3 for more information.
- Some updates to the main firmware on a Duet WiFi may require an update to a compatible WiFi server firmware version as well, and vice versa.
- See the updating WiFi firmware or DuetWebControl files section below which explains how to do this. ** If you download more than just the main firmware (DuetWiFiFirmware.bin/Duet2CombinedFirmware.bin) then please read the updating more than one firmware at a time section below before proceeding as the firmware needs to be updated in a specific order.
- Check that you have downloaded the correct firmware before installing it. The Duet2CombinedFirmware.bin or DuetMaestroFirmware.bin file should be the same size as shown on the github Release page (currently about 300 KB in size).
- Make sure you download and save the file as bin or zip and check the files sizes match.
- For RepRapFirmware 2, please ensure you read the "Whats New RRF2" notices for the new version of the firmware as it will contain information on changes that effect your configuration.
- For RepRapFirmware 3, please ensure you read the "Whats New RRF3" notices for the new version of the firmware as it will contain information on changes that effect your configuration.
- Backup your SD card and download a copy of your current firmware version in case you need to go back.
NOTE: Upgrading a Duet 2 Wifi from 1.18.2 or earlier firmware to 1.19 or later firmware required a special procedure. See Upgrading to 1.19 or later lower down this page.
Upgrading a Duet 2 Wifi or Duet 2 Ethernet from 1.20 or earlier firmware to 1.21 or later requires a file to be renamed. See Upgrading to 1.21 or later lower down this page.
- Connect DuetWebControl.
- Go to the Settings page. (For DWC2, go to the system page)
- On the General tab, press Upload File(s) and browse to the new firmware binary file. It may be called something like Duet2CombinedFirmware-xxx.bin where xxx is a version number. This is ok because it will be renamed automatically by removing the -xxx part. (For DWC2, use the "Upload System Files" button)
- After uploading, Duet Web Control will ask you whether you want to install the new firmware. If you are only updating the main firmware, answer Yes. If you are updating WiFi firmware as well, answer No so that you can upload the new WiFi firmware too.
- If your 3D printer is idle when you upload the file but Duet Web Control does not offer to install it, then it doesn't recognise the filename as being a firmware binary. Check that you have uploaded the correct file, also see the section later on this page about the filename change that was made at firmware version 1.21.
Fallback procedure #1
If you are unable to connect to your Duet from a browser, but you can connect to the Duet via USB using Pronterface or YAT etc:
Use caution when connecting your Duet to a PC via USB while VIN is still connected as this may lead to a ground loop situation See here for more details: USB ground loops
- Take the on-board SD card out and put it in a computer
- Delete any existing firmware files in /sys (Duet2CombinedFirmware.bin, DuetMaestroFirmware.bin, DuetWiFiFirmware.bin or DuetEthernetFirmware.bin)
- Copy the new firmware binary file to the /sys folder. For a Duet WiFi or Duet Ethernet, it must be called exactly Duet2CombinedFirmware.bin on the SD card. For a Duet Maestro it must be called DuetMaestroFirmware.bin.
- Also copy file iap4e.bin (for Duet WiFi/Ethernet) or iap4s.bin (for Duet Maestro) into /sys
- If your board is a Duet WiFi, also copy the new DuetWiFiServer.bin file into /sys
- Eject/safely remove the SD card from the PC
- Replace the on-board SD card in the Duet 2 WiFi
- Restart the Duet 2 WiFi and connect with Pronterface or YAT
- Send command M997 S0 to install the firmware.
- Press the Disconnect button in Pronterface, then when the USB port disappears and reappears about 20 seconds later, press Connect.
- Send M115 to confirm the new firmware version
- If the board is a Duet WiFi, send M997 S1 to install the WiFi module firmware
Note: when you run M997 S0, if your board is a Duet WiFi or Ethernet running old firmware, you may get an error message telling you that file DuetWiFiFirmware.bin or DuetEthernetFirmware.bin was not found. If that happens, copy or rename the Duet2CombinedFirmware.bin file to that filename and try again.
Fallback procedure #2
If you can’t connect to the board via USB/Pronterface:
- Remove the on-board SD card from the computer and put it in a PC
- Use a text editor to comment out the M552 S1 command in config.g.
- Save the file and eject the on-board SD card
- Put the on-board SD card back in the Duet 2
- Start the Duet 2 and see if you can connect Pronterface or a terminal emulator. If so, continue with Fallback Procedure #1.
Fallback procedure #3
Only use this if the firmware on the Duet 2 has been corrupted, or if you have accidentally pressed the Erase button, so you can’t connect over USB with Pronterface even with WiFi disabled in config.g.
Use caution when connecting your Duet to a PC via USB while VIN is still connected as this may lead to a ground loop situation See here for more details: USB ground loops
Before proceeding, connect the Duet to your PC using a USB cable and check whether the Duet is visible in the port list. Under Windows you can do this by going to Device Manager and expanding Ports (COM and LPT). If Duet 3D printer electronics is listed, you should be able to connect using Pronterface or YAT unless some other program is already using the port. If Bossa Port is listed then the firmware has already been erased. If neither is listed:
- Try a different USB cable
- Try a different USB port
If you get the Duet 3D printer electronics port to appear, then firmware is already running on the Duet and you should use fallback procedure #1 or #2 instead. If you get Bossa Port, read on.
You will need a Windows or Linux PC.
- Download the main firmware file from https://github.com/dc42/RepRapFirmware/r....:
- For Duet WiFi/Ethernet version 1.20 and earlier use DuetWiFiFirmware.bin for the Duet 2 Wifi, DuetEthernetFirmware.bin for the Duet 2 Ethernet.
- For version 1.21 or later (recommended) use Duet2CombinedFirmware.bin for Duet 2 Wifi or Ethernet
- For Duet Maestro use DuetMaestroFirmware.bin
- Verify that the downloaded firmware file has the correct size, as shown on the page you downloaded it from.
- Download and install Bossa 1.9.1 from https://github.com/shumatech/BOSSA/relea.... Alternatively, download and install SAM-BA version 2.17 from here http://www.microchip.com/DevelopmentTool...
- Connect the Duet 2 to your PC via USB.
- Verify that the 5V and 3.3V LED are on before continuing.
- Erase the firmware on the Duet 2 by either:
- Pressing the Erase button for Duet WiFi/Ethernet pcb revisions 1.03 or earlier
- Jumpering the erase jumper for Duet Maestro or for Duet WiFi/Ethernet pcb revisions 1.04 and later.
- Remove the erase jumper as soon as the Diag LED lights up. This means you are successfully in programming mode.
- then the Reset button (if one is present).
- Load Bossa or SAM-BA. It usually detects the correct COM port automatically.
- If using Bossa:
- Check boxes Erase all, Lock, and Boot from Flash
- Browse to the Duet2CombinedFirmware.bin or DuetMaestroFirmware.bin file to be installed, then press Write.
- When the write completes, press Verify
- It is also possible to use the command line version (bossac) with this command line (replace COMxx by the correct COM port number):
bossac --port=COMxx -b -U -e -w -v path\Duet2CombinedFirmware.bin -R
- If using SAM-BA:
- For Duet WiFi/Ethernet, select at91sam4e8-ek. For Maestro, select at91sam4s8-ek. Press Connect. A connection error will be reported if the wrong board is selected.
- In the Send File Name box enter or browse to the Duet2CombinedFirmware.bin or DuetMaestroFirmware.bin file to be installed, then press Send File (leave the Address at the default of 0x400000). On completion it will invite you to lock the region; press Yes.
- If desired, press Compare sent file with memory.
- Press the Execute button next to the Boot from Flash option in the Scripts box. Then exit SAM-BA.
- Press Reset on the board or on boards that don't have this button, remove and restore 5V power (usually provided by the USB cable).
- You should now be able to connect via USB/Pronterface or YAT.
Updating WiFi firmware or DuetWebControl files
Important: if you are also upgrading RepRapFirmware (which for the Duet 2 WiFi is DuetWiFiFirmware.bin for version 1.20 or earlier and Duet2CombinedFirmware.bin for 1.21 and later) you should normally upgrade that first.
Note, this does not apply to the Duet Ethernet or Duet Maestro.
Updating WiFi firmware
- Upload the new DuetWiFiServer.bin file to the /sys folder on the on-board SD card, either via the Settings page of DuetWebControl (if WiFi is working), or by temporarily moving the on-board SD card to a PC. If you copy it directly to the SD card on a PC, you must remove the version number from the filename so that its name on the SD card is exactly DuetWiFiServer.bin. If you upload it through the Settings page of DuetWebControl, the renaming will be done automatically.
- Send command M997 S1 to install the new firmware. Preferably, send this command from Pronterface or PanelDue, because then the update status will be reported.
- If you sent the M997 S1 command via the web interface, it will lose the connection and you should allow a minute or so for the firmware installation to complete before you press the Connect button.
Updating DuetWebControl files
If your Duet 2 WiFi is running main firmware 1.19 or later:
- Upload the new DuetWebControl.zip file through the General tab on the Settings page of DuetWebControl.
- If the web interface is not working, then move the SD card to a PC, delete or rename any existing /www folder, create a new one, and extract the contents of DuetWebControl.zip into it. Do not unzip the individual .gz files, leave them as they are on the SD card.
If your Duet 2 WiFi is running firmware 1.18 or earlier:
Note we recommend upgrading to 1.21 or later stable firmware, these steps will work but later versions of DWC will have compatibility issues with older firmware
- Upload the new DuetWebControl.bin file to the /sys folder on the on-board SD card, either through the General tab on the Settings page of DuetWebControl or by moving the SD card to a PC.
- Send M997 S2 to install it (if you uploaded it through DuetWebControl then it will offer to do this for you).
- Installation takes several minutes and the WiFi interface is not available while it is in progress, so it is best done with Pronterface or with a PanelDue connected so that you can see when it is finished. Alternatively you can tell it is finished when the blue LED on the WiFi module stops flashing.
Updating more than one firmware at a time
If you need to upgrade more than one of DuetWiFiFirmware/DuetEthernetFirmware, DuetWiFiServer and Duet Web Control, do them in this order:
- DuetWiFiFirmware, DuetEthernetFirmware (pre release 1.21) or Duet2CombinedFirmware (release 1.21 or later)
- DuetWiFiServer (Duet 2 WiFi only)
Sometimes we may do synchronised releases of firmware, where more than one firmware component needs to be updated at the same time to maintain compatibility. To perform simultaneous updates of more than one firmware:
- Upload all the firmware files to /sys on the on-board SD card, but decline any offers to install them.
- Use the M997 command to install them all at once, specifying which firmwares you want to update in the S parameter. For example, M997 S0:1:2 will update all firmwares, provided that all the firmware files and iap4e.bin are present in /sys on the SD card.
Special considerations for upgrading between particular firmware versions
Upgrading a Duet 2 Wifi from 1.18.2 or earlier to firmware 1.19 or later
In firmware version 1.19 for the Duet 2 WiFi the webserver functionality has been moved off the Wifi module onto the Duet main processor. This means that the updates to the main firmware and the Wifi firmware need to be synchronised, and the DuetWebControl files are read from the SD card instead of being uploaded to the Wifi module. Also the network SSID and password are sent to the WiFi module using gcodes. So upgrading from earlier firmware versions is not as straightforward as usual.
If you are already running 1.19beta or RC version of DuetWiFiFirmware and DuetWiFiServer, you can upgrade them the 1.19 release individually through the web interface in the usual way.
Getting ready to upgrade
Get ready to upgrade the Duet 2 WiFi by putting the following files on the SD card:
- The contents of DuetWebControl-1.19.zip, extracted into the /www folder. Existing versions of DWC won't let you upload a file called DuetWebControl*.zip to a Duet 2 WiFi, so you will either have to do this on a PC, or you can rename it to e.g. DWC.zip and then it should upload. If there is a /www folder already on the SD card, I recommend you delete it and create a new one.
- DuetWiFiFirmware-1.19.bin, copied into /sys and renamed to exactly DuetWiFiFirmware.bin. If you wish, you can upload this through the web interface, but decline the offer to install it.
- DuetWiFiServer-1.19.bin, copied into /sys and renamed to exactly DuetWiFiServer.bin. If you wish, you can upload this through the web interface, but decline the offer to install it.
- A macro file in /macros to set up access to your WiFi network. I'll call this file SetNetwork, but you can choose any name you like. This should contain the following commands:
M552 S0 G4 P1000 M587 S"your-network-ssid" P"your-network-password"
Substitute your own network SSID and password in the M587 command. If your password contains any double quote marks, use 2 double quote marks to represent each double quote mark in the password. The reason for using a macro file is that USB host programs such as Pronterface normally convert characters to uppercase when sending commands, which is likely to make it impossible to send your network password correctly. You can optionally specify a static IP address by adding parameter Inn.nn.nn.nn to the M587 command.
- Disable the M552 S1 command in your config.g file by putting a semicolon at the start of the line
Note: if you move the SD card to a PC to change the files on it, you should restart the Duet after you put the SD card back in it.
- If you are using a Windows PC, make sure that the Duet USB driver on the PC is version 1.18.1 or later.
Doing the upgrade
- Send M997 S0:1 to upgrade both firmwares together.
- When the Duet has restarted after the firmware upgrade, execute the SetNetwork macro on PanelDue or via USB (if using USB then the command is M98 P/macros/SetNetwork).
- Send M587 and check that your network is listed
- Send M552 S1. After a few seconds you should see a message that it has connected to your access point.
- Connect via the web interface
- Re-enable the M552 S1 command in config.g by removing the semicolon at the start
- For security, delete the SetNetwork macro file
You can send further M587 commands if you like to specify additional access points that the Duet can connect to. It will connect to access point from which it receives the strongest signal. To remove an access point from the list, use the M588 command.
Upgrading a Duet 2 WiFi or Ethernet from firmware 1.20 or earlier to 1.21 or later
In firmware 1.21 and later, the Duet 2 WiFi and Duet 2 Ethernet use a common firmware binary file, which is named Duet2CombinedFirmware.bin. However, if the current firmware on your Duet is 1.20 or earlier then it won't recognise that name as being a valid firmware binary. Therefore, after downloading Duet2CombinedFirmware.bin, rename it to DuetWiFiFirmware.bin or DuetEthernetFirmware.bin (as appropriate for your board) and then upload it.
If you have an older Duet 2 board then you should also upgrade the iap4e.bin file to the current version, to ensure that future firmware upgrades go smoothly.
Upgrading a Duet WiFi/Ethernet/Maestro from firmware 2.x to 3.01 or later
The version 3.01 and later binaries are too large to be installed by the IAP program supported by version 1.x and 2.x firmware. Therefore you cannot upgrade directly from version 1.x or 2.x firmware to 3.01 or later firmware. This is the procedure:
- Download file Duet2and3Firmware.zip from https://github.com/dc42/RepRapFirmware/r...
- Upload and install that file on the Duet through Duet Web Control
- Send M115 and check the response to confirm that you are running version 3.0 firmware
- You can then upgrade to version 3.01 or later firmware.
Important! When upgrading from 1.x or 2.x firmware to 3.x you will need to make substantial changes to your config.g file. See RepRapFirmware 3 overview.
How to recover if the main firmware and WiFi firmware versions get out of step on your Duet 2 WiFi
If you install incompatible main firmware (Duet2CombinedFirmware.bin or DuetWiFiFirmware.bin) and WiFi server (DuetWiFiServer.bin) versions, then you will not be able to connect over WiFi, and when the WiFi module is enabled you might not be able to communicate via USB either. Here's how to recover.
Copy files to the SD card
- Take the SD card out of the Duet and put it in an adapter connected to your PC.
- Use Notepad++ or another text editor to put a semicolon character at the start of the M552 line in file /sys/config.g so that the main firmware does not attempt to enable the WiFi module at startup.
- In a browser go to https://github.com/dc42/RepRapFirmware/r... and foinr the latest stable release - that's the one nearest the top of the page without "beta" or "RC" in the name
- Download files Duet2CombinedFirmware.bin, iap4e.bin and DuetWiFiServer.bin
- Copy those files into /sys on the SD card. They must have exactly those filenames, so if the files you downloaded had the version number included in the filename, then you will need to rename them. Note, if your existing firmware is 1.21 or earlier then you will also need a second copy of Duet2CombinedFirmware.bin renamed to DuetWiFiFirmware.bin, also in /sys.
- Also download file DuetWebControl.zip (it may have a version number in the filename, for example DuetWebControl-1.22.6.zip)
- Delete or rename the existing /www folder on the SD card, and create a new one.
- Unzip the contents of your chosen DuetWebControl.zip file into that new /www folder. When done, inside /www there should be subfolders css, fonts and js.
- Safely remove or eject the SD card and put it back in the Duet. If you didn't power the Duet down before you removed the SD card, send M21 to the Duet to tell it to re-mount the SD card.
Connect via USB
- Connect the Duet to your PC via USB. If you have any high-current 5V devices connected to your Duet (e.g. PanelDue with a 7" screen, or servos) then you will also need to supply VIN power; otherwise USB power should suffice.
- If you are using a Windows PC, make sure that the Duet device driver installed on it is up to date. Later versions of the driver work with old firmware versions too, but older drivers versions may not work with later firmware.
- If you are using a Windows PC, open Device Manager and expand Ports (COM and LPT). If you are using Linux or Mac, use the corresponding tools for those platforms instead.
- Hopefully you will see "Duet 3D Printer electronics" and you can proceed to the next step.
- If instead you see "Bossa port" then you have pressed the Erase button, and you will need to install new main firmware via USB. See Fallback procedure #3 higher up.
- If you see no port at all, go to what to do if your Duet or Duet 2 Wifi won't respond.
Update main firmware, if needed
- Run M115 from pronterface or YAT to check what main firmware you are running.
- If it is not the version you want, run M997 S0 to install the version you copied to the SD card. The USB port will disconnect when the upgrade starts. If you are using a recent version of iap4e.bin then the Diag LED on the Duet will flash while the firmware is being installed. After about half a minute, the Diag LED will stop flashing and the Duet port should re-appear in Device manager, then you can reconnect Pronterface or YAT.
- Sometimes Windows gets confused by the port disappearing and reappearing. So if Windows gives an error message or the port doesn't reappear within one minute, try plugging the Duet into another USB port, or reboot the PC.
Upgrade WiFi firmware, if needed
- If you are running main firmware 1.19 or later, send M552 S0 to start the WiFi module. If you are running main firmware 1.18 or earlier, send M552 S1.
- If the firmware responds with an error message, or it doesn't respond at all even after one minute, then the WiFi firmware is incompatible with the main firmware and needs to be reinstalled. Otherwise, send M122 and look at the WiFi firmware version reported, so see if you have the correct version installed.
- To install the WiFi firmware that you copied to the SD card, send command M997 S1.
- Depending on the firmware versions you upgraded from/to (for example, if you upgraded from pre-1.19 firmware to 1.19 or later), you may need to re-enter the WiFi access point details. See the Getting Connected page for how to do this.