Curl + KISS in RRF
-
@sinned6915 I just saw another possibility: https://reprap.org/forum/read.php?416,819219
-
i finally got this figured out. Windows is a little bit different-
In KISS the script call from the Printer ->Post-Process command is
<KSPATH>\EV2RRF.BAT "<FILE>"
the EV2RRF.BAT script contains-
ECHO ON curl -# -v --data-binary "@%1" -X POST http://192.168.0.25/rr_upload?name=gcodes/%~nx1 curl "http://192.168.0.25/rr_disconnect" PAUSE
the %~nx1 is to parse the filename
CAUTION: something does not like dashes / minus signs in the filenames. I have not been able to determine if its KISS or CURL, but its easier to just avoid them all together.
thanks to all who helped me figure this out.
EDIT: The resulting command window will open and show you the progress of the transfer. It will then prompt you to hit any key to close the command window -
F:\3D_Printer\Kiss_1.6.3>ECHO ON F:\3D_Printer\Kiss_1.6.3>curl -# -v --data-binary "@"F:\3D_Printer\Models\Microscope_Stand\files\arm_base.gcode"" -X POST http://192.168.0.25/rr_upload?name=gcodes/arm_base.gcode Note: Unnecessary use of -X or --request, POST is already inferred. * Trying 192.168.0.25:80... * TCP_NODELAY set * Connected to 192.168.0.25 (192.168.0.25) port 80 (#0) > POST /rr_upload?name=gcodes/arm_base.gcode HTTP/1.1 > Host: 192.168.0.25 > User-Agent: curl/7.65.1 > Accept: */* > Content-Length: 6109076 > Content-Type: application/x-www-form-urlencoded > Expect: 100-continue > * Done waiting for 100-continue * We are completely uploaded and fine * Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < Cache-Control: no-cache, no-store, must-revalidate < Pragma: no-cache < Expires: 0 < Access-Control-Allow-Origin: * < Content-Type: application/json < Content-Length: 9 < Connection: close < {"err":0}* Closing connection 0 F:\3D_Printer\Kiss_1.6.3>curl "http://192.168.0.25/rr_disconnect" {"err":0} F:\3D_Printer\Kiss_1.6.3>PAUSE Press any key to continue . . .
-
@sinned6915 nice that you found the reason finally! Could you please post the command line which works for you, in case someone needs the command also. Would be a good documentation project.
-
to send it via command prompt in Windows -
curl -v -F "file=KS_Wizard.gcode" "http://192.168.0.29/rr_upload?name=gcodes/KS_Wizard.gcode"
where KS_Wizard.gcode was the filename
-
@sinned6915 Thank you, I see, you used the filename without any paths. Good idea. Thank you for documenting. Using curl and rr_ codes is a nice way to connect different hardware or software.
I expect it was some problem of the differences between Windows, Linux and Apple of the path usage which causes the problems, maybe something not defined portable enough. Linux uses /, Windows uses \ and often must be escaped to doubled backslash or some %... value.
-
it's rough, but it works. if I take out either the -X or POST it goes kerflewie.
the Expect 100-continue seems to be the message while its transfering, and it takes a bit to upload the gcode.
i think part of the original issue is the KISS post-process script is using the double quotes in passing on the filename as the argument.
thanks again for your support