Upload to repetier from slic3r prusa edition

edited February 2019 in Tips & Tricks
Hi,

I made a simple script to upload to repetier server waiting for slic3r native implementation as for octoprint or duet.

Script for Windows is the following :
@echo off
c:\Windows\System32\curl.exe -i -X POST -H "Content-Type: multipart/form-data" -H "x-api-key: xxxxxxxxxxxxxxxxxxxx" -F "a=upload" --url "http://192.168.0.xx:3344/printer/model/xxxxxxx" -F "filename=@%1" > curl_log.txt

You need to replace xxx by api key, ip adress and printer name.

in slic3r, in post processing scripts, just call the file you created, file name shall be .bat or .cmd to work.

In my case curl case already installed, you may need to install curl on a fresh windows...

Easy to adapt to mac or linux... just change the path and create a shell script instead.

Regards,
Pierre


«1

Comments

  • edited April 2019
    Did someone get to work and can I do another tutorial?
  • We will soon publish a new Desktop App to help with this. It will offer  watched upload directory so that you just need to save generated gcode to the right folder to upload to server.
  • edited April 2019
    :)
  • merlin2k said:
    Did someone get to work and can I do another tutorial?
    I's working for me at least ;-)
  • Well it just doesn't work for me... :/
    Slic3r PE always states: "The configured post-processing script does not exist: @echo" when I try to export a G-Code. Do you have any idea what I can try differently?
  • @MSOHD These are completely different issues. Your message sounds like you have defined a postprocessor that does not exist. Normally you do not use one, so solution would be to disable postprocessing.
  • :D The Problem was that I tried to directly copy the script into Slic3r, as I had done in Simplify 3D. Now I made an external .cmd file, but unfortunately it doesn't run either. If i click the file directly in Explorer it will open, but if I put the directory of the file in Slic3R and I try to slice it, then the error: Post-processing script D:/Dokumente/Prusa.cmd on file D:\Dokumente\3D Druck\Hexagon Shape_1_0.2mm_PLA_MK3.gcode failed.
    Error code: 6


    Do you have any idea what I can try differently? Probably I am just to big of a beginner in programming.....



  • Sorry, never used slic3r postprocessor so can not say much. But at least I think you need to adjust the script as but included filename etc. I guess you get either the filename if slic3r safes it before or the script will be send via stdin and must returned by stdout.


  • edited May 2019
    Repetier said:
    Sorry, never used slic3r postprocessor so can not say much. But at least I think you need to adjust the script as but included filename etc. I guess you get either the filename if slic3r safes it before or the script will be send via stdin and must returned by stdout.


    Indeed, it's very simple to test : in commande line, just execute your script with a gcode filemane & path in attribute.
    Did you checked if curl was installed on you PC ?
  • @Walli :s I don't understand what you are talking about... Yes curl is installed on my PC. What exactly do I have to write into the post-processing tab of Slic3R? Maybe there is my mistake? Or is there any way I can send you my script and you can quickly look over it? I really want it to work... :/
  • https://manual.slic3r.org/advanced/post-processing
    describes it well. You need absolute path and the only parameter is the path to the gcode, so should be no problem to convert it into a script. Just write absolute path to it in postprocessor field. For testing call it manually with gcode path in shell.
  • edited May 2019
    Now I got at lest a little progress. I copied this:
    D:/Dokumente/Prusa.bat;
    D:/Dokumente/Test.gcode
    into the post processing script, which is the absolute path to the exported gcode and the script from above and with this it upload the gcode to the server, but I still can't get it to work to automatically get the filename and the the path. I don't quit get how the whole script that is described in the manual probably because I'm not an native English speaker.

    PS: I really appreciate your help. I never would have gotten this far without you :)

  • MSOHD said:
    Now I got at lest a little progress. I copied this:
    D:/Dokumente/Prusa.bat;
    D:/Dokumente/Test.gcode
    into the post processing script, which is the absolute path to the exported gcode and the script from above and with this it upload the gcode to the server, but I still can't get it to work to automatically get the filename and the the path. I don't quit get how the whole script that is described in the manual probably because I'm not an native English speaker.

    PS: I really appreciate your help. I never would have gotten this far without you :)

    Sorry but I don't understand.... could try again explaining what are the pending issues ? 
  • Walli said:
    Repetier said:
    Sorry, never used slic3r postprocessor so can not say much. But at least I think you need to adjust the script as but included filename etc. I guess you get either the filename if slic3r safes it before or the script will be send via stdin and must returned by stdout.


    Indeed, it's very simple to test : in commande line, just execute your script with a gcode filemane & path in attribute.
    Did you checked if curl was installed on you PC ?
    So what you wrote here worked like a charm, but what Repetier wrote here:
    Repetier said:
    https://manual.slic3r.org/advanced/post-processing
    describes it well. You need absolute path and the only parameter is the path to the gcode, so should be no problem to convert it into a script. Just write absolute path to it in postprocessor field. For testing call it manually with gcode path in shell.
    Didn't work or I only understand it wrong. My biggest problem is that I still don't know what I have to exactly write into the post processing script in Slic3r, besides the absolut path to the script which you had written. I tried some things, but they didn't work at all.


  • This is what I have in slic3r.
  • Again
  • Repetier said:
    Sorry, never used slic3r postprocessor so can not say much. But at least I think you need to adjust the script as but included filename etc. I guess you get either the filename if slic3r safes it before or the script will be send via stdin and must returned by stdout.


    But what does Repetier mean with that? What do I have to change at the filename? And where do I have to change it?
  • Repetier said:
    https://manual.slic3r.org/advanced/post-processing
    describes it well. You need absolute path and the only parameter is the path to the gcode, so should be no problem to convert it into a script. Just write absolute path to it in postprocessor field. For testing call it manually with gcode path in shell.
    "the only parameter is the path to the gcode" but where do I have to change/write this parameter?
  • Just put the patch and batch file name in post processing. If you batch is working in command line with gcode filenale as attribute it will work
  • Walli said:
    Just put the patch and batch file name in post processing. If you batch is working in command line with gcode filenale as attribute it will work
    Same from PC instead of mobile <span>:smile:</span>
    Just put the path and batch file name in post processing.
    If your batch is working in command line with gcode filename as attribute it should work
  • edited May 2019
    But it still does not. I should probably just give up ...

    I just can't understand why... I did everything the same way as you but it just won't work. It makes me really diappointed, because this was no problem with my old octoprint setup... :/
  • Repetier said:
    We will soon publish a new Desktop App to help with this. It will offer  watched upload directory so that you just need to save generated gcode to the right folder to upload to server.
    Are there at least some news about this solution @Repetier ?
  • Maybe you show us your batch so we can see what you are doing. It's easier to discuss errors we we can see it.

    Working on monitor/server update. Still planned end may/start june.
  • edited May 2019
    Well it is nearly the same as Walli had posted above:
    @echo off
    c:\Windows\System32\curl.exe -i -X POST -H "Content-Type: multipart/form-data" -H "x-api-key: 6731c337-0667-4be7-9844-XXXXXXXXXX" -F "a=upload" --url "http://192.168.XXX.105:3344/printer/model/Prusa_i3_Mk3" -F "filename=@%1" > curl_log.txt

    (X' are for safety reasons)

    With the filepath it looks something like this:
    @echo off
    c:\Windows\System32\curl.exe -i -X POST -H "Content-Type: multipart/form-data" -H "x-api-key: 6731c337-0667-4be7-9844-XXXXXXXXXX" -F "a=upload" --url "http://192.168.XXX.105:3344/printer/model/Prusa_i3_Mk3" -F "filename=@D:\Dokumente\Test.gcode" > curl_log.txt

    With the filepath it works perfectly fine but without anything inserted there it doesn't work.

    Any ideas?




  • -F "filename=@%1"
  • Walli said:
    -F "filename=@%1"

    With that it doesn't work...
  • edited May 2019
    In Slic3r in post processing script I wrote this:

    D :\Dokumente\Prusa.bat;

    which is my path to the batch file.


  • edited May 2019
    WTF I tried it again and again and now it works without a change...
    I'm so happy at this moment! Thank you for your help!
    I have no clue why it didn't work...
  • MSOHD said:
    WTF I tried it again and again and now it works without a change...
    I'm so happy at this moment! Thank you for your help!
    I have no clue why it didn't work...
    Can you post a screenshot from the line in Slic3r, and your correct line here Please...thanks

Sign In or Register to comment.