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

    Filament load macro writing to file in /sys

    Scheduled Pinned Locked Moved
    General Discussion
    2
    6
    924
    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.
    • wilrikerundefined
      wilriker
      last edited by

      Re: Problem with M28 and M29

      Basically I have the same problem that is described in the linked issue. I am running 2.0RTOS build.

      I set

      M28 /sys/current_material.g
      M98 P/macros/Settings/PETG
      M29
      

      as load.g of one of my defined filaments (unload.g is empty) and expect that when I load this filament that it will write the middle line to the file defined by the M28 command.

      This works sometimes (it seems rather random) but most of the time it either freezes because it wants to write all following GCODE to this file and I can sometimes break out of this by manually sending either M29 or M999 but it is not reliable which one of these two in what order will finally stop writing to the file.
      Sometimes it actually evaluates the M98 command instead of writing it into the file.

      I have a feeling that these commands are not run in the correct order.

      Manuel
      Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
      with probably always latest firmware/DWC (incl. betas or self-compiled)
      My Tool Collection

      dc42undefined 1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @wilriker
        last edited by

        I have added this to my list of issues to investigate.

        Is there any chance that two M28/M29 command pairs are being executed concurrently from different input sources? I can see that the M28/M29 code was written originally to support only one file upload at a time, and it hasn't been updated to support multiple concurrent uploads.

        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

        wilrikerundefined 1 Reply Last reply Reply Quote 0
        • wilrikerundefined
          wilriker @dc42
          last edited by

          @dc42 said in Filament load macro writing to file in /sys:

          Is there any chance that two M28/M29 command pairs are being executed concurrently from different input sources?

          I don't think so. When I run M999 so the board is freshly booted and then load/change filament the problem will also happen. At least I definitely have no active upload at that time. I don't know what DWC might be doing in the background.

          Manuel
          Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
          with probably always latest firmware/DWC (incl. betas or self-compiled)
          My Tool Collection

          1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators
            last edited by

            I have just been looking into this. I created a macro containing this:

            M28 /sys/current_material.g
            M98 P/sys/homedelta.g
            M29
            ; a comment
            M906

            When I run the macro, it does the same thing every time. Instead of writing the line "M98 P/sys/homedelta.g" to current_material.g, it writes the contents of homedelta.g to that file, and it also executes homedelta.g. If I change homedelta.g to a name that is not present, I get a message saying that the file was not found.

            If I send the same lines one at a time via the command line, then it works as expected.

            I conclude that M28 does not work correctly when run from within a macro, because it executes the following lines as well as saving them to file. I intend to fix this in the next 2.01beta.

            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

            wilrikerundefined 1 Reply Last reply Reply Quote 0
            • wilrikerundefined
              wilriker @dc42
              last edited by

              @dc42 Thanks for checking. Looking forward for a fix. 🙂

              Manuel
              Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
              with probably always latest firmware/DWC (incl. betas or self-compiled)
              My Tool Collection

              1 Reply Last reply Reply Quote 0
              • wilrikerundefined
                wilriker
                last edited by

                Just for reference: Confirm fixed in RRF 2.01 final.

                Manuel
                Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                with probably always latest firmware/DWC (incl. betas or self-compiled)
                My Tool Collection

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