kurtnelle
Posts: 21
Joined: Mon Jan 15, 2018 4:38 pm

Re: Send GCode Directly to OctoPrint

rodrigomes wrote: Wed Jan 02, 2019 3:23 pm
kurtnelle wrote: Fri Jan 26, 2018 12:39 pm Is there any ability or feature request that currently exists, that will address the issue of being able to send directly to octo print or some other default file system (network or other wise) location?

Edit: Nvmd, I wrote code and solved my problem. Now I can Right click "Print via OctoPrint"
How did you do that, my friend? Could you share the code?
If I have time, I'll try to share it on GitHub... Stay Tooned.
Menissalt
Posts: 36
Joined: Fri Jul 03, 2015 5:39 am

Re: Send GCode Directly to OctoPrint

kurtnelle wrote: Wed Jan 02, 2019 5:25 pm If I have time, I'll try to share it on GitHub... Stay Tooned.
Following this
kurtnelle
Posts: 21
Joined: Mon Jan 15, 2018 4:38 pm

Re: Send GCode Directly to OctoPrint

@ Menissalt, noted.
Sour_Pickel
Posts: 2
Joined: Mon Jan 14, 2019 11:24 pm

Re: Send GCode Directly to OctoPrint

I know this topic has been going on for ages and some people will have already figured out how to do this. I just wanted to toss in how I do this without revealing my API Key in the gcode since the STRIP command does not work for me on Windows.

I make a bat and place it in C:\Windows\System32. It contains this(Change API Key, IP and Port):
@echo off
curl -k -H "X-Api-Key: APIKEYGOESHERE" -F "select=false" -F "print=false" -F "file=@%1" "http://IP:PORT/api/files/local"


Then in the S3D additional post processing I use this (S3D-FF-Upload.bat is my .bat file in System32):
S3D-FF-Upload.bat [output_filepath]
ESS-Cr10s-fan
Posts: 3
Joined: Mon Feb 04, 2019 3:01 pm

Re: Send GCode Directly to OctoPrint

This would be a nice feature.
jaymcd
Posts: 23
Joined: Wed Apr 26, 2017 12:05 pm

Re: Send GCode Directly to OctoPrint

Kurtnell - Did you get a chance to post your code - Many would love this feature!
kurtnelle
Posts: 21
Joined: Mon Jan 15, 2018 4:38 pm

Re: Send GCode Directly to OctoPrint

No I didn't. Actually, I like the aforementioned post processing command as a mono shot solution. I think I'll migrate to doing that; but with a powershell script.
kurtnelle
Posts: 21
Joined: Mon Jan 15, 2018 4:38 pm

Re: Send GCode Directly to OctoPrint

So, after some struggling, I managed to create this powershell script that will give users the option to send a .gcode file to octoprint
SendToOctoprint.ps1.txt
(4.77 KiB) Downloaded 391 times
Remove the .txt extension, add your octopi url/ip address and api key. Run it one to setup the registry stuff; it should be run as admin but it will prompt you. Then right click on any .gcode file and "Send to OctoPrint"
David_Quick
Posts: 3
Joined: Tue Feb 12, 2019 9:14 pm

Re: Send GCode Directly to OctoPrint

i have added

curl -k -H "X-Api-Key:<Mykey>" -F "select=false" -F "print=false" -F "file=@[output_filepath]" "https://octopi.local/api/files/local"
{STRIP "; postProcessing"}

to the Additional terminal commands.

When I copy disk the file dialog pops up. Is that normal?
Nothing appears on the octoprint screen.

Suggestions?

Running on El Capitan, that is the newest version this machine will run on.
Royce
Posts: 8
Joined: Wed Aug 23, 2017 5:33 am

Re: Send GCode Directly to OctoPrint

there's no need for a batch or powershell script.
simply put the curl command in the post action section and it will upload the gcode to Octo when hitting save gcode

Return to “Feature Requests”