Jump to content
Ultimaker Community of 3D Printing Experts

Ways to send gcode direct to printer or control during printing?

Recommended Posts

Hi, I've got a few Ultimakers (2's and 3's) and would like to directly control them from my computer.  That means moving the print head, extruding, controlling temperature, and all functions that can be described in gcode (and more?)  What I would like to do, ideally, is to bypass Cura completely and use a remote control protocol like OSC, or serial, or even JSON to have direct printing control.  But, as you can imagine, these would be time-sensitive commands so I'd require something reliable and quick.  Right now, I'm just looking for options.  I figured direct serial control would work but now I see that UM3's are running a full Linux stack so it's all a black box to me.  As far as I can tell, this hasn't been done before on Ultimakers, although similar things exist for Makerbots, etc.


And I'm well aware that there are serious risks of this, it's for a research project and I have experience with hardware and software development.  That said, I'd be an idiot if I said that I know what all of them are before starting, so any warnings and suggestions would be appreciated!



Share this post

Link to post
Share on other sites

Well the Um2 is simpler.  You can control it through USB (it's not officially supported but it works pretty well).  It has Marlin firmware which is on hundreds of different types of printers (most printers out there).  There is software called "octoprint" that allows you to control printers through USB or you can simply send gcodes with any software you want to write.


The um3 indeed has a linux stack.  You can log in with ssh username and password is root/ultimaker.  You have to put the printer into developer mode first (it's a menu option on the printer).


Everything is in python so the source code is all visible and commented on the printer itself.  Well some of it is in json files (javascript).


Once in you can go to the /usr/share/griffin folder and do this:

python3 command_util.py


Then do "sendgcode" followed by the gcode you want to send.  This might be too slow (not real time enough for you) so you might want to create some kind of web service.  If you do *please* share. :)


If you prefer - here is a video of someone doing just what I describe.  There are more details on this forum but you can ask more questions on this topic if you want.  For example the M104 and M109 commands might not work without enabling the hot end.  That gcode is um3 specific and is somewhere on this forum.  But here it is: M145 T0 -- enables ability to heat that core.


Oh and be very very careful when editing json files.  If you have a parse error in a json file (missing comma for example), the boot process halts *before* it starts the ssh daemon so you effectively brick the machine but I here are 2 methods for unbricking if that happens - you might want to buy these cables ahead of time if you will be editing json files:




Share this post

Link to post
Share on other sites

Oh and EVERYTHING can be done in gcode.  So there is no "and more".  I mean you can home, turn power on and off, control steps/mm, basically you can do much more from gcode than you can do from menus.  On um3 you can control color of lights from gcode.  On um2 you can change the display message form gcode.  For um2 the best gcode reference is here (just look at Marlin gcodes):


Share this post

Link to post
Share on other sites

You might want to look at Repetier-Host. RH lets you control - bed temp.; extruder(s) temp.; print speed; filament flow rate and flow %; fans speed; all during the print. You can also send individual lines of g-code to the printer (whether this works during a print I do not know). I have used it to control my prints on my 3ntr for the past 4 years. It has a server version too which allows you to control multiple printers and provides remote access/control. Cura and other slicers can be invoked.

It also provides velocity painting to change the look and feel of the object surface but I have not tried that yet, although the pics look good!


Edited by yellowshark

Share this post

Link to post
Share on other sites

poke around.  The code is not on github.  I think.  Not sure.  But it's in /usr/share/griffin I believe.  And subfolders.  Maybe tar that up into a tar zip file and scp it back to your main computer?


Or, you can just go to this page, download it and unzip it: http://software.ultimaker.com/jedi/releases/


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Terms of Use Privacy Policy