Jump to content
Ultimaker Community of 3D Printing Experts
JewelryMaker

sending an STL or GCODE directly to printer by command line

Recommended Posts

Thanks for the previous answers, but unfortunate not very helpful. I wasn't clear enough about my objective being to send a file to printer directly by command line. It is true that curaEngine can be run from the command line, however it only creates a gcode file from an stl file. Another drawback of curaEngine is that every single setting must be set on the command line. There is no ini or config file option for loading these settings. The config file in Cura is not related to these settings.

If I go back to running Cura.exe form command line, it launches the GUI. There is no documentation on how to use as a command line option, if it is even possible.

The goal is as follows:

(1) pass an stl file + config settings (ideally a file) to curaEngine to create a gcode file

(2) send the gcode to the printer.

If this can be managed through Cura.exe by suppressing the GUI it would be easier.

I don't think this should require coding my own solution. If it does I would need to find the firmware interface documentation. Perhaps I'm the only odd-ball who is trying send prints from another external program..?

Share this post


Link to post
Share on other sites
Another drawback of curaEngine is that every single setting must be set on the command line. There is no ini or config file option for loading these settings.

Not true. You can send it .ini files

If I go back to running Cura.exe form command line, it launches the GUI. There is no documentation on how to use as a command line option, if it is even possible.

That's because it's a GUI application, not a command line one ;)

Streaming g-code to the printer isn't that hard of a task. I'm pretty sure you can pipe the results from the engine into a serial connection (So a single bash script should do the trick).

Share this post


Link to post
Share on other sites

 

Another drawback of curaEngine is that every single setting must be set on the command line. There is no ini or config file option for loading these settings.

Not true. You can send it .ini files

 

Nallath, can you elaborate how to pass .ini files to the cura engine command line slicer? When looking at the help page (CuraEngine help), I don't see any option to pass a ini file.

If this is not possible to add the ini file, I wonder if it is possible to add the ini variables to the json file provided in the Cura/resources/machines/ directory.

Share this post


Link to post
Share on other sites

I am trying to better automate the build of various parts using CuraEngine directly. At the moment I do this by using cura:

 

cura \-i part1.ini \-o part1.gcode \-s part1.stl

 

I want to switch to using CuraEngine directly for automated builds since the needed command line options seem to be missing on the new Cura rewrite (Cura-2.1.2).

 

The .ini files are for a older version of the engine (the one used by 15.04).

 

So how exactly can I use the shipped version of CuraEngine with the ini files?

I can't seem to get it to work (cura 15.04.06; ubuntu 16.04).

 

/usr/share/cura/CuraEngine -c part1.ini -o part1.gcode part1.stl 

 

gives the following error:

 

 Default config 'default.cfg' not usedConfig(part1.ini): Line 1: No key value pair foundFailed to read config 'part1.ini'Failed to open part1.gcode for output.

 

Share this post


Link to post
Share on other sites

The errors are pretty clear. The contents of the .ini file isn't correct. It's also unable to open / create the .gcode file (probably due to rights)

 

Yeah I got that. The gcode file is created fine if I don't try to load an ini file.

Maybe I misunderstood you. From the post before:

 

The .ini files are for a older version of the engine (the one used by 15.04).

If you want to use the latest and greatest, you only have to provide the command line option with all settings that you want to change, or adjust the json files so that the defaults match the values that you need.

 

I took that to mean that the shipped version of CuraEngine is able to parse ini files directly.

If I misunderstood you:

- Is there a way to do translate the ini files to CuraEngine config files easily?

- Or are there plans to re-implement the missing command line functionality in Cura >2.1.2?

---------------------------------

BTW: My use case is that I first use and iterate in cura with the gui. But once I lock down the printer settings for a certain part I use a small script to render it in the future (even if there are slight changes in the stl), as I have various parts I print again and again, but many with somewhat different printer settings.

No Idea how common this scenario is, but it works great with version control.

Using Ultimaker 2; recently upgraded to 2+

Edited by Guest

Share this post


Link to post
Share on other sites

Hi,

