Using OctoPrint with an Ultimaker2 – Gcode

I’ve had my 3d Printer for some time now, considering the hotend sits at around 250 degrees Celsius I’m hesitant to leave the house while its printing. I had an extra RasPi laying around so I figured I would put it to good use.

A few things will be needed:

– RasPi with OctoPi image installed:

–  Compatible Wifi dongle if you dont have Ethernet within reach (Edimax_EW-7811Un is what I use)

– A powered usb hub, the RasPi only supports 100ma per port, we will need more power than that so a powered up is recommend for stable use.


Im not going to go into how to set it up from scratch in this post, Ill save that for a later time. Lets focus on the adjustments we need to make for OctoPrint to work with an Ultimaker. Considering you have an Ultimaker you are most likely using Cura, if you are using Cura you are most likely using Ultigcode which is a flavor of gcode. Unfortunately OctoPrint does not support Ultigcode, but it does support Marlin gcode. In Cura go to: Machine -> Machine Settings. Under GCode Flavor change this to “RepRap (Marlin/Sprinter). You will notice a handful of new options appear.

Under the “Basic” tab, change your Print Temp and Bed Temp to zero. I choose to set this within the start gcode rather than have Cura insert it. Set your filament diameter to 2.85 and flow to 100%. All other settings should have moved over automatically but it might be a good idea to double check.

You will notice that by default the printer doesnt really do what its supposed to do if you try a print right now. We basically need to alter what the slicer adds for start up and shut down, to fix this go to the “Start/End-GCode” Tab, you will see two files. Click “Start.gcode” and enter the following:

Next click on “end.gcode” and enter the following:

The code is commented to explain what each command does, i’ve done my best to duplicate exactly what Cura does with Ultigcode enabled. You can tune this to your liking as needed. Notice commands M190 and M109, this is where the hotend and bed temps are set.

In a future post I will talk about some of the tweaks I made, as well as streaming a live feed of your printer remotely.

Hope this helps!

2 comments… add one
  • Jack Minardi

    You should add a M106 S255 to turn on the fan near the end of the start.gcode

    • You could but I don’t use the fan for the first layer or two. That really should be added in your build code rather than startup, Cura will inject that startup command when building its gcode.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.