How does octoprint works?

i have a fairly simple question. how does octoprint handle the gcode files? does it read the file and sends one command at a time or does it send the whole file in one go?
from what i have been reading it is the first one.
and if it is the first one, on the installation it has been stated that there can be printing artefacts on some of the slower rpi's? how does this happen? is it because the pi cannot keep up with the printer?

does it read the file and sends one command at a time or does it send the whole file in one go?

OctoPrint can do both, but the former way is the most common and the most supported.

how does this happen?

This happens because the protocol between the printer and the host (OctoPrint in this case) is very inefficient, and the printer often has a resource-limited microcontroller.

The communication between the printer and OctoPrint is serial with a fixed baud rate. If the gcode file has lots of very small extrude commands (G0 / G1) then they can be completed by the printer faster than the serial connection can transfer them resulting in pauses in nozzle movement which can cause blobs and artifacts. Slower RPi models may also have trouble keeping the serial interface busy with the same results.

One source of very small extrude commands are curves on the object being printed. Ideally, your slicer would generate gcode with G2 / G3 commands but very few slicers are capable of this.

However, if your printer firmware (Marlin) supports G2 / G3 commands, then the Arc Welder plugin may help.

1 Like

Thank you for the information, this now makes sense.

Thank you for the information, but another quick question, is some of the features limited if you where to send the whole gcode file? For example I Don't think octolapse would work.

Correct. Any plugin that relies on sending the gcode line by line does not work if you first send the whole file to the printer internal storage and print from there. And by and large, that is most of them.

That’s very interesting, may I add another question. Because of the serial, line by line feed from octoprint to the printer, I guess some features like power panic, filament sensor signal or crash detection by the printer wouldn’t work, right? And if so, would they work if the file was transferred completely first? And if so, how can I change the communication mode? Or is the latter the download to the printers SD card?
Thanks in advance
Print on!

Why do you think these features would not work because of the line by line serial feed?

There is really only one data mode with OctoPrint and that is the transfer of GCode data line by line over a serial connection. The normal use of that data is to drive the stepper motors, heaters, etc. that make the printer print.

As an option, you can tell OctoPrint to redirect that serial stream to the printer's SD card but in most cases this is slower than sneaker-net, i.e. moving the SD card to your desktop, writing the file on it, and moving it back to the printer.

OctoPrint can also start printing a file from the printer's SD card and monitor the state of the printer to a certian degree, but most people don't use it this way.

Hi, b-morgan! Thanks for your reply.
I did have a issue, where the filament run out on my Prusa Mk3s, but the print (with Octoprint, of course) didn't stop. So i thought it's because Octoprint didn't stop sending printing commands to my printer, as it didn't recognize the output from the sensor. You asking makes me think if it might be that the sensor didn't work correct, as i sometimes have issues with it... Furthermore i saw plugins for Octoprint to make a filament runout sensor work, so i guessed i need such a plugin for the whole shebang to work. Am i wrong?

What you need to do is create a small test, a cube or something, enable OctoPrint's serial.log (<- link to instructions), and then print the file. While printing, cut the filament just before the sensor and then let things happen. When the smoke clears (JK), upload the serial log file here (add octoprint.log just for completeness) and then we can decide if you need a plugin and if so, which one (or a new one).