• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

[3.6.0-beta.4] DWC Connection

Scheduled Pinned Locked Moved Solved
Beta Firmware
4
29
1.2k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    gloomyandy @Leonard03
    last edited by 8 Mar 2025, 19:02

    @Leonard03 Have you tried increasing the number of retries in the DWC settings? That can sometimes help.

    undefined 1 Reply Last reply 8 Mar 2025, 22:22 Reply Quote 0
    • undefined
      Leonard03 @gloomyandy
      last edited by 8 Mar 2025, 22:22

      @gloomyandy Thank you for your suggestion. Tried to increase ajax retries from 3 to 20 but sadly with the same effect...

      undefined 1 Reply Last reply 8 Mar 2025, 22:33 Reply Quote 0
      • undefined
        gloomyandy @Leonard03
        last edited by 8 Mar 2025, 22:33

        @Leonard03 I think there have been some issues with systems that have a PanelDue, it might be worth disconnecting it just to see if that makes any difference or perhaps try putting it on the settings page as I think that stops it from talking to the board?

        undefined 1 Reply Last reply 9 Mar 2025, 13:40 Reply Quote 0
        • undefined
          Leonard03 @gloomyandy
          last edited by 9 Mar 2025, 13:40

          @gloomyandy Tried now both options. PanelDue on its setup page and disabling the comm port from config.g. Same effect.. After homing, DWC starts to loop 😞

          undefined 1 Reply Last reply 9 Mar 2025, 18:17 Reply Quote 0
          • undefined
            dc42 administrators @Leonard03
            last edited by 9 Mar 2025, 18:17

            @Leonard03 have you tried 3.6.0-rc.1 ?

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

            undefined 1 Reply Last reply 9 Mar 2025, 18:21 Reply Quote 0
            • undefined
              Leonard03 @dc42
              last edited by 9 Mar 2025, 18:21

              @dc42 Yes, now I'm running 3.6.0-rc.1+1 and is no difference..

              1 Reply Last reply Reply Quote 0
              • undefined
                Leonard03
                last edited by 9 Mar 2025, 23:22

                Seems that I can provide additional information about this issue.
                My printer has an Prusa MMU which I can disable from config.g. I can disable all the multicolor stuff, reducing the load of the MCU.
                With MMU disabled, using only one tool, DWC keeps a stable connection during a job.
                With MMU enabled, even if the job has no tool changes, DWC starts looping when tool 0 is selected, mostly after bed trimming and an adaptive mesh calibration. I can't determine when, but I suspect during tpre0.g.
                This macro is "empty" if MMU is disabled.
                The strange thing is that if when printer is idle and select manually the T0, works as expected.

                undefined 1 Reply Last reply 10 Mar 2025, 13:36 Reply Quote 0
                • undefined
                  dc42 administrators @Leonard03
                  last edited by 10 Mar 2025, 13:36

                  @Leonard03 please provide your tool change files and any macro files that they call, also daemon.g if you are using it.

                  Duet WiFi hardware designer and firmware engineer
                  Please do not ask me for Duet support via PM or email, use the forum
                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                  undefined 1 Reply Last reply 10 Mar 2025, 15:02 Reply Quote 0
                  • undefined
                    Leonard03 @dc42
                    last edited by 10 Mar 2025, 15:02

                    @dc42 Those are the relevant macros for a tool change: TC macros.zip.g
                    During a filament normal load, tpre0.g ends at line 24 and tpost0.g ends at line 25

                    undefined undefined 2 Replies Last reply 10 Mar 2025, 15:05 Reply Quote 0
                    • undefined
                      gloomyandy @Leonard03
                      last edited by 10 Mar 2025, 15:05

                      @Leonard03 Are you using daemon.g?

                      undefined 1 Reply Last reply 10 Mar 2025, 15:37 Reply Quote 0
                      • undefined
                        Leonard03 @gloomyandy
                        last edited by 10 Mar 2025, 15:37

                        @gloomyandy yes, this is it:

                        if state.atxPower == true
                        G4 S2
                        if fans[1].actualValue == 1
                        G4 S4
                        if fans[1].rpm == 0 && heat.heaters[1].state != "off"
                        M108
                        M568 P0 A0
                        if state.status = "processing"
                        M25
                        if state.currentTool != -1
                        T-1
                        M98 P"0:/sys/MMU Control/errQueueUpdate.g" A"HOTEND_FAN_ERROR"
                        M291 P"Hotend fan not spinning. Check it for possible debris, then inspect the wiring." S1 T0

                        It should not affect anything about the job or tool changes

                        1 Reply Last reply Reply Quote 0
                        • undefined
                          dc42 administrators @Leonard03
                          last edited by 10 Mar 2025, 15:45

                          @Leonard03 your tpre0.g file and the macro files that it calls contain several "while" loops. To avoid using up lots of CPU time going round these loops over and over again, each loop should satisfy at least one of the following conditions:

                          • Each iteration either executes at least one M291 command that waits for input from the user, or executes a G4 delay command with a reasonable amount of delay, e.g. one second
                          • The maximum number of iterations executed is bounded and small

                          Some of your loops don't appear to obey this, e.g.

                          • The loop in tpre0.g from line 16 to the end of the file appears to execute indefinitely under some conditions, e.g. if at line 27 global.statusFinda = 1 && global.statusBondtech = 1 and at line 30 global.errQueue[#global.errQueue-1] != "FILAMENT_ALREADY_LOADED", or if at line 105 global.statusFinda = 1 && global.statusBondtech = 0 and at line 108 global.errQueue[#global.errQueue-1]! = "UNLOAD_MANUALLY"
                          • in file errQueueUpdate.g you have various loops that iterate through the elements of global.errQueue. Is the number of elements always guaranteed to be small, or might it grow very large?

                          I didn't find file errorAction.g in your zip file.

                          My guess is that one of these while-loops is executing repeatedly (perhaps while waiting for something to happen?) without a delay or a wait-for-input M291 command in each iteration, and that is causing the network task to be starved of CPU time. You may find it helpful to add an echo command at the end of any suspect loop bodies to help you detect unexpected repeat iterations.

                          Duet WiFi hardware designer and firmware engineer
                          Please do not ask me for Duet support via PM or email, use the forum
                          http://www.escher3d.com, https://miscsolutions.wordpress.com

                          undefined 1 Reply Last reply 10 Mar 2025, 16:35 Reply Quote 0
                          • undefined
                            Leonard03 @dc42
                            last edited by Leonard03 3 Oct 2025, 18:27 10 Mar 2025, 16:35

                            @dc42 First, thank you very much for looking at my config.
                            Most of the time, that while true loops are never completed, so only one iteration is done if the filament is loaded without any problems or errors.
                            The reason for this is that tool change macros are hard to abort so those loops keep the user in one particular macro until a problem is resolved and carry on from that point.

                            @dc42 said in [3.6.0-beta.4] DWC Connection:

                            in file errQueueUpdate.g you have various loops that iterate through the elements of global.errQueue. Is the number of elements always guaranteed to be small, or might it grow very large?

                            I agree. Theoretically this array can grow very large. In practice, it never had more than let's say 10 elements. If a problem persists, I cand pause the job and resuming it will clear it.

                            @dc42 said in [3.6.0-beta.4] DWC Connection:

                            I didn't find file errorAction.g in your zip file.

                            I don't include errorAction.g because during normal operation it is not used, but here it is just in case: errorAction.g

                            Since this particular issue started from beta.4, I will try to find an earlier version of RRF to try my actual configuration without any modifications and report back

                            3.6.0-beta.3+3 (2025-02-03 10:56:36) works flawlessly
                            3.6.0-beta.3+4 (2025-02-10 09:34:09) don't 😑 I might missed this

                            1 Reply Last reply Reply Quote 0
                            • undefined
                              Leonard03
                              last edited by Leonard03 15 Mar 2025, 21:11

                              Guys.. found the macro that cause the disconnects..
                              Has nothing to do with the tool change macros, but with the mesh leveling macro.

                              Found the problem, but I don't understand what is wrong with it. bed.g and mesh.g are unchanged for a while and they worked very well..

                              This is bed.g and this complete without problems

                              ; bed.g
                              ; called to perform automatic bed calibration via G32
                              M106 S0
                              if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
                              G28
                              G30 P0 X5 Y6 Z-99999
                              G30 P1 X287 Y6 Z-99999
                              G30 P2 X287 Y278 Z-99999
                              G30 P3 X5 Y278 Z-99999 S2
                              G1 X{(310/2)-sensors.probes[0].offsets[0]} Y{(310/2)-sensors.probes[0].offsets[1]} F6000
                              G30

                              And this is mesh.g that causes DWC to start looping:

                              ; mesh.g
                              ; called to perform automatic bed compensation via G29
                              var rmsMin = -0.08
                              var rmsMax = 0.08
                              var meanMin = -0.08
                              var meanMax = 0.08
                              var isOK = true
                              M116 H0 S0.2 ; wait for bed temperature with a tolerance of 0.2 degC
                              M106 P0 S0 ; turn fans off if active
                              M80 ; override ATX thermostatic shutdown
                              M561 ; clear any bed transform
                              M290 S0 R0 ; reset babystepping
                              G32
                              G29 S0 ; Probe the bed
                              if move.compensation.meshDeviation.mean > var.meanMax && move.compensation.meshDeviation.deviation > var.rmsMax
                              set var.isOK = false
                              M291 P"Mean & RMS deviations too high" R"Mesh warning!" S1 T0
                              elif move.compensation.meshDeviation.mean < var.meanMin && move.compensation.meshDeviation.deviation < var.rmsMin
                              set var.isOK = false
                              M291 P"Mean & RMS deviations too low" R"Mesh warning" S1 T0
                              elif move.compensation.meshDeviation.mean > var.meanMax && move.compensation.meshDeviation.deviation < var.rmsMin
                              set var.isOK = false
                              M291 P"Mean deviation too high & RMS deviation too low" R"Mesh warning" S1 T0
                              elif move.compensation.meshDeviation.mean < var.meanMin && move.compensation.meshDeviation.deviation > var.rmsMax
                              set var.isOK = false
                              M291 P"Mean deviation too low & RMS deviation too high" R"Mesh warning" S1 T0
                              elif move.compensation.meshDeviation.deviation > var.rmsMax
                              set var.isOK = false
                              M291 P"RMS deviation too high" R"Mesh warning" S1 T0
                              elif move.compensation.meshDeviation.deviation < var.rmsMin
                              set var.isOK = false
                              M291 P"RMS deviation too low" R"Mesh warning" S1 T0
                              elif move.compensation.meshDeviation.mean > var.meanMax
                              set var.isOK = false
                              M291 P"Mean deviation too high" R"Mesh warning" S1 T0
                              elif move.compensation.meshDeviation.mean < var.meanMin
                              set var.isOK = false
                              M291 P"Mean deviation too low" R"Mesh warning" S1 T0
                              else
                              set var.isOK = true
                              M291 P"Auto calibration successful!" R"Mesh complete" S0 T4
                              G0 X0 Y0 F4800
                              if var.isOK = true
                              M300 S2000 P500
                              G4 P500
                              M300 S1700 P500
                              else
                              M300 S300 P1000

                              G29 S0 works ok
                              What's wrong with the mesh macro? I'm lost 🤤

                              undefined 1 Reply Last reply 16 Mar 2025, 07:07 Reply Quote 0
                              • undefined
                                dc42 administrators @Leonard03
                                last edited by dc42 16 Mar 2025, 07:07

                                @Leonard03 you could add a M99 command part way through mesh.g to quit the macro at that point, then see whether DWC still disconnects. Move the M99 command around until you have found the line that causes the disconnect.

                                Does mesh probing complete before DWC disconnects? I have a feeling that the M300 commands near the end might be triggering the problem.

                                You have a M80 command near the start. If this is because you sometimes have only 5V power applied when you start the macro then you may need to add a delay command after it, to allow the stepper drivers to be initialised after VIN power is applied but before any movement commands.

                                Duet WiFi hardware designer and firmware engineer
                                Please do not ask me for Duet support via PM or email, use the forum
                                http://www.escher3d.com, https://miscsolutions.wordpress.com

                                undefined 1 Reply Last reply 16 Mar 2025, 11:12 Reply Quote 0
                                • undefined
                                  Leonard03 @dc42
                                  last edited by 16 Mar 2025, 11:12

                                  @dc42

                                  @dc42 said in [3.6.0-beta.4] DWC Connection:

                                  you could add a M99 command part way through mesh.g to quit the macro at that point, then see whether DWC still disconnects. Move the M99 command around until you have found the line that causes the disconnect.

                                  Adding the M99 between G32 and G29 S0 (at line 20) works. After that, DWC starts looping.

                                  @dc42 said in [3.6.0-beta.4] DWC Connection:

                                  Does mesh probing complete before DWC disconnects? I have a feeling that the M300 commands near the end might be triggering the problem.

                                  Yes, the mesh always completes and the disconnects seems to occur at the end of the macro, but again, G29 S0 sent alone from the console works with no problems

                                  @dc42 said in [3.6.0-beta.4] DWC Connection:

                                  You have a M80 command near the start. If this is because you sometimes have only 5V power applied when you start the macro then you may need to add a delay command after it, to allow the stepper drivers to be initialised after VIN power is applied but before any movement commands.

                                  That M80 I use mainly to override the M81 S1, but I agree, I will change it to make it safer 🙂

                                  undefined 1 Reply Last reply 16 Mar 2025, 11:23 Reply Quote 0
                                  • undefined
                                    dc42 administrators @Leonard03
                                    last edited by 16 Mar 2025, 11:23

                                    @Leonard03 I suggest you open mesh.g in the DWC editor, then delete the G29 S0 line and re-type it. There could be a non-printing character in that line that line that causes it to malfunction, for example if the S0 is not being recognised then it will call mesh.g recursively.

                                    What type of Z probe are you using?

                                    Duet WiFi hardware designer and firmware engineer
                                    Please do not ask me for Duet support via PM or email, use the forum
                                    http://www.escher3d.com, https://miscsolutions.wordpress.com

                                    undefined 1 Reply Last reply 16 Mar 2025, 11:33 Reply Quote 0
                                    • undefined
                                      Leonard03 @dc42
                                      last edited by Leonard03 16 Mar 2025, 11:33

                                      @dc42 Tried now. Verified in DWC editor and Notepad++ there were not strange characters, but redo it anyways, but with no success..
                                      Tried commenting out all the if else statements, no luck,
                                      Tried commenting out beeps at the end, no luck,
                                      Tried to add a M400 in combination with G4 S3 between G32 and G29 S0 first, and after the mesh after. no luck either

                                      @dc42 said in [3.6.0-beta.4] DWC Connection:

                                      What type of Z probe are you using?

                                      I have a BL Touch
                                      This is its configurtion, if this helps:

                                      ; Z-Probe
                                      M950 S0 C"!exp.heater7" ; create servo pin 0 for BLTouch
                                      M558 P9 C"^zprobe.in" H4:2 F240:120 T9000 A20 S0.01 ; set Z probe type to bltouch and the dive height + speeds S0.005
                                      G31 P500 X-27.4 Y-28.6 Z2.00 ; set Z probe trigger value, offset and trigger height
                                      M557 X8.0:285.0 Y21.6:279.4 P10 ; define mesh grid

                                      This problem occurs only with the MMU or multiple tools/axis enabled
                                      With only one tool defined and no U,V,W axis defined, there are no issues with the connection. All works fine 😐

                                      1 Reply Last reply Reply Quote 0
                                      • undefined
                                        Leonard03
                                        last edited by Leonard03 16 Mar 2025, 21:41

                                        Found something in Chrome console, if helps in any way..
                                        b892ed45-e887-4d3b-9c5b-a8a39d186343-image.png

                                        My settings are this:
                                        Number of maximum AJAX retries: 3
                                        Time to wait between AJAX retries (ms): 250
                                        Update interval (ms): 250
                                        Retry threshold for file transfers (KiB): 350

                                        undefined 1 Reply Last reply 16 Mar 2025, 22:29 Reply Quote 0
                                        • undefined
                                          dc42 administrators @Leonard03
                                          last edited by 16 Mar 2025, 22:29

                                          @Leonard03 I'll ask @chrishamm to look at this.

                                          Duet WiFi hardware designer and firmware engineer
                                          Please do not ask me for Duet support via PM or email, use the forum
                                          http://www.escher3d.com, https://miscsolutions.wordpress.com

                                          undefined 1 Reply Last reply 16 Mar 2025, 22:52 Reply Quote 0
                                          16 out of 29
                                          • First post
                                            16/29
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA