Installing and Updating Firmware
- Notes before you start
- Usual procedure
- Fallback procedure #1
- Fallback procedure #2
- Fallback procedure #3
- Updating WiFi firmware or DuetWebControl files
- Updating more than one firmware at a time
- Upgrading a Duet 2 Wifi to firmware 1.19 or later from 1.18.2 or earlier
- Upgrading a Duet 2 WiFi or Ethernet to firmware 1.21 or later from 1.20 or earlier
- How to recover if the main firmware and WiFi firmware versions get out of step on your Duet 2 WiFi
- Some updates to the main firmware may require an update to the a compatible WiFi server firmware version as well, and vice versa.
- See the updating WiFi firmware or DuetWebControl files section below which explains how on 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 you have downloaded the correct firmware before installing it. The DuetWiFiFirmware.bin file should be the same size as shown on the github (currently about 300 KB in size).
- Make sure you download and save the file as bin or zip and check the files sizes match.
- Ensure you read the "Whats New" notices for the new version of the firmware as it will contain information on changes that effect your configuration.
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.
- 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.
- 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.
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:
- 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.
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.
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.
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 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
- Verify that the downloaded firmware file has the correct size, as shown on the page you downloaded it from.
- Download and install SAM-BA version 2.17 from here http://www.microchip.com/DevelopmentTool...
- Connect the Duet 2 to your PC via USB. Erase the firmware on the Duet 2 by either:
- Pressing the Erase button for pcb revisions 1.03 or earlier
- Jumpering the erase jumper for pcb revisions 1.04 and later.
- then the Reset button.
- Load SAM-BA. It usually detects the correct COM port automatically. Select board at91sam4e8-ek. Press Connect.
- In the Send File Name box enter or browse to the DuetWiFiFirmware.bin file to be loaded, 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.
- You should now be able to connect via USB/Pronterface.
If you are unable to run SAM-BA (for example because you want to update the firmware from a Mac), you can alternatively use Bossa 1.8 (not an earlier version) from https://github.com/shumatech/BOSSA/relea.... The interactive version (Bossa) does not work on high dpi screens, but you can still use the command line version (bossac). If you use the interactive version, you must check boxes Erase all, Lock, and Boot from Flash before pressing Write. If you use the command line version, try this command line:
bossac --port=COMxx -b -U -e -w -v path\DuetWiFiFirmware.bin -R
Replace COMxx in the above by the COM port number (e.g. COM3) and replace path\DuetWiFiFirmware.bin to the path and name of the firmware file to install.
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 2 Ethernet.
- 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.
- 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.
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.
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.
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.
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.
- 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.
You will need to do a simultaneous installation of DuetWiFiFirmware-1.18.2.bin and DuetWiFiServer-1.03ch.bin. You should not need to re-install DuetWebControl.bin because it should still be resident on the WiFi module. You do not need to roll back the Windows USB driver, because the newer driver versions are compatible with older firmware versions too.
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.
If you install incompatible main firmware (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.
- 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.
- Copy the versions of DuetWiFiFirmware.bin and DuetWiFiServer.bin you want to use 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.
- Safely remove or eject the SD card and put it back in the Duet.
- 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.
- 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. After about half a minute, the Duet port should re-appear in Device manager and 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.
- 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.