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

    Duet wifi S3D

    Scheduled Pinned Locked Moved
    General Discussion
    31
    50
    12.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.
    • CR-34T3Rundefined
      CR-34T3R
      last edited by

      For anyone still looking through this thread, the following S3D script will upload the file to your printer (with a timestamp) and tell it to start printing that file much like Slic3r would do:

      curl  -F "file=@[output_filepath]" "http://XXX.XXX.XXX.XXX/rr_upload?name=gcodes/[output_filename].gcode&time=YYY"
      curl "http://XXX.XXX.XXX.XXX/rr_gcode?gcode=M32[output_filename].gcode"
      

      Copy and paste into "Additional terminal commands for post processing" under the Scripts tab and replace XXX.XXX.XXX.XXX with your printer's IP address or hostname if applicable. As mentioned above, DWC will throw a couple of errors but doesn't seem to impact the print in any way. Happy printing!

      dc42undefined 1 Reply Last reply Reply Quote 1
      • dc42undefined
        dc42 administrators @CR-34T3R
        last edited by dc42

        You may wish to add the following line at the end:

        curl "http://XXX.XXX.XXX.XXX/rr_disconnect"

        This will avoid RRF buffering up messages that S3D isn't going to fetch.

        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
        • apakundefined
          apak
          last edited by

          I have try pathio alpha/beta versions and have Duet integration, to upload files, and they do not add any header to gcode file uploaded.

          1 Reply Last reply Reply Quote 0
          • mwolterundefined
            mwolter
            last edited by

            Worked on this for a while and was able to resolve the issue where file names are truncated if the name contains a space.

            Basically all it does is replace spaces in the file name with %20, a simple form of URL Encode. It also uses --data-binary and does not add any extra text to the Gcode like the -F option does. Paste this into the 'Additional terminal commands for post processing' on the Scripts tab of Simplify 3d... don't forget to change the IP address. I'm sure there's a more elegant way but this works on a Mac.

            bash -c "echo 'http://xxx.xxx.xxx.xxx/rr_upload?name=gcodes/[output_filename].gcode' | sed 's/ /%20/g' | curl --data-binary '@[output_filepath]' $(</dev/stdin)";

            1 Reply Last reply Reply Quote 0
            • Mogalundefined
              Mogal
              last edited by

              Hello, sry for bumping this thread, but just wanted to say thank you for this. Been wanting this 'feature' for awhile now, and just found this thread and got it working! WOOT!

              But I do get a error when starting the file. Is there a way to eliminate the error? Thanks!

              0_1567546781511_20190903_142508.jpg

              My script is as follows:
              curl -F "file=@[output_filepath]" "http://192.168.0.10/rr_upload?name=gcodes/[output_filename].gcode&time=YYY" ; uploads file to printer
              ; curl "http://192.168.0.10/rr_gcode?gcode=M32[output_filename].gcode" ; Starts the file printing
              curl "http://192.168.0.10/rr_disconnect" ; Not sure what this one does

              1 Reply Last reply Reply Quote 0
              • A Former User?
                A Former User
                last edited by A Former User

                Searching the firmware source for "Bad command" seems to suggest the firmware is taking the HTTP header to be part of the g-code to process?

                Maybe try getting curl to use a minimum of headers, seem to recall DWC not using a fully http compliant parsing of the requests after having looked into something else.

                ref: https://stackoverflow.com/questions/31293181/how-can-i-remove-default-headers-that-curl-sends

                may be out of luck with adding -H 'Content-Disposition:' -H 'Content-Type:' but try it and see if things have changed the last 2 years or when that comment was from..

                1 Reply Last reply Reply Quote 0
                • A Former User?
                  A Former User
                  last edited by A Former User

                  Seems its the file uploading enforcing the Content-Type to be multipart, which breaks the parsing.

                  workaround:

                  curl --data-binary "@[output_filepath]" "http://10.10.0.169/rr_upload?name=gcodes/[output_filename].gcode&time=YYY" 
                  curl "http://10.10.0.169/rr_disconnect"
                  

                  which was mentioned in the post just above yours...

                  etrigan63undefined 1 Reply Last reply Reply Quote 1
                  • etrigan63undefined
                    etrigan63 @A Former User
                    last edited by

                    @bearer That code works as long as there are no spaces in the name.

                    Carlos Echenique
                    3D Printers Guru

                    A Former User? 1 Reply Last reply Reply Quote 0
                    • A Former User?
                      A Former User @etrigan63
                      last edited by

                      @etrigan63 said in Duet wifi S3D:

                      no spaces

                      thats a limitation of the URL specification, replace spaces with %20 if you need them, but in general you will find life much simpler by using - or _ or any other delimiter instead of spaces in filenames.

                      as aworkaround you could try adding --data-urlencode to the curl commandline but I haven't tried it.

                      1 Reply Last reply Reply Quote 0
                      • orcundefined
                        orc
                        last edited by orc

                        I made it easier

                        App:
                        https://mega.nz/file/ywgiCS5Y#kHK4-RvvnkdyTL-yI6dlYlC_4e3lTijv3ViF1e0QLiY
                        (windows exe file, didn't obfuscate so you can check that it's no more than an uploader)
                        You'd need .NET Framework 4.6.2 or newer

                        Command:
                        "C:\path\path\FileUploadProgress.exe" "Uploading print file..." "[output_filepath]" "http://duet_replicator.local/rr_upload?name=gcodes/[output_filename].gcode"
                        curl "http://duet_replicator.local/rr_disconnect"

                        Preview:
                        uploader.png

                        Comments: (for anyone without previous experience with this method)
                        You must be logged in to you web interface from a browser for that to work

                        Phaedruxundefined 1 Reply Last reply Reply Quote 2
                        • Phaedruxundefined
                          Phaedrux Moderator @orc
                          last edited by

                          @orc Perhaps you could make a dedicated post to share your uploader app to increase visibility?

                          Z-Bot CoreXY Build | Thingiverse Profile

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