Duet WiFi/Eth – Recover from Erase + basic setupBy BeTrue3D
I accidentially hit the Erase button on the edge of my Duet WiFi card, which means it wiped my firmware from the controller! Luckily it didn’t wipe my SD card, so my config files didn’t go missing on me.
I still need to setup my controller again though, and while I previously did write a blog-post on doing that, it was a long time ago and a lot has happened since then on how things are done, so I decided to do a new writeup on it.
Also, since it wiped the firmware from the controller, I am now unable to connect to it the regular way, which we need to solve.
- Download firmware and drivers
- Download relevant programs
- Write new firmware using SAM-BA
- Getting SD-Card Ready
- Install WiFiserver and activate WiFi
- SD Card Folder Structure
1) Download firmware and drivers
- In order for your computer to communicate with the controller using USB, we need to get the drivers from DC42s Github driver folder.We also need to download the newest firmware and it’s a good idea to download the SD-Image folder to give us a new set of files for our now defunct printer.All in all, it is easiest to just click the Clone or download on the main RepRapFirmware Github page and select Download Zip, which you extract somewhere easy to find and use.
- In the directories you just unzipped go into RepRapFirmware-dev/Driver folder and right-click on duet.inf and select install to install the drivers.
- Browse down through RepRapFirmware-dev/Release/Duet-WiFi/Stable and rename the files:
- DuetWiFiFirmware-1.19.bin to DuetWiFiFirmware.bin
- DuetWiFiServer-1.19.bin to DuetWiFiServer.bin
2) Download relevant programs
In the Getting connected to the Duet WiFi they suggest using a dedicated terminal program to setup the controller/firmware, but I really much prefer using
Pronterface/Printrun. You should use YAT, as it doesn’t convert all characters to CAPs as Pronterface/Printrun does.
I vastly prefer it over any form of terminal function in all slizers as the slizers comes with some configured settings which can screw up the result you get when moving and axis or sending a command to check a function.
So, go to the download page for Pronterface/Printrun 3D Printing Host Suite and select the version fitting for your type of computer.
To use Pronterface/Printrun you just need to extract/unzip the file and run the pronterface.exe file
SD Formatter 4
Note: The program is named SD Formatter 4, but they have a version 5, which is a bit strange.
Some of you are going to wonder about why we need a dedicated program to format the SD card, and the answer is quiet simple: To avoid/minimize the risk of the SD card turning bad, either turning completely unuseable untill reformatted, or just performs really bad, with slow speeds.
The program simply just does a much better job of preparing SD cards correctly and it can even fix many annoying problems many people experience now and then on their printers.
Go to the SD Formatter (4/5) Download page, scroll down and download and install the version for your system.
Since I hit the erase button on the Duet WiFi I can no longer talk to it using Pronterface, as we first need to burn the firmware onto the controller using SAM-BA 2.17. I don’t know why it has to be 2.17, but the specific version is listed on the Fallback description on the Duet wiki. Install it after downloading and leave it open.
3) Write new firmware using SAM-BA
Note: This step is only necessary if you cannot connect to your controller after having hit Erase
- 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.
- To verify the writeprocess 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.
Try sending the M115 command to check firmware version
Source for this section was found on the Duet Wiki.
4) Getting SD-card ready
- Format your SD card using SD-formatter – remember to copy out any config-files you might want to save.
- Now navigate to the folder RepRapFirmware-dev\SD-image you downloaded in Step 1.
- My printer is a CoreXY, so I’ll rename the sys-CoreXY folder on the SD-card to plain sys
Put firmware files on the SD-card
- Copy over the 3 .bin files from RepRapFirmware-dev/Release/Duet-WiFi/Stable we renamed in Step 1.2 and put them into the newly named sys folder
Make ready for Duet Web Interface
- Turns out the www folder is rather deprecated and didn’t work at all, at my place, so delete the www folder on the SD-Card
- Now go to RepRapFirmware-dev\Release\Duet-WiFi\Stable and unzip the DuetWebControl-1.19.zip file
- Rename ths folder to www and copy it onto your SD-Card
Macrofile for networksetup
- We need to create a small macrofile to make it connect to our WiFi.
I tried doing this manually without the Macro, but I simply just could not get it to connect..
- So, go to your Macros folder on your SD card and create a new file named SetNetwork containing the following commands:
M587 S"your-network-ssid" P"your-network-password"
- Now eject the card from your computer and insert it into your Duet WiFi and connect it to your computer using the USB cable
Install WiFiserver and activate WiFi
Now it’s time to install the DuetWiFiServer onto our board to enable the usage of WiFi
- Connect to the DuetWiFi using Pronterface and issue the command M997 S0:1 which is going to install/update both firmwares.
Note: I know we allready have the newest DuetWiFiFirmware on it, but easier to remember just one command.
- Wait for it to finish and disconnect as it’s restarting.
- Disconnect and Connect again using Pronterface and type M552 S0 to start the WiFi module
WiFi module started
- Type in M98 P/macros/SetNetwork to execute the macro we created
>>> M98 P/macros/SetNetwork
WiFi module started
- 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 and display the IP it has recieved.
- Connect via the web interface
- Enable the M552 S1 command in config.g – if it’s not in there, then just make a new line and type it in.
- For security, delete the SetNetwork macro file
SD Card Folder Structure
It’s usefull to know how the structure is supposed to be on the SD-card and also to know the function of each of the files and more info.
All this is shown on the SD Card folder structure wiki page