Connect to Octoprint from Cura

A
andin Getting started Level: 10 Points: 101
Posts: 1

Posted by
A
andin

Posted Apr 3, 2014 - 7:08 PM  

Hi,

OctoPrint allows wireless/LAN based control over the 3Dprinter. Cura is an STL-file processing/slicing software. However, as far as I understand Cura cannot communicate to OctoPrint.

I wonder if it will be possible in the near future to upload GCODE generated on Cura to the Octoprint server running on the RPi directly from the Cura's (amazing) GUI?

This would remove all the limitations of USB and enable WiFi printing directly from Cura - this would be truly awesome...

35 replies
 11917
Best replies 
Sort 
Daid Team Ultimaker Points: 6134
Posts: 4644
Posted by
Daid

Posted Apr 7, 2014 - 9:55 AM

Don't know if Octoprint provides an API. If it does, then this can be made.

It's already done for the Doodle3D wifibox, which allows printing trough wifi with Cura.

A
anon4321 Feel free to ask me Level: 37 Points: 1191
Posts: 925
Posted by
A
anon4321

Posted Apr 7, 2014 - 6:13 PM

Seems pretty straightforward. The only thing I think would be difficult is the discovery process.

https://github.com/foosel/OctoPrint/wiki/REST-API

Daid Team Ultimaker Points: 6134
Posts: 4644
Posted by
Daid

Posted Apr 8, 2014 - 11:04 AM

Keep in mind though that the API is still in the process of being fleshed out and thus things might change there until further notice!

That's a bit scary. There is also the "current" and "develment" api which are vastly different...

Still, would be possible to implement, with the doodle3d as example:

https://github.com/...n/doodle3dConnect.py

Discovery would be indeed an issue. But could be solved with:

http://en.wikipedia.org/...e_Discovery_Protocol

D
dubtec 3D printing enthusiast Level: 12 Points: 54
Posts: 44
Posted by
D
dubtec

Posted Apr 8, 2014 - 12:22 PM

Would be good, even if we could just upload via Cura.. i.e. save to sd, or upload to printer.

DidierKlein Moderator Points: 8676
Posts: 4963
Location: Harre, Belgium Printers: Ultimaker 2, Ultimaker Original, Ultimaker 2 Extended, Ultimaker 2 Go, Ultimaker 2+, Ultimaker 3
Posted by
DidierKlein

Posted Apr 8, 2014 - 1:20 PM

Isn't this already possible with octoprint? (I should test it tonight if i have time)

You can upload gcode directly via the web interface (even directly to the printer SD) from what i saw on the website

Daid Team Ultimaker Points: 6134
Posts: 4644
Posted by
Daid

Posted Apr 8, 2014 - 1:33 PM

Quote by Didier Klein

Isn't this already possible with octoprint? (I should test it tonight if i have time)

You can upload gcode directly via the web interface (even directly to the printer SD) from what i saw on the website

Yes, but the idea proposed here, is to have a button in Cura to upload&start the print, so you do not need to go to the webinterface.

DidierKlein Moderator Points: 8676
Posts: 4963
Location: Harre, Belgium Printers: Ultimaker 2, Ultimaker Original, Ultimaker 2 Extended, Ultimaker 2 Go, Ultimaker 2+, Ultimaker 3
Posted by
DidierKlein

Posted Apr 8, 2014 - 2:41 PM

We, geeks are really lazy ^^, but it's true you get used to the button to save directly to the sd card in cura so why not. Just one or two clicks more and this is done by the octoprint web interface ^^

S
scotthraban Level 1 - Starter Points: 1
Posts: 1
Posted by
S
scotthraban

Posted Feb 26, 2015 - 5:52 PM

I know this thread is a little old, but I found it in the process of determining that noone has created an integration of this sort.

So I made one, because while we geeks are lazy, we are quite willing to spend many hours coding something that will save us 30 seconds doing a repetative task (save gcode, upload, hit print)

https://github.com/...tion-plugin-for-cura

It won't work with the current Cura, as there are a couple of modifications that would need to be made to the Printer Connection and Plugin instantiation code, for which I have created pull requests.

If someone more familiar with Python UI would be willing to offer some help, that would be awesome, currently the plugin requires putting the OctoPrint API Key in the source code, which is, um, sub optimal.

Thanks!

ahoeben Feel free to ask me Level: 36 Points: 1081
Posts: 452
Location: Schiedam, Netherlands Printers: Ultimaker 2, Ultimaker Original
Posted by
ahoeben

Posted Mar 1, 2015 - 6:30 PM

Ooh, nice. I'm tempted to jump in and experiment, but I won't have time until april.

