• Tags
  • Documentation
  • Order
  • Register
  • Login
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.
  • undefined
    schneik80
    last edited by 3 Oct 2017, 19:08 10 Mar 2017, 19:08

    On OSX i have a folder action using a bash script

    [[language]]
    for f in "$@"
    do
    	path="$f"
    	file=${path##*/}
    	curl -# -d "@$f" -X POST http://xxx.xxx.xxx.xxx/rr_upload?name=gcodes/$file
    done
    
    

    Any gcode file I save to this folder with the action gets uploaded. I like this better than the s3d terminal option because the upload happens on save, not preview on print. In this way i only upload once when i know the print looks right.

    1 Reply Last reply Reply Quote 0
    • undefined
      FrankNPrinter
      last edited by 10 Mar 2017, 19:49

      Just my 2 cents and might be off topic but if using usb, you might want to modify a cable and cut out the 5V supply especially if you have a dedicated 5v in to the board already.

      1 Reply Last reply Reply Quote 0
      • undefined
        BrianHanifin
        last edited by 26 Sept 2017, 01:44

        Thank you for this. I have fine tuned the code for Simplify3D a little, and it works great! đŸ™‚

        curl -d "@[output_filepath]" -X POST http://hypercube.local/rr_upload?name=gcodes/[output_filename].gcode
        
        1 Reply Last reply Reply Quote 0
        • undefined
          BrianHanifin
          last edited by 26 Sept 2017, 14:22

          OK. While the above code does upload a file to duet, it does something to the file that leaves it unprintable. I have experimented with it and discovered the following works. This may not be the optimal method still, but it does yield a printable GCode file.

          curl  -F "file=@[output_filepath]" "http://hypercube.local/rr_upload?name=gcodes/[output_filename].gcode"
          
          

          The reason I say it is not optimal is that is places some HTTP data at the top of the file. But, Duet appears to ignore this code and happily prints anyway. So, for now it will do.

          --------------------------16eea21da68ae83e
          Content-Disposition: form-data; name="file"; filename="curl_test.gcode"
          Content-Type: application/octet-stream
          
          
          1 Reply Last reply Reply Quote 0
          • undefined
            Alex9779
            last edited by 27 Sept 2017, 09:53

            This is great! thumbsup Thanks for sharing…

            1 Reply Last reply Reply Quote 0
            • undefined
              sungod3k
              last edited by 5 Oct 2017, 17:36

              Hi,

              I used a similar command with Octoprint succesfully so I was quite happy when I found this thread.

              The command Im using is
              curl -# -d "@[output_filepath]" -X POST http://xxx.xxx.xxx.xxx/rr_upload?name=gcodes/[output_filename].gcode"
              which uploads the code correctly, however when I want to print the autouploaded code, it starts the print, does nothing and then returns the message "print finished in 0h 1m".

              The same code works normally when I upload it via the webinterface.

              Whats the trick to get that working?

              Cheers

              http://www.42dimensions.de/
              https://printnewworlds.blogspot.com/

              1 Reply Last reply Reply Quote 0
              • undefined
                MoS-tekknix
                last edited by 5 Oct 2017, 18:53

                Please download the "uploaded" GCode via WebInterface and take a look into the file. Maybe there it will be clearer what happens.

                1 Reply Last reply Reply Quote 0
                • undefined
                  sungod3k
                  last edited by 5 Oct 2017, 20:13

                  I ran the original and the autouploaded file through notepad++s compare tool and they matched 100%

                  http://www.42dimensions.de/
                  https://printnewworlds.blogspot.com/

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    MoS-tekknix
                    last edited by 5 Oct 2017, 21:18

                    @sungod3k:

                    I ran the original and the autouploaded file through notepad++s compare tool and they matched 100%

                    Uhm, thats interesting.

                    Can you try this one, i'm using and change the IP to your DuetWifi/Ethernet IP?

                    [[language]]
                    curl -F "file=@[output_filepath]" "http://192.168.178.144/rr_upload?name=gcodes/[output_filename].gcode"
                    
                    

                    That is working even if the Printer is currently busy.

                    Regards
                    MoS-tekknix

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      sungod3k
                      last edited by 7 Oct 2017, 19:25

                      Great, that seems to work. Thanks

                      http://www.42dimensions.de/
                      https://printnewworlds.blogspot.com/

                      1 Reply Last reply Reply Quote 0
                      • undefined
                        MoS-tekknix
                        last edited by 7 Oct 2017, 23:42

                        @sungod3k:

                        Great, that seems to work. Thanks

                        You're welcome. That's what's a forum for đŸ˜‰

                        Regards
                        MoS-tekknix

                        1 Reply Last reply Reply Quote 0
                        • undefined
                          tychop
                          last edited by 26 Feb 2018, 12:16

                          @MoS-tekknix:

                          @sungod3k:

                          I ran the original and the autouploaded file through notepad++s compare tool and they matched 100%

                          Uhm, thats interesting.

                          Can you try this one, i'm using and change the IP to your DuetWifi/Ethernet IP?

                          [[language]]
                          curl -F "file=@[output_filepath]" "http://192.168.178.144/rr_upload?name=gcodes/[output_filename].gcode"
                          
                          

                          That is working even if the Printer is currently busy.

                          Regards
                          MoS-tekknix

                          This script
                          curl -F "file=@[output_filepath]" "http://192.168.x.x/rr_upload?name=gcodes/[output_filename].gcode"
                          uploads the file correctly, but the print doesn't start…

                          Am I missing something?

                          1 Reply Last reply Reply Quote 0
                          • dc42undefined
                            dc42 administrators
                            last edited by 26 Feb 2018, 12:24

                            You need to send a separate command to print the 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

                            1 Reply Last reply Reply Quote 0
                            • undefined
                              tychop
                              last edited by 26 Feb 2018, 13:16

                              Yes, I figured that could be the issue, however, I couldn't find anything here https://github.com/chrishamm/DuetWebControl…

                              Is there a command to print? Where can I look for it?

                              I can see

                              [[language]]
                              function startUpload(type, files, fromCallback) {
                              
                              ```in the javascript, but am clueless how to specify 'print' as the type to upload gcode & start the print
                              1 Reply Last reply Reply Quote 0
                              • dc42undefined
                                dc42 administrators
                                last edited by 26 Feb 2018, 13:46

                                Use the rr_gcode command to send M32 "filename.gcode".

                                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
                                • undefined
                                  tychop
                                  last edited by 26 Feb 2018, 13:54

                                  Yep, Got it

                                  This works:
                                  curl -F "file=@[output_filepath]" "http://192.168.x.x/rr_upload?name=0%3A%2Fgcodes%2F[output_filename].gcode"
                                  curl "http://192.168.x.x/rr_gcode?gcode=M32 0%3A%2Fgcodes%2F[output_filename].gcode"

                                  Many thanks !!

                                  1 Reply Last reply Reply Quote 0
                                  • dc42undefined
                                    dc42 administrators
                                    last edited by 26 Feb 2018, 16:07

                                    You will need to enclose the filename in double quotes when sending it if you want it to work on filenames with ( or ) or ; in the name.

                                    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
                                    • undefined
                                      SEUTec
                                      last edited by 3 Nov 2018, 21:04 11 Mar 2018, 21:03

                                      Hi all:

                                      curl –data-binary "@[output_filepath]" "http://192.168.x.x/rr_upload?name=gcodes/[output_filename].gcode"

                                      –data-binary don't losse the NewLine or CarriageReturns as -d do.
                                      and don't add extra data to the gcode file as -F do.

                                      Regards.

                                      1 Reply Last reply Reply Quote 0
                                      • undefined
                                        kuhnikuehnast
                                        last edited by 26 Apr 2018, 18:46

                                        The best that worked for me is:

                                        curl --data-binary "@[output_filepath]" "http://192.168..XX.XX/rr_upload?name=gcodes%2F[output_filename].gcode"

                                        curl "http://192.168.XX.XX/rr_gcode?gcode=M32 [output_filename].gcode"

                                        But there are still some problems...

                                        1. If you have a Space in the name, the file is only saved as the first part til the space (e.g. Test file.gcode is saved as Test.gcode)
                                        2. Special Characters (e.g. Ă¤Ă¶Ă¼) aren't saved properly
                                        3. Is there a possibility to delete the file on the local computer after uploading it to the duet? Couldn't find any solution...

                                        greetings kuhni

                                        1 Reply Last reply Reply Quote 0
                                        • undefined
                                          bellwether @dc42
                                          last edited by bellwether 6 Nov 2018, 16:03 11 Jun 2018, 14:56

                                          @dc42

                                          hmm, i guess this is a stupid question, but I am unclear

                                          1. where to put these lovely scripts to load the file.
                                          1 Reply Last reply Reply Quote 0
                                          • First post
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA