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

    Cura - Duet RepRap Firmware Integration Question

    Scheduled Pinned Locked Moved
    General Discussion
    3
    9
    1.4k
    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.
    • DaveAundefined
      DaveA
      last edited by

      Anyone using the Duet RepRap Firmware Integration plugin on Cura 3.6? I'm getting an error message on the Duet DWC every time I upload a new file from Cura to the Duet. Each new file gets the message "Error: Failed to delete file 0:/gcodes/myfilename.gcode. But, the file gets stored on the Duet just fine. If I re-upload the same file from Cura there is no message. The error is only on the first time for a new filename.

      This is with Duet FW 2.02RC6, DWC 1.22.5 and the latest PanelDue. Cura is 3.6 and the plugin is 1.0.
      Just curious if this is a Cura or Duet thing.

      1 Reply Last reply Reply Quote 0
      • resamundefined
        resam
        last edited by

        Hi @DaveA,

        I'm the creator of the Cura-DuetRRF plugin.

        When you upload a new gcode file, the first step is to delete any old file with the same name. Of course, if the file doesn't exist, it causes the message you are seeing. This is normal and expected.

        Deleting the file, before uploading it, is done to ensure you don't accidentally start printing an outdated version of the file (same filename). This could happen if the upload fails for some reason and the firmware didn't catch it.

        Unfortunately there is no "check if file exists" function that I can use to prevent this message from showing up. Maybe @dc42 can be convinced to add one?

        1 Reply Last reply Reply Quote 0
        • DaveAundefined
          DaveA
          last edited by

          Hi,

          Thanks for the info. Nice job. It's quite convenient to just push one button and copy the file.
          Would it not be possible to attempt to open the file in python? If it opens then it exists so close it and delete it. I'm not familiar with python. I worked for 40 years in C, C++ and C# but never python.

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

            @resam, does your plugin delete the file explicitly? If so, it doesn't need to because RRF will take care of removing the existing file when you upload a new one with the same name.

            If not, then I guess I could suppress the error message when the error is that the file doesn't exist.

            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
            • resamundefined
              resam
              last edited by

              @dc42 yes, I'm calling the delete HTTP endpoint: https://github.com/Kriechi/Cura-DuetRRFPlugin/blob/master/DuetRRFOutputDevice.py#L174

              If you can confirm this is not necessary, I will remove it - but I seem to remember that in the past it was an additional safety measure to prevent accidentally reprinting an old file if a newer upload failed.

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

                If the rr_upload command reaches the Duet and is well-formed, then any existing file of that name will be truncated to zero length, so there would be no danger of printing the old file.

                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

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

                  PS - I'll change the code not to generate a global error message if the delete failed because the file or path was not found. The rr_delete call will still return an error code in this case. The error message will still be generated if any other error is returned by the f_unlink call to the filesystem.

                  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
                  • resamundefined
                    resam
                    last edited by

                    Ok - I'll remove the explicit delete call in the Cura plugin and release a new version in the next days.

                    Thanks for clarifying this!

                    1 Reply Last reply Reply Quote 1
                    • resamundefined
                      resam
                      last edited by

                      v1.0.1 of the plugin is now published and available in the Cura Marketplace for Cura 3.6 and the 4.0-beta.

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