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

    No G-code command to return files like GET /rr_filelist ?

    Scheduled Pinned Locked Moved Solved
    General Discussion
    3
    9
    402
    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.
    • Otsoundefined
      Otso
      last edited by

      I'm making a desktop app to control the Duet 2 WiFi for CNC use (WorkBee). I do all communication over telnet, except for listing files on the SD card for which I use HTTP. The reason is that GET /rr_filelist returns the information in a convenient format. I know there is M20 S2, but that is not as convenient, since it doesn't return files size or creation time, so I would have to make an additional call with M36 to get the details (all I care about is file size and date). On top of that, I can't find a way to get directory create time with any G-code, as M36 on a directory gives an error.

      My questions are:

      • Is there a way to get the same information as GET /rr_filelist over telnet/G-code, in case I have missed it?
      • If not, any plans to add it?
      • Is there any way to get directory create time over telnet/G-code?

      (Using a desktop app makes my workflow much easier, since no mouse clicking is needed, and I generally find usability to be better. This makes more of a difference for CNC use -- as opposed to 3D printing -- as you manually move the router around a lot more than with 3D printing, probing corners etc. My app is already usable, but still work in progress.)

      duetapp.jpg

      Sindariusundefined 1 Reply Last reply Reply Quote 1
      • Sindariusundefined
        Sindarius @Otso
        last edited by

        @otso You can use M20 to get a list of files.

        https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m20-list-sd-card

        Otsoundefined 1 Reply Last reply Reply Quote 0
        • Otsoundefined
          Otso @Sindarius
          last edited by

          @sindarius Did you read my post? 😉

          "I know there is M20 S2, but that is not as convenient, since it doesn't return files size or creation time"

          How do I get the creation time of a directory?

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

            @otso try M20 S3.

            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

            Otsoundefined 2 Replies Last reply Reply Quote 0
            • Otsoundefined
              Otso @dc42
              last edited by Otso

              @dc42 Wow, thanks! Exactly what I was looking for! Maybe add that to the manual. 🙂

              I just finished implementing using M20 S2 and M36, but it should be easy enough to go "back" using M20 S3.

              Here's using M20 S2, M36, no directory date:

              f8e2e017-2863-4cef-a397-6ae4af908312-image.png

              1 Reply Last reply Reply Quote 0
              • Otsoundefined
                Otso @dc42
                last edited by Otso

                @dc42 It's no problem whatsoever, but I find it a little odd that both M20 S2 and S3 include the "Begin file list" and "End file list".

                Begin file list
                {"dir":"0:/gcodes/","first":0,"files":[{"type":"d","name":"Test","size":0,"date":"2022-03-14T00:48:18"},{"type":"f","name":"clock_contour.nc","size":5704,"date":"2022-03-10T19:47:08"}],"next":0}
                End file list
                

                I would expect a pure JSON response, like M36 and other commands that return JSON do. I can understand the header and footer for the text S0 response.

                dc42undefined 3 Replies Last reply Reply Quote -1
                • dc42undefined
                  dc42 administrators @Otso
                  last edited by

                  @otso yes that extra text is unintentional. I will log it for fixing in RRF 3.5.

                  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

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

                    @otso I think that text may go away if you use M555 to change the emulation mode from Marlin to RRF.

                    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

                    1 Reply Last reply Reply Quote 0
                    • Otsoundefined Otso marked this topic as a question
                    • Otsoundefined Otso has marked this topic as solved
                    • dc42undefined
                      dc42 administrators @Otso
                      last edited by

                      @otso this is now fixed in the source code. The fix will be in RRF 3.5.0beta1 and in 3.4.1beta1.

                      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

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