A
anon4321 Feel free to ask me Level: 37 Points: 1191
Posts: 925
Posted by
A
anon4321

Posted Mar 1, 2015 - 7:28 PM

There is also this one which I have tested and it works OK:

https://github.com/quillford/OctoUpload

I'm not sure if either is derived from the other.

A
aviphysics I know my way around here Level: 30 Points: 750
Posts: 581
Posted by
A
aviphysics

Posted Mar 6, 2015 - 7:54 PM

How about a program that scans a folder and automatically sends new gcode files to octoprint? Would run completely separate from Cura.

ahoeben Feel free to ask me Level: 36 Points: 1081
Posts: 452
Location: Schiedam, Netherlands Printers: Ultimaker 2, Ultimaker Original
Posted by
ahoeben

Posted Jun 26, 2015 - 12:25 PM

Quote by Daid
Keep in mind though that the API is still in the process of being fleshed out and thus things might change there until further notice!

That's a bit scary. There is also the "current" and "develment" api which are vastly different...

Now that Octoprint 1.2 has been released, there is one stable API.

O
Odolyte Level 1 - Starter Points: 2
Posts: 4
Posted by
O
Odolyte

Posted Jun 27, 2015 - 4:18 AM

Actually you can use the cura engine to slice your model directly on your raspberry pi running octoprint. You have to set the path to the cura engine and define a config setting in octoprint's parameters.

How to set the path to the cura engine in octoprint

You may find this usefull too : https://github.com/...iki/Cura-Integration

ahoeben Feel free to ask me Level: 36 Points: 1081
Posts: 452
Location: Schiedam, Netherlands Printers: Ultimaker 2, Ultimaker Original
Posted by
ahoeben

Posted Jun 29, 2015 - 3:31 PM

Quote by Odolyte

Actually you can use the cura engine to slice your model directly on your raspberry pi running octoprint.

In my opinion, slicing is better done on the desktop. More control over parameters, and lots more processing power.

I guess it is smarter to wait for Pink Unicorn to try doing a proper "Send to Octoprint" plugin in Cura.

A
Akex Level 1 - Starter Points: 21
Posts: 18
Posted by
A
Akex

Posted Jul 3, 2015 - 5:00 PM • Edited 5:13 PM

Hy all

If anyone want that i can share it on my git hub account

http://prntscr.com/7nv1hy

Alex

ahoeben Feel free to ask me Level: 36 Points: 1081
Posts: 452
Location: Schiedam, Netherlands Printers: Ultimaker 2, Ultimaker Original
Posted by
ahoeben

Posted Jul 3, 2015 - 6:35 PM

Alex, looks good! Yes, please...

A
Akex Level 1 - Starter Points: 21
Posts: 18
Posted by
A
Akex

Posted Jul 3, 2015 - 7:19 PM

Quote by ahoeben

Alex, looks good! Yes, please...

put that on cura file in C/programefileX86/cura15.04

https://1fichier.com/?wm777pesyi

ahoeben Feel free to ask me Level: 36 Points: 1081
Posts: 452
Location: Schiedam, Netherlands Printers: Ultimaker 2, Ultimaker Original
Posted by
ahoeben

Posted Jul 5, 2015 - 7:03 PM

Nice!

Creating the octo.gcode tempfile wasn't working for me, so I changed that bit by using the tempfile module to create a file in the temp folder (should work cross-platform). This file is then also cleanly disposed of after sending the file to OctoPrint.

http://f.fld.vu/temp/cura_octoprint_tempfile.patch

One issue is that this implementation locks up the UI thread, so the UI cannot show the progress.

M
mrjammiedodger Level 1 - Starter Points: 1
Posts: 1
Location: United Kingdom
Posted by
M
mrjammiedodger

Posted May 5, 2016 - 5:45 PM

Hey i know is in not fully what you wanted but it is close.

It is a cura plugin that once uploads it sends it to OctoPrint. I have been using it and it works well.

https://github.com/quillford/OctoUpload

ahoeben Feel free to ask me Level: 36 Points: 1081
Posts: 452
Location: Schiedam, Netherlands Printers: Ultimaker 2, Ultimaker Original
Posted by
ahoeben

Posted Sep 18, 2016 - 12:41 PM

For the sake of people finding this thread and wondering about the state of integrating OctoPrint into Cura 2.3 and newer, have a look at this plugin:

https://github.com/fieldofview/OctoPrintPlugin

It features ZeroConf/Bonjour enabled discovery, printing directly from Cura without having to store a gcode file, monitoring the progress, and even a view of the webcam, all nicely integrated into Cura.

