Send print jobs from remote computer with my own program to octoprint?

I want to build a system, where a user scans a QR-code and Octoprints starts printing the model, that is linked to the QR code. Maybe you have an idea how to implement this? The goal is to have a spare-part station where an operator can print any pre-defined spare parts, that he currently needs.

The spare-part station currently consists of two RPI 4 connected via ethernet and a touchscreen. One RPI runs octoprint and is connected to the printer, the other one runs Raspbian and is connected to a touchscreen and shows octoprints web interface. At the moment, the operator needs to manually select the correct file to be printed which can lead to errors.

In the future, multiple spare part stations are to be built and the operator can randomly choose a free station. My idea to implement this is the following:

Every station connects to a NAS, where all the g-code files are. Every g-code file has a unique name (like 53fe72ca_dust_cover.gcode). The operator scans a QR-code with a handheld scanner which is connected to the RPI with touchscreen. This PRI runs a python program that reads the information from the QR-code (like 53fe72ca) and selects the appropriate file from the NAS and sends that file to octoprint. The user then only confirms this job on the touchscreen and printing begins.

Do you have any better ideas? Does this already exist? I want to make it as fool-proof as possible and easy to maintain.

How can I send a g-code file from a remote computer to octoprint and have the file automatically selected for printing?

Take a look at the API for this. Should be fairly easy to do, imo.
Here's the docs for file operations,, including Uploading files

Dependent on the storage space required, things could be easier if the files on the NAS were synced to the OctoPrint somehow (watched folder I think?) then selecting for printing should be easy, through a simple API call to /api/files/<location>/<path> along with {'command': 'select'}. again, docs explain all of this.

Also, my UltimakerFormatPackage and PrusaSlicerThumbnails plugins could also help in having the user pick the right part from OctoPrint, because they can actually see the part.

Using a watched folder is a great idea, as the files don't have to be transferred unneccessarily!
I'l look into it!

Great idea about the pictures, I didn't know this plugin existed!
The plugin can definately help to avoid mistakes, but if there are thousands of parts in the catalog, relying on the pictures alone isn't going to work. But in addition the pictures are realy nice!

Is there any documentation, on how the pictures go into the gcode file? We want to use our own pictures instead of the slicer generated ones.

I just found out that files in the watched folder get deleted after they are transfered from watched to uploaded. So that won't work well with the NAS.

I will probably mount a NAS shared folder into the uploaded folder and manually refresh it if needed. I know that bypassing the upload mechanism can create problems like skipping of metadata processing, but that shouldn't be a problem I guess.

If you encode your own png file into base64 image and then embed it in the beginning of the gcode file the same way prusa slicer does then my plugin can extract it. Someone created a plugin to S3D that does that. I'll see if I can find that post.

1 Like

Found it, hopefully this helps.

1 Like