Posted on

Duet WiFi/Eth – Recover from Erase + basic setup

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.

Contents

  1. Download firmware and drivers
    1. Install drivers
    2. Rename firmware files
  2. Download relevant programs
    1. Pronterface/Printrun
    2. SDFormatter
    3. SAM-BA v2.17
  3. Write new firmware using SAM-BA
  4. Getting SD-Card Ready
    1. Format SD-card
    2. Copy over SD-Image files
      1. Rename printerfolder
    3. Put firmware files on the SD-card
    4. Make ready for Duet Web Interface
    5. Macrofile for networksetup
  5. Install WiFiserver and activate WiFi
  6. 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

  • Pronterface/Printrun

    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, as it also has pure terminal function and in my world is essential to configuring and checking any 3D Printer.

    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.

  • SAM-BA 2.17

    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.
    • Copy the entire content to your SD-Card
  • 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:
    M552 S0
    G4 P1000
    M587 S"your-network-ssid" P"your-network-password"


    Source info
  • 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
    M552 S0
    SENDING:M552 S0
    WiFi module started
  • Type in M98 P/macros/SetNetwork to execute the macro we created
    >>> M98 P/macros/SetNetwork
    SENDING: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

Posted on

PanelDue – Update firmware

In this post I’ll go through updating firmware on the PanelDue.

It’s really not that difficult, but as always, it can be a bit of a chore figuring out the location of and type of files we need to use.

What we need/in this post

You can check your current version by clicking Setup on your display. Mine was version 1.14 – This is in itself not important for this post, but just nice to know.

Know your PanelDue version

In order to figure out the version of PanelDue we own, we need to look at the back side of the PanelDue PCB.

Mine is V2 as can be seen here.

Get the latest correct firmware

Now we know the hardware version of our PanelDue, so lets go get the newest firmware for it from the PanelDueFirmware page

My screen is 4.3″ inches, so combine that with the version 2 and I need to get the file PanelDue-v2-4.3.bin

Program to update firmware

In order to update our firmware, we need to get a program called “Bossa”.

Go to their Github page and download the file fitting for your system and install it.

Erase and Reset PanelDue

Next step is to Erase and Reset the device to make ready for new firmware.
Some of these steps are taken from the official page.

  • Press and hold the Erase button of the PanelDue for at least one second.
  • Release the Erase button, then press and release the Reset button.
    • If you have a version 2.0 board then the backlight will turn off.

  • Identify the COM port number or port name of the PanelDue board on your PC.
    If you use Windows, you can do this by pressing CTRL+Pause/Break or via Start->Control Panel->System->Device Manager.

    • Then expand Ports (COM and LPT), and look for Bossa port.
    • If you can’t find the port, try repeating the Erase and Reset sequence, or disconnecting and reconnecting the USB cable, or try a different USB port on your computer.

Write new firmware to PanelDue

We are going to use the program Bossa we downloaded and installed previously, but you can also use the command prompt.

I’ll list the command for the commandline option, but I have not tested it.

Command Prompt

Under Windows, open a command prompt and use this command:

Taken from the official page.

bossac.exe --port=COM4 -e -w -v -b PanelDueFirmware.bin

Options:

  • -e, –erase erase the entire flash
  • -w, –write write FILE to the flash; accelerated when
    combined with erase option
  • -v, –verify verify FILE matches flash contents
  • -b, –boot[=BOOL] boot from ROM if BOOL is 0;
    boot from FLASH if BOOL is 1 [default];
    option is ignored on unsupported devices

Using GUI

Run Bossa as Administrator and select the Serial Port we verified above.

  • You must put a mark in Erase all, Boot to flash and Lock.
  • Hit Write and wait for it to finish and click OK.
  • Click the Verify button.

PanelDue up and running

Now hit the Reset button on the PanelDue PCB and display should come back online.

Remember to adjust baud to match your settings in your controllers firmware.

Sources

For full read on the Panel Due https://miscsolutions.wordpress.com/paneldue/
Bossa product page: http://www.shumatech.com/web/products/bossa

Posted on

Duet WiFi – Adding a second extruder

As some might know, I’ve been working on a version 4 of my Belted Extruder and am now ready to put it to use on my primary printer, which has been using a single extruder so far.

Drives section

In the Drives section of our config.g file we need to add 7 changes:

Changes in Drives section described:

  1. Add the drive – Using M569
    We allready have X,Y,Z,E0 which are labeled 0-3 so our new drive is nr. 4.
    My V4 Belted Extruder Design is running in reverse, so we set it to S1
    M569 P4 S1 ; Drive 4 in reverse - E1
  2. Microstepping used – Using M350
    I’m using 1/32 microstepping for both extruders, so just adding :32 to the existing line.
    M350 E32:32 ; Extruder0 microstep
  3. Steps/mm for our new extruder. Using M92
    I have not yet calibrated it, so inputting 2050 to go from, after steps defined for our first extruder.
    M92 E2057:2050 ; Steps/mm for Extruders
  4. Speed change – Using M566
    M566 X1800 Y1800 Z12 E120:120 ; Set maximum instantaneous speed changes (mm/min)
  5. Maximum speed – Using M203
    M203 X18000 Y18000 Z2500 E1200:1200 ; Set maximum speeds (mm/min)
  6. Accelleration – Using M201
    M201 X500 Y500 Z250 E250:250 ; Set accelerations (mm/s^2)
  7. Current – Using M906
    M906 X800 Y800 E700:700 Z1200 I0 ; Set motor currents (mA) and motor idle factor in per cent

Tools section

For now, I only have 1 hotend on this printer, but 2 extruders. I’m using a normal E3Dv6 1.75mm bowden, so I’ll just swap over the bowden tube to the extruder I’m going to be using.

It all means I’m not adding any new heaters for now.

To setup our new Tool, we need to add 3 lines to our config.g file:

  1. Add new tool by defining it. Using M563
    P is the Tool Number, D is Extruder drive, which is not to be confused with machine Drive number we defined above. H is the Heater we use with our new tool.
    ; Pnnn Tool number
    ; Dnnn Extruder drive(s)
    ; Hnnn Heater(s)
    M563 P1 D1 H1; Define tool 1
  2. Tool offset – Using G10
    G10 P1 X0 Y0 Z0 ; Set tool 1 axis offsets
  3. Initial active tool – Using G10
    G10 P1 R0 S0 ; Set initial tool 0 active and standby temperatures to 0C

Note: You can combine the #2-3 G10 commands if you like.

That’s it.

You can now go and see the extra Tool in your Settings – Tools section. Yes, you can add Tools in here, but I rather like doing it the other way, to make sure I have everything how I like it 🙂

Just need to add an extra Extruder to your favorite Slizer 🙂