M
ma_hda Level 1 - Starter Points: 0
Posts: 6
Location: Germany
Posted by
M
ma_hda

Posted Oct 21, 2016 - 3:38 PM

Quote by ahoeben

For the sake of people finding this thread and wondering about the state of integrating OctoPrint into Cura 2.3 and newer, have a look at this plugin:

https://github.com/fieldofview/OctoPrintPlugin

It features ZeroConf/Bonjour enabled discovery, printing directly from Cura without having to store a gcode file, monitoring the progress, and even a view of the webcam, all nicely integrated into Cura.

Nice plugin. I used it successfully in Cura 2.3 release connected to Octoprint and an Ultimaker 2+. Unfortunately, I had to add a new custom Printer with Ultimaker 2+ details to change machine settings to Marlin/RepRap g-code, because the standard printer profile for UM2+ doesn´t seem to allow changes of g-code flavor anymore. I tried to edit/copy json defintions file but failed. Any hint or idea?

DaHai8 I know my way around here Level: 30 Points: 772
Posts: 381
Location: China
Posted by
DaHai8

Posted Oct 22, 2016 - 5:21 AM

The only issue I found with this is that the Plugin streams video (if you have a camera attached to your Pi) even if you don't have that window open in Cura.

This really impacts (degrades) network performance with the megabytes of data flowing all the time.

Just an FYI.

ahoeben Feel free to ask me Level: 36 Points: 1081
Posts: 452
Location: Schiedam, Netherlands Printers: Ultimaker 2, Ultimaker Original
Posted by
ahoeben

Posted Oct 22, 2016 - 3:06 PM

Quote by DaHai8

The only issue I found with this is that the Plugin streams video (if you have a camera attached to your Pi) even if you don't have that window open in Cura.

Yeah, that's true. Same thing for the UM3 though (Fun fact: the UM3 uses the same software for streaming the camera image. Another fun fact: the OctoPrint plugin is a fork of the UM3NetworkPrinting plugin).

Streaming stops when you switch to another printer though.

This really impacts (degrades) network performance with the megabytes of data flowing all the time.

Serious question: is it really impacting network performance? I would say that (on an internal network), it should be hardly noticable; it's not *that* much data.

Unfortunately the plugin currently can't tell if you are looking at the monitor tab or not. I would rather not implement a hack in the OctoPrintPlugin for something that really needs to be fixed in Cura itself. As a quick fix I can add an option to not display the video stream (at all) when connecting to OctoPrint.

Note that I have code ready to display the streaming video instead of the current high-speed slide-show, but this issue is the reason I have not merged that yet.

ahoeben Feel free to ask me Level: 36 Points: 1081
Posts: 452
Location: Schiedam, Netherlands Printers: Ultimaker 2, Ultimaker Original
Posted by
ahoeben

Posted Oct 22, 2016 - 3:07 PM

Quote by ma_hda

I tried to edit/copy json defintions file but failed. Any hint or idea?

I have added some notes on UltiGCode to the readme of the plugin:

https://github.com/...lob/master/README.md

Let me know if that works for you.

DaHai8 I know my way around here Level: 30 Points: 772
Posts: 381
Location: China
Posted by
DaHai8

Posted Oct 22, 2016 - 4:24 PM • Edited 4:31 PM

Quote by ahoeben

Serious question: is it really impacting network performance? I would say that (on an internal network), it should be hardly noticable; it's not *that* much data.

For me, it did. While Cura was running and connected (via WiFi) to my OctoPi, it was streaming video at the Mbps level on my 802.11n network (2.4G). I use the RainMeter Windows 10 Widgets to monitor my PC's network, HD, CPU, etc. and saw my PC receiving that much data continuously.

I was streaming video (Internet TV) at the same time (on my tablet, not my PC) and it was constantly pausing and chopping until I exited Cura. The Network Receive rate on my PC dropped to 0 and my Internet TV stream flowed smoothly from then on.

I like the idea of a toggle switch to display, or not, the streaming video so I can turn it on/off whenever I need to.

Wouldn't the high-speed slide-show be less bandwidth efficient than video streaming? I mean, with a slide show there's probably no frame-to-frame compression going on, just single image compression. Just like when you take 1,000 frames of time-lapse photos that are Gigabytes in size (even with jpeg compression), after you generate an mp4 video from it, its only a few Megabytes do to the cross-frame compressions. So I'm thinking going from high-speed slide-show to video streaming would be even less of a bandwidth impact. I'm just guessing here, I'm by no means a bandwidth guru.

Thanks for the response. I liked the OctoPrint Plug in a lot and would love to be able to use it more.

35 replies
 11917
Best replies 
Sort 
Support