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

    [3.6.0-beta3] Macro race condition?

    Scheduled Pinned Locked Moved Solved
    Beta Firmware
    3
    11
    341
    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.
    • stuartofmtundefined
      stuartofmt
      last edited by

      I encountered an issue with M291 where the K array seem to sometimes carry over to a subsequent call.

      I'm using 3.6.0-beta.3 on Rpi Bookworm with a Mini5+
      I do not recall seeing this issue on previous versions.

      Below is a skeletal macro that exhibits the problem.
      To reproduce:
      Run the macro and when the first popup appears QUICKLY (I'm not sure how important that is) - select one of the options.
      Sometimes (may take 3 or 5 attempts) the next popup appears as below:
      4af92a37-0a19-474b-86d6-aea9d50f2009-image.png

      Placing a delay G4 P250 (line 25) between the M291 calls seems to resolve the issue.

      Test Macro

      var P_X_points = 0
      var P_Y_points = 0
      var set_temp = false
      
      M291 R"How Many Probe points" P"Select a number" K{"9","16","64","100","Cancel"} S4
      if input == 0
          set var.P_X_points = 3
          set var.P_Y_points = 3
      
      elif input == 1
          set var.P_X_points = 4
          set var.P_Y_points = 4
      
      elif input == 2
          set var.P_X_points = 8
          set var.P_Y_points = 8
      
      elif input == 3
          set var.P_X_points = 10
          set var.P_Y_points = 10
      else
          abort "Selection cancelled"
      ;
      ;  Delay to stop issue - comment out to reproduce
      ;G4 P250
      ;
      M291 R"Hot or Cold Calibration" P"Turn on Heaters" K{"YES","NO","Cancel"} S4
      if input == 0
          set var.set_temp = true
      
      elif input == 1
          set var.set_temp = false
      
      else
          abort "Selection cancelled"
      
      T3P3Tonyundefined chrishammundefined 2 Replies Last reply Reply Quote 0
      • stuartofmtundefined stuartofmt marked this topic as a question
      • T3P3Tonyundefined
        T3P3Tony administrators @stuartofmt
        last edited by

        @stuartofmt would it be possible for you to test this on standalone mode easily or is it a lot of faff to change things to do that?

        www.duet3d.com

        stuartofmtundefined 1 Reply Last reply Reply Quote 0
        • stuartofmtundefined
          stuartofmt @T3P3Tony
          last edited by

          @T3P3Tony said in [3.6.0-beta3] Macro race condition?:

          @stuartofmt would it be possible for you to test this on standalone mode easily or is it a lot of faff to change things to do that?

          Hmm - I'm not sure what would be involved. Move the SD card from Pi to Mini then just power up the mini? Or is there plugging and unplugging etc.?

          T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
          • T3P3Tonyundefined
            T3P3Tony administrators @stuartofmt
            last edited by

            @stuartofmt you would need to make the "SD card" directories in the FAT/boot partition of the SD card (or update the files if the directories are already there). Basically what is in /opt/dsf/sd needs to be copied into the boot partition. Also assign an IP address in that config.g or set to DHCP as appropriate. Alternatively start with a fresh SD card and put copies of the directories there.

            With an SD card in the Duet is should boot into Standalone mode.

            www.duet3d.com

            stuartofmtundefined 1 Reply Last reply Reply Quote 0
            • stuartofmtundefined
              stuartofmt @T3P3Tony
              last edited by

              @T3P3Tony
              Got it - will try to get it done over the weekend.
              I'll just create a new SD card likely the quickest.

              stuartofmtundefined 1 Reply Last reply Reply Quote 1
              • stuartofmtundefined
                stuartofmt @stuartofmt
                last edited by stuartofmt

                @T3P3Tony
                Well, that was fun ... I've moved countries and eventually found the external antenna in a box of bits. It was only then that I realized the Mini5+ is ethernet and said antenna was for something else. The house is wifi only. Getting the printer, safely, to the router in the loft (for an ethernet connection), is a faff too far 😞

                chrishammundefined T3P3Tonyundefined 2 Replies Last reply Reply Quote 0
                • chrishammundefined
                  chrishamm administrators @stuartofmt
                  last edited by

                  @stuartofmt Thanks for reporting this, I could reproduce it. I'm going to fix this before we release 3.6.0-beta.4.

                  Duet software engineer

                  1 Reply Last reply Reply Quote 0
                  • chrishammundefined
                    chrishamm administrators @stuartofmt
                    last edited by chrishamm

                    @stuartofmt I've got a fix ready for the upcoming v3.6.0-beta.4. In SBC mode, sometimes DWC wasn't informed about updates of state.messageBox.choices. That could only happen when state.messageBox wasn't changed to null before another message box with choices was opened. I guess if you add a delay of 250ms or more between the M291 calls, the problem doesn't show up.

                    Duet software engineer

                    1 Reply Last reply Reply Quote 0
                    • T3P3Tonyundefined
                      T3P3Tony administrators @stuartofmt
                      last edited by

                      @stuartofmt sorry for the huge faff. I am glad Christian managed to id the issue.

                      www.duet3d.com

                      stuartofmtundefined 1 Reply Last reply Reply Quote 0
                      • stuartofmtundefined
                        stuartofmt @T3P3Tony
                        last edited by stuartofmt

                        @T3P3Tony
                        No need to be sorry - I had to figure out what else was in the boxes anyway 🙂

                        And thank you Christian. I though I was seeing things at first 🙂

                        stuartofmtundefined 1 Reply Last reply Reply Quote 1
                        • stuartofmtundefined stuartofmt has marked this topic as solved
                        • stuartofmtundefined
                          stuartofmt @stuartofmt
                          last edited by

                          @chrishamm @T3P3Tony
                          I just tested with 3.6.0-beta.4. I can no longer trigger the behavior.

                          Looks good!

                          1 Reply Last reply Reply Quote 2
                          • First post
                            Last post
                          Unless otherwise noted, all forum content is licensed under CC-BY-SA