Skip to main content

Site Navigation

Your Account

Choose Language


Revision to Installing and Updating Firmware


[title|Installing and Updating Firmware]
Note: 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 [[Installing and Updating Firmware#Section_Updating_WiFi_firmware_or_DuetWebControl_files|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) then please read the [[Installing and Updating Firmware#Section_Updating_more_than_one_firmware_at_a_time|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.
Endure you read the "[|Whats New]" notices for the new version of the firmware as it will contain information on changes that efferct your configuration.
== Usual procedure ==
CAUTION: Upgrading a Duet WiFi from 1.18.2 or earlier firmware to 1.19 or later firmware required a special procedure. See Ugrading to 1.19 lower down this page.
* Connect DuetWebControl.
* Go to the Settings page.
* On the General tab, press Upload File(s) and browse to the new '''DuetWiFiFirmware.bin''' file. It may be called something like DuetWiFiFirmware-xxx.bin which is ok because it will be renamed automatically.
* After uploading, DuetWebControl 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.
== Fallback procedure #1 ==
If WiFi is not working, but you can connect to the board via USB/Pronterface:
* Take the on-board SD card out and put it in a computer,
* Copy the new '''DuetWiFiFirmware.bin''' file to the '''/sys''' folder. It must be called exactly '''DuetWiFiFirmware.bin''' on the SD card. Also make sure that file '''iap4e.bin''' is present in '''/sys'''.
* Replace the on-board SD card in the DuetWiFi
* Restart the DuetWiFi and connect with Pronterface
* 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.
== 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 WiFi
* Start the Duet WiFi 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 WiFi 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.
You will need a Windows or Linux PC.
* Download the main firmware file (DuetWiFiFirmware.bin for the Duet WiFi, DuetEthernetFirmware.bin for the Duet Ethernet) from
* 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
* Connect the Duet WiFi to your PC via USB. Press the '''Erase''' button on the Duet WiFi, 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 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:
[code]bossac --port=COMxx -b -U -e -w -v path\DuetWiFiFirmware.bin -R[/code]
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.
== Updating WiFi firmware or DuetWebControl files ==
'''Important:''' if you are also upgrading RepRapFirmware (which for the Duet WiFi is the DuetWiFiFirmware.bin file) you should normally upgrade that first.
'''Note''', this does not apply to the Duet Ethernet.
=== 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 WiFi is running main firmware 1.19 or later: ====
* Upload the new '''''' 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 into it. Do not unzip the individual .gz files, leave them as they are on the SD card.
==== If your Duet WiFi is running firmware 1.18 or earlier: ====
* 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 WebControl, do them in this order:
# DuetWiFiFirmware or DuetEthernetFirmware
# DuetWiFiServer ''(Duet WiFi only)''
# DuetWebControl
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.
== Upgrading to DuetWiFiFirmware 1.19 ==
In firmware version 1.19 for the Duet 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 WiFi by putting the following files on the SD card:
* The contents of, extracted into the '''/www''' folder. Existing versions of DWC won't let you upload a file called DuetWebControl*.zip to a Duet WiFi, so you will either have to do this on a PC, or you can rename it to e.g. 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.
=== Reverting to 1.18.2 or earlier ===
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.
== How to recover if the main firmware and WiFi firmware versions get out of step on your Duet WiFi ==
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.
=== Connect via USB ===
* 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 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 [guide|2|what to do if your Duet or Duet 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. 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.
=== 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.