Ability to run script from within KISS

Ability to run script from within KISS

Postby sinned6915 » 01 May 2018, 00:22

Jonathan et al-

I would like to request the ability to run a script from within KISS, specifically to upload to Octoprint.

This is how they do it from within S3D-
https://github.com/foosel/OctoPrint/wik ... -Octoprint

using CURL- https://curl.haxx.se/using command lines to send data.

best regards,

dennis
sinned6915
 
Posts: 42
Joined: 28 Nov 2017, 10:06

Re: Ability to run script from within KISS

Postby pjr » 01 May 2018, 05:35

Is it possible to use the Settings/Printer/Firmware/Post-Process entry field for this?

Image1.png
Image1.png (27.91 KiB) Viewed 565 times


Peter
Please note: I do not have any affiliation with KISSlicer. Any advices given are offered in good faith. It is your responsibility to ensure that by following my advice you do not suffer or cause injury, damage or loss.
User avatar
pjr
 
Posts: 450
Joined: 05 May 2015, 10:27
Location: Slovenia

Re: Ability to run script from within KISS

Postby hacker » 02 May 2018, 11:07

pjr wrote:Is it possible to use the Settings/Printer/Firmware/Post-Process entry field for this?

Image1.png


Peter


It is. That's how I upload and print from kisslicer on the duet.
hacker
 
Posts: 137
Joined: 20 Aug 2016, 18:25

Re: Ability to run script from within KISS

Postby sinned6915 » 04 May 2018, 11:19

Thank you for showing me where this is.

How are you connecting and sending to the duet? What is the connection or protocol that you are using?
sinned6915
 
Posts: 42
Joined: 28 Nov 2017, 10:06

Re: Ability to run script from within KISS

Postby sinned6915 » 08 May 2018, 02:44

[quote="pjr"]Is it possible to use the Settings/Printer/Firmware/Post-Process entry field for this?

It IS possible! We should move this from Feature requests to Tips & Tricks! Here is my script using curl. I got some assistance in final debug from Julabeth on freenode reprap irc.

Code: Select all
ECHO ON
ECHO FILENAME %1

curl -k -H "X-Api-Key: *YOUR_OCTOPRINT_API_HERE*" -F "select=false" -F "print=false" -F "file=@""%1""" "http://192.168.*.*/api/files/local"

PAUSE


KISS-CURL.PNG
sinned6915
 
Posts: 42
Joined: 28 Nov 2017, 10:06

Re: Ability to run script from within KISS

Postby hacker » 08 May 2018, 15:49

sinned6915 wrote:Thank you for showing me where this is.

How are you connecting and sending to the duet? What is the connection or protocol that you are using?


The duet's protocol is described somewhere on the duet site or in the reprapfirmware's code, can't tell now, been a while, but it's basically

Code: Select all
curl --data-binary @"$inf" "${endpoint}rr_upload?name=$upf&time=$ft


where ft is file time:

Code: Select all
ft="$(TZ=UTC date -r "$inf" +%Y-%m-%dT%H:%M:%S)"


and potentially initiate printing:

Code: Select all
curl -s "${endpoint}rr_gcode?gcode=M32%20%22/${upf}%22"


Those are fragments of one shell script that is invoked with different parameters by applescript that presents dialog (like upload/print/nothing). Things are happening on mac, as you might have guessed. The recipe also applies to linux, not sure how exactly to deal with that on windows, but should be possible.
hacker
 
Posts: 137
Joined: 20 Aug 2016, 18:25

Re: Ability to run script from within KISS

Postby sinned6915 » 24 Jul 2018, 00:09

The syntax that works in KISS_2.0 seems to be -

YOUR_SCRIPT.BAT "<FILE>"

YOUR_SCRIPT.BAT contains-

Code: Select all
curl -k -H "X-Api-Key: **API_KEY**" -F "select=false" -F "print=false" -F file=@%1 "http://octoprint.local/api/files/local"
sinned6915
 
Posts: 42
Joined: 28 Nov 2017, 10:06


Return to Feature requests

Who is online

Users browsing this forum: No registered users and 2 guests

cron