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):
yellowshark 153
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 yellowsharkThanks! That's a great start.
For the python code that comes with the UM3, is it on one of the github repos?
Is there a description of the boot process (so I'd know where to hook in a web service)? Or should I poke around in /etc/services ?
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/
- 1 month later...
Hi again, thanks for all the help. I've dug through the files and figured out that the UM3 uses a python web app that uses FLASK to manage script/web/printer control. From that, it looks like adding services (FLASK hooks?) to the current web app is the best idea rather than simply sending gcode directly (although one web service could do that pretty easily by sending JSON ).
Now my question is, what's the best way to develop and test my own services? Obviously, it's hard to do this directly on the UM3 because I'd be worried about bricking it. Is there a suggested development system for this purpose? I noticed that there is a fake printer ('mock' in the griffin folder) that could be for testing?
I recommend you order the cable in my above link - it's not expensive - I think around 10 euros or $10. Then you don't have to be afraid of bricking the printer - the cable is a serial cable that connects to any computer and you have a terminal window directly into the linux machine and you can see it booting and when it's done booting you can log into root (password ultimaker) and do whatever you want. The "bricking" that can happen with bad json files still allows the computer to boot - it just blocks the ssh daemon and never tries to connect to the arduino computer.
However maybe @Daid can answer your question about flask hooks and the "mock" printer in the griffin folder. Please publish whatever you come up with on github and link to it here in this subject as many other people can use this kind of 3rd party improvement to the printer.
The mock printer hasn't been updated, and thus isn't current, and thus useless.
I highly recommend the cable so you can always debug/recover from a brick. Even if the risk is fairly low. The recovery by micro SD card also works to fix a brick.
Next to that, you can also run the whole system on a virtual machine, there is actually a software setting somewhere (I forgot where) that allows you to use the "marlin simulator" instead of talking to most of the main hardware. But setting that up is quite a bit of work.
- 1 month later...
Hi, thanks again for your help. This is slowly but surely taking form. Now my question is, how quickly (but still safely) can I send G Code movement updates to the UM3? If I wanted to do something like draw a complex curve by drawing lots of little connected lines while at the same time varying temperature, is that doable? Or are drawing and temperature changing commands blocking? And is there a way to get feedback from the controller as to what it's current state is?
If it's possible, it would be great to chat to one of the UM team about this! I think it might ultimately be pretty useful to you, too.
35 minutes ago, helical said:Hi, thanks again for your help. This is slowly but surely taking form. Now my question is, how quickly (but still safely) can I send G Code movement updates to the UM3? If I wanted to do something like draw a complex curve by drawing lots of little connected lines while at the same time varying temperature, is that doable? Or are drawing and temperature changing commands blocking? And is there a way to get feedback from the controller as to what it's current state is?
If it's possible, it would be great to chat to one of the UM team about this! I think it might ultimately be pretty useful to you, too.
I might have some DBUS commands that you can use when SSHing into the machine lying around somewhere. It's a bit of a hacked together interface and it comes with absolutely 0 warranty, but it should at least enable you to send raw g-code.
If you know you printer's IP address and it's in Developer mode:
ssh ultimaker@<printer_ip>
You get a special shell in which you can do a
sendgcode <your gcode comes here>
But as @nallath says: 0 warranty
Hi, I did see the dbus and sendcode scripts on the UM so I'm able to send G Code via ssh. What I'm more interested in is the limits of the G Code for the UM3, whether I can send a lot of movement commands over a short time safely, and whether there is a way to get back a response from the printer when it's finished moving. I can see on the list of G Code commands on the Sailfish website that some are blocking commands, like moving and printing at the same time, so I assume that there are limits to the amount of instructions that can be sent but I'd like to get a clearer idea what those limits look like. Thanks!
- 1
I think it's trial and error for now.
You can keep an eye out on http://<printer ip>/api/v1/debug/marlin/errors for buffer underruns which is an indication of marlin having an empty planner buffer.
Hmmm... that link didn't work for me, I get a 404.
Also, I've been trying to send G Code and the LED change code and movement code and home position codes work but not any temperature related ones. these seemt o do nothing:
On 4/27/2018 at 4:42 PM, helical said:M145 T0 ;enable tempM104 S200 ; set temp to 200C
this works fine as long as it's directly after eachother, for instance if you paste:
sendgcode M145 T0
sendgcode M104 S200
into the (cmd) shell
After a millisecond it is turned back off. Since the temp is 0 and the target is 0... I think this was done to avoid the hotend error uppo removal of the hotend as much as possible.
5 hours ago, robinmdh said:this works fine as long as it's directly after eachother, for instance if you paste:
sendgcode M145 T0
sendgcode M104 S200
into the (cmd) shell
After a millisecond it is turned back off. Since the temp is 0 and the target is 0... I think this was done to avoid the hotend error uppo removal of the hotend as much as possible.
Hi robinmdh,
I used the same method but the temperature didn't change at all. I'm not sure what you mean by "after a millisecond it is turned back off?"
I had the LCD showing the current nozzle temperature at the time, could that have something to do with it? Otherwise, how would I know what the current temperature is after executing a command?
If you issue just the M145 T0 command and then a quarter second later you issue the other command it will be too late. You need to issue both commands REALLY FAST together or the M145 will be reversed again. So robin recommends you do a cut and paste both in simultaneously.
53 minutes ago, gr5 said:cut and paste both in simultaneously.
indeed, including enter, I've tested this and it works but you can also set te temperature property.
in the debug shell you get by loggin in as ultimaker:
select printer printer/head/0/slot/0
set pre_tune_target_temperature 200
and since you asked to see the temperature you can also either enter the
list
command or the
get current_temperature
command to see the temperature instead of looking at the screen.
the same properties exist for the bed and both hotends, type select <tab><tab> to get an idea of how to set the properties of those sub-systems
Edited by robinmdh
- 1
- 2 weeks later...
That's great, I understand now. Thanks for the help!
- 11 months later...
Bump with thanks to @gr5 -- great info. Thinking about how my printer routinely drags the prime blob into the print (it looks like it tries to wipe the nozzle but the nozzle is still too hot) and wanted a repl to experiment with - this seems like it might be close enough.
You mentioned a web service, and I guess it'd be easy enough to flask something, but is there any real interest in poking at this kind of level by other people?
If so, maybe I'll look at making time to write a Jupyter kernel (https://github.com/jupyter/jupyter/wiki/Jupyter-kernels)
- 1 month later...
11On 2/8/2018 at 9:25 AM, gr5 said: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.
I tried to realize this by PHP or Python as the following code. But after running that py file, any command doesn't work. Do you have any idea about how to fix this? Thank you very much!
120 hours ago, sxj1121 said:I tried to realize this by PHP or Python as the following code. But after running that py file, any command doesn't work. Do you have any idea about how to fix this? Thank you very much!
<?phpset_include_path('C:/xampp/htdocs/phpseclib1.0.15');include('Net/SSH2.php');$ssh = new Net_SSH2('ip');if (!$ssh->login('root', 'ultimaker')) {exit('Login Failed');}echo $ssh->exec('python3 /usr/share/griffin/command_util.py && help');?>#import paramiko# realize transporttrans = paramiko.Transport(('ip', 22))# connectiontrans.connect(username='root', password='ultimaker')# Specify the transport of the sshclient object as the above transssh = paramiko.SSHClient()ssh._transport = trans# execute commandstdin, stdout, stderr = ssh.exec_command('python3 /usr/share/griffin/command_util.py \n sendgcode G28')print(stdout.read().decode())# close connectiontrans.close()
Just delete "&&" in PHP or "\n", then it would work.
Recommended Posts
gr5 2,265
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:
Link to post
Share on other sites