We are using Cura-15.04.3. I need the command to convert a STL file to GCode file and send the request to the printer to print it.

Can you please let us know the command to convert a STL file to GCode file.

Kindly let us know the command to print a GCode file from the CMD prompt.

I don't find the .ini file inside my cura folder as well.

Thanks & Regards,

Debakanta

Share this post


Link to post
Share on other sites

Hi,

I have installed with Cura-15.04.3

I'm giving the command to slice a STL file to GCode file

The command is as below:

CuraEngine -s "C:\path\to\STL File\" -o "C:\path\to\test.gcode"

Though it is producing  a test.gcode file it is not the proper one.

Only heading porting is coming as contents in the .gcode file.

Please correct the command and let me know the proper one.

Thanks,

Debakanta

Edited by Guest

Share this post


Link to post
Share on other sites

Hi,

While running CuraEngine -s "C:\path\to\STL File\"  I'm getting the below output:-

This program is free software: you can redistribute it and/or modify

it under the terms of the GNU Affero General Public License as published by

the Free Software Foundation, either version 3 of the License, or

(at your option) any later version.

This program is distributed in the hope that it will be useful,

but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License

along with this program.  If not, see .

Default config 'default.cfg' not used

M107

G1 F2700 E-4.50000

G0 F9000 X0.00 Y0.00 Z5.00

M104 S0                     ;extruder heater off

M140 S0                     ;heated bed heater off (if you have it)

G91                            ;relative positioning

G1 E-1 F300                    ;retract the filament a bit before lifting the

nozzle, to release some of the pressure

G1 Z+0.5 E-5 X-20 Y-20 F9000   ;move Z up a bit and retract filament even more

G28 X0 Y0                      ;move X/Y to min endstops, so the head is out of

the way

M84                         ;steppers off

G90                         ;absolute positioning

Please let me know how can I get a correct gcode file

Thanks & Regards,

Debakanta

Edited by Guest

Share this post


Link to post
Share on other sites

Hi,

Usually I'm getting GNU Affero General Public Licence message and default.cfg file not found while running CuraEngine from CMD Command prompt. Kindly let me know how to overcome this issue.

Though the .gcode file is produced its contents are not expected and not similar to the gcode file produced using GUI.

Using the command as below;

CuraEngine -o C:\Path\to\the\file.gcode C:\Path\to\the\file.stl

The Cura Version I'm using is:

Cura-15.04.4

Please help me producing a correct gcode file.

Thanks & Regards,

Debakanta

Share this post


Link to post
Share on other sites

Hi,

Using Cura-15.04.3 and not able to see definitions/dual_extrusion_printer.def.json file.

Please let me know how do I set the environment variable in CMD Command prompt in windows. Where to feed the line CURA_ENGINE_SEARCH_PATH=/path/to/Cura/resources/definitions:/user/defined/path if definition folder is missing.

Do I need to buy a paid Cura software if I want to run it from command prompt.

Can I use GNU Affero General Public License additionally. If so then how?

Using CuraEngine -s "C:\path\to\STL File\" -o "C:\path\to\test.gcode" command and getting

Default Config 'default.cfg' not used message.

Thanks,

Debakanta

Share this post


Link to post
Share on other sites

Hi,

Now, I'm able to produce the .gcode file from .stl file but failing for other files like .obj and .amf etc.

Using the command as below;

CuraEngine -c .cura\15.04.3\preferences.ini -o C:\Path\to\the\file.gcode C:\Path\to\the\file.stl

The Cura Version I'm using is:

Cura-15.04.4

Please guide me how to produce .gcode from .obj and .amf files.

Thanks & Regards,

Debakanta

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

  • Our picks

    • Taking Advantage of DfAM
      This is a statement that’s often made about AM/3DP. I'll focus on the way DfAM can take advantage of some of the unique capabilities that AM and 3DP have to offer. I personally think that the use of AM/3DP for light-weighting is one of it’s most exciting possibilities and one that could play a key part in the sustainability of design and manufacturing in the future.
      • 3 replies
×

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!