Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    Fix to show correct filament usage in DWC for slic3r gcode

    Duet Web Control wishlist
    7
    12
    692
    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.
    • jv43
      jv43 last edited by jv43

      After switching to slic3r-PE I DWC stopped showing filament usage.
      I was pretty bummed about that as i find the estimate based on filament usage fairly accurate.
      After I reformatted the SD-card, I started playing with the gcode itself and was able to fix it manually.

      this is the relevant gcode generated by slic3r:

      ; filament used [mm] = 4235.9
      ; filament used [cm3] = 10.2
      ; filament used [g] = 13.1
      ; filament cost = 0.4
      ; total filament used [g] = 13.1
      ; total filament cost = 0.4
      ; estimated printing time (normal mode) = 46m 49s
      

      DWC seems to look for:

      ; filament used = 4235.9
      

      So, after modifying the file accordingly DWC recognizes the filament usage correctly.
      I'd be much appreciated, if this could be fixed in an upcoming release.

      In the meantime, is it possible for me to edit the parser, so it'll do that automatically for me?
      So changing the parser code to look for

      ; filament used [mm] = xxxx.x
      

      instead of

      ; filament used = xxxx.x
      

      I have no idea where these instructions are stored, so any help would be appreciated.

      Also, I'd like request maybe allowing us to change which columns are displayed in the gcode browser.
      I don't really need the info to which slicer was used generate the code visible, I'd much prefer something like cost.

      Thanks for your help

      Scachi 1 Reply Last reply Reply Quote 2
      • keyz182
        keyz182 last edited by

        Looks like this is the code you'd need to modify - https://github.com/dc42/RepRapFirmware/blob/d9f051b6c658fa278b22535a8bd03d124bcf8fad/src/Storage/FileInfoParser.cpp#L651

        Details on building the firmware here - https://github.com/dc42/RepRapFirmware/blob/dev/BuildInstructions.md

        1 Reply Last reply Reply Quote 0
        • keyz182
          keyz182 last edited by

          Looks like you'd need to add [, m, and ] to the strchr maybe?

          1 Reply Last reply Reply Quote 0
          • Scachi
            Scachi @jv43 last edited by Scachi

            @jv43 I use a perl script, windows 10, you need to adjust the paths to match your structure.
            This is replacing the string correctly, but I haven't tried if this will really fix it for dwc.

            The newest prusa slicer hasn't the perl bundled anymore..I use the perl5.24.0.exe from previous version Slic3rPE-1.41.3+win64-full-201902111723

            PrusaSlicer - print settings - output :

            D:\3Dprint\filause.bat;
            

            The content of the filause.bat file:

            D:\ProgrammePortable\Slic3rPE-1.41.3+win64-full-201902111723\perl5.24.0.exe d:\3dprint\filause.pl %*
            

            The content of the filause.pl file:

            use strict;
            use warnings;
            
            $^I = '.bak'; # create a copy of the file
            
            # read stdin and any/all files passed as parameters, one line at a time
            while (<>) {
            	# shorten string to display creation time of file on dwc #
            	s/PrusaSlicer/PS/;
            	
            	# filament used [mm] =
            	s/; filament used [mm](.*)/; filament used$1/;
            
            	print;
            }
            
            1 Reply Last reply Reply Quote 0
            • gnydick
              gnydick last edited by

              I always thought it just counted the extrusions it made. It's always worked fine for me.

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

                Please make this GCode file available to me via Dropbox or another file sharing site. I can put a fix for this in the next 2.03RC. Unfortunately, some slicer developers often change the metadata format, so it's a moving target.

                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

                whosrdaddy jv43 2 Replies Last reply Reply Quote 0
                • whosrdaddy
                  whosrdaddy @dc42 last edited by

                  @dc42 : why not make it configurable? that way the user can adapt if the slicer decides to change it format...

                  1 Reply Last reply Reply Quote 0
                  • mloidl
                    mloidl last edited by

                    @dc42
                    I've sliced a marvin using Slic3rPE 1.41.3 and PrusaSlicer 2.0.0
                    The 2 GCodes can be downloaded from https://www.dropbox.com/s/3o7nibahbyuaixn/Marvin_GCode.zip?dl=0

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

                      @dc42

                      sample gcode prenerated by PrusaSlicer 2.0.0

                      https://gofile.io/?c=MUaRnC

                      filament usage parameter is located at the beginning of the metadata at the end of the file, starting at line 5685 of the file linked above

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

                        @jv43 said in Fix to show correct filament usage in DWC for slic3r gcode:

                        @dc42

                        sample gcode prenerated by PrusaSlicer 2.0.0

                        https://gofile.io/?c=MUaRnC

                        filament usage parameter is located at the beginning of the metadata at the end of the file, starting at line 5685 of the file linked above

                        Thanks. I've implemented a change in my latest 2.03 source code and I will test it using that 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

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

                          @dc42
                          Awesome!
                          I'll test it once you release 2.03RC3

                          1 Reply Last reply Reply Quote 0
                          • gnydick
                            gnydick last edited by

                            I can confirm after switching to the PrusaSlicer 2.0 from 1.41.3, I'm having the same problems now. Happy to help with more gcode files if you need, @dc42 , @jv43

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