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.
Definitely looking forward to this. My current process is very cumbersome.
Have you considered direct integration with PrusaSlicer?
I'm trying to get this to work. I'm getting the following error:
PrusaSlicer has encountered an error Post-processing script C:\Users\cosmi\PrinterScript.bat on file C:\Users\cosmi\Downloads\3DBenchy.gcode failed. Error code: 1
Using the following batch file:
@echo off c:\Windows\System32\curl.exe -i -X POST -H "Content-Type: multipart/form-data" -H "x-api-key: fdb5b006-6131-45b0-b4e1-xxxxxxxxxxxxxxxx" -F "a=upload" --url "http://192.168.1.100:3344/printer/model/Prusa_MK2.5" -F "filename=@%1" > curl_log.txt
I'm trying to get this to work. I'm getting the following error:
PrusaSlicer has encountered an error Post-processing script C:\Users\cosmi\PrinterScript.bat on file C:\Users\cosmi\Downloads\3DBenchy.gcode failed. Error code: 1
Using the following batch file:
@echo off c:\Windows\System32\curl.exe -i -X POST -H "Content-Type: multipart/form-data" -H "x-api-key: fdb5b006-6131-45b0-b4e1-xxxxxxxxxxxxxxxx" -F "a=upload" --url "http://192.168.1.100:3344/printer/model/Prusa_MK2.5" -F "filename=@%1" > curl_log.txt
Any suggestions?
I modified the script with a fixed path to a gcode and just ran it. I changed the printer name to be as simple as I could make it.
@echo off c:\Windows\System32\curl.exe -i -X POST -H "Content-Type: multipart/form-data" -H "x-api-key: fdb5b006-6131-45b0-b4e1-*" -F "a=upload" --url "http://192.168.1.100:3344/printer/model/MK2" -F "filename=Test.gcode" > curl_log.txt
curl_log.txt still shows this:
HTTP/1.1 100 Continue HTTP/1.1 200 OK Date: Mon, 27 May 2019 13:53:19 GMT Connection: Close Server: 0.91 Access-Control-Allow-Origin: * Content-Type: text/html; charset=utf-8 Cache-Control: public, max-age=0 {"error":"Unknown printer"}
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 276 0 27 100 249 27 249 0:00:01 --:--:-- 0:00:01 8903
So it is different. Now when I run it from a command prompt I get the following (API truncated for safety):
c:\Windows\System32\curl.exe -i -X POST -H "Content-Type: multipart/form-data" -H "x-api-key: fdb5b006-6131-45b0-b4e1-*" -F "a=upload" --url "http://192.168.1.100:3344/printer/model/Prusa_MK26" -F "filename=C:\Users\cosmi\Downloads\Test.gcode" > curl_log.txt
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 274 0 0 100 274 0 18 0:00:15 0:00:15 --:--:-- 0
curl: (52) Empty reply from server
"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."
Sure. We are in the last phase of server release testing which is required for the new app. The app it self needs a bit more testing but will appear shortly after 0.92.0 is finished. Maybe as beta but it is already working quite well and also feature complete.
Sure. We are in the last phase of server release testing which is required for the new app. The app it self needs a bit more testing but will appear shortly after 0.92.0 is finished. Maybe as beta but it is already working quite well and also feature complete.
Thanks, you did a fantastic job. If you need help with spanish translations, contact me.
Sure. We are in the last phase of server release testing which is required for the new app. The app it self needs a bit more testing but will appear shortly after 0.92.0 is finished. Maybe as beta but it is already working quite well and also feature complete.
Repetier-Server Monitor works well for this purpose, although its overall usefulness is limited for me because of the way it doesn't save preferences for folders and sorting. I'm hoping an update fixes these issues and then Monitor will be my go-to instead of opening a browser window alongside it.
The PrusaSlicer team doesn't seem to be too interested in adding this functionality. I guess they are too busy with other things.
I wanted to add some comments after struggling with this for a while... pretty much all of the suggested methods work as long as you run PrusaSlicer as an Administrator.
Here is my working configuration:
PrusaSlicer Post-processing scripts setting - <path to your batch file>\<batch file name and file extension>
"C:\Windows\System32\curl.exe" -i -X POST -H "Content-Type: multipart/form-data" -H "x-api-key: <Repetier Server API Key>" -F "a=upload" --url "http://<Repetier Server IP Address>:3344/printer/model/<Repetier Server Printer Name (case sensitive)>" -F "filename=@%1"
If you have any trouble or just want to see what's going on when the batch file is called, change the first line of the batch file from "@ECHO OFF" to "@ECHO ON" and add a new line at the end with "PAUSE". This will allow the batch file to pause after it runs and show you information that may help in troubleshooting.
"C:\Windows\System32\curl.exe" -i -X POST -H "Content-Type: multipart/form-data" -H "x-api-key: <Repetier Server API Key>" -F "a=upload" --url "http://<Repetier Server IP Address>:3344/printer/model/<Printer name (case sensitive) as shown in Repetier Server>" -F "filename=@%1" PAUSE
I hope this helps and prevents others from spending way too much time getting this working like I did!
I had issues getting this to work, with an error popping up in PrusaSlicer: Post-processing script "V:\Other Program Files\Repetier-Host\Slic3rPE 2.2\upload_to_repetier_server.bat" on file V:\Documents\3d printing\Tests\test.gcode failed. Error code: 1 Administrator mode did not help. The problem in my case was that the gcode path parameter passed into %1 was getting wrapped in quotes behind the scenes due to the spaces in my "3d printing" path AND the "Other Program Files" path has spaces in it too. I expect the same issue will crop up if the gcode filename has a space in it. Anyway, I moved my .BAT script to a path with no spaces and changed -F "filename=@%1"to -F "filename=@%~f1"which makes the parameter get interpreted as a path (and expanded to a full path if not already complete). Now everything I export to gcode from PrusaSlicer uploads into the "Default" group for my printer in Repetier Server, just like I wanted.
I did not need to run anything in Administrator mode, but this computer is still running Windows 7, so not sure if that is needed on Windows 10.
Since that worked I wanted to see some feedback about whether surl failed or succeeded and keep a log of past uploads. For anyone not using Repetier-Server Monitor that wants to get this working as a post processing script. here is my full batch file (with X's instead of actual API, IP, and printer model):
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.
Has this ever been published? Would love to see it in action.
Comments
Have you considered direct integration with PrusaSlicer?
Using the following batch file:
Any suggestions?
I modified the script with a fixed path to a gcode and just ran it. I changed the printer name to be as simple as I could make it.
curl_log.txt now only reads this:
It still does not appear to have been sent.
Thanks for your help!
Is progressing this feature? Thanks.
The PrusaSlicer team doesn't seem to be too interested in adding this functionality. I guess they are too busy with other things.
Here is my working configuration:
PrusaSlicer Post-processing scripts setting - <path to your batch file>\<batch file name and file extension>
Example - C:\Users\Bob\ExportGCode.bat
Batch file contents:
@ECHO OFF
If you have any trouble or just want to see what's going on when the batch file is called, change the first line of the batch file from "@ECHO OFF" to "@ECHO ON" and add a new line at the end with "PAUSE". This will allow the batch file to pause after it runs and show you information that may help in troubleshooting.
Example -
@ECHO ON
PAUSE
I hope this helps and prevents others from spending way too much time getting this working like I did!
Post-processing script "V:\Other Program Files\Repetier-Host\Slic3rPE 2.2\upload_to_repetier_server.bat" on file V:\Documents\3d printing\Tests\test.gcode failed.
Error code: 1
Administrator mode did not help. The problem in my case was that the gcode path parameter passed into %1 was getting wrapped in quotes behind the scenes due to the spaces in my "3d printing" path AND the "Other Program Files" path has spaces in it too. I expect the same issue will crop up if the gcode filename has a space in it. Anyway, I moved my .BAT script to a path with no spaces and changed -F "filename=@%1" to -F "filename=@%~f1" which makes the parameter get interpreted as a path (and expanded to a full path if not already complete). Now everything I export to gcode from PrusaSlicer uploads into the "Default" group for my printer in Repetier Server, just like I wanted.
I did not need to run anything in Administrator mode, but this computer is still running Windows 7, so not sure if that is needed on Windows 10.
Since that worked I wanted to see some feedback about whether surl failed or succeeded and keep a log of past uploads. For anyone not using Repetier-Server Monitor that wants to get this working as a post processing script. here is my full batch file (with X's instead of actual API, IP, and printer model):