Generate manufacturing data from a terminal

Generate manufacturing data from a terminal

Anonymous
Not applicable
3,496 Views
16 Replies
Message 1 of 17

Generate manufacturing data from a terminal

Anonymous
Not applicable

Hi,

 

Is it possible to use the new CAM processor in 8.6 when running Eagle from a terminal?

 

Similarly to the -X option, I'd like to do something like this:

 

eagle -M path/to/custom-2-layer.cam output/path

So that external scripts can generate the outputs of the new processor (Gerber X2, DXF etc) automatically without opening Eagle.

 

Is there a way of doing this?

 

Thanks.

Reply
Reply
0 Likes
3,497 Views
16 Replies
Replies (16)
Message 2 of 17

ken.caluwaerts
Alumni
Alumni

Hi justynb,

 

Yes, we've created a pseudo device to run the new CAM processor without interfering with the legacy CAM processor.

 

  1. Running the new CAM processor from command line: Use the CAMJOB pseudodevice.
    ./eagle -X -dCAMJOB -j/path/to/mycamjob.cam -o/my/output/directory/ /path/to/my/brdfile.brd
    This will run the complete CAM job specified in mycamjob.cam at once.
    You can also -g instead of -j to pass a new CAM job configuration as a string on command line (instead of passing the path to CAM job file). 

  2. Running the legacy CAM processor from command line in EAGLE 8.6 and higher:
    Everything works as before and all legacy CAM devices are still available. No changes to the command line interface.


Ken Caluwaerts

Principal Engineer

Reply
Reply
Message 3 of 17

Anonymous
Not applicable

Hi Ken,

 

This is exactly what I was looking for, it looks like a well thought out solution.

 

Thanks!

Reply
Reply
0 Likes
Message 4 of 17

Anonymous
Not applicable

Hi Ken,

 

There seems to be a problem with using the CAM processor this way.

 

When the command is entered, it prints the following in a terminal and requires user input to proceed:

 

[Ok](o):

 

I have tried using the -N option, but this causes it to print:

 

Canceled (option '-N' was given).

 

Is there a way round this?

 

EDIT

It looks like despite the "Cancelled" output above, the CAM data is still generated when using the -N option.

Reply
Reply
0 Likes
Message 5 of 17

jorge_garcia
Autodesk
Autodesk
Hi @Anonymous,

I hope you're doing well. When it ask for user input type "o" to OK and continue. However it looks like we are not acting on the -N option properly. Thanks for the update. Let us know if there's anything else we can do for you.

Best Regards,


​Jorge Garcia
​Product Support Specialist for Fusion 360 and EAGLE

Kudos are much appreciated if the information I have shared is helpful to you and/or others.

Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.
Reply
Reply
0 Likes
Message 6 of 17

Anonymous
Not applicable

Hi Jorge,

 

Thanks, I was aware but this is being used from a script which is why it needs to proceed without user input.

 

There is another quirk. The CAM processor always tries to write a file called gerber_job.gbrjob in a directory called "outputs", no matter what is specified in the CAM file and with the -o option on the command line.

 

If the outputs directory doesn't exist, you get this error:

 

Cannot write Gerber Job output.

 

So in my CAM file I do not have any reference to an "outputs" dir, and I specify another directory with -o, yet I always get that error unless I create an "outputs" dir.

 

I presume this is a bug.

Reply
Reply
0 Likes
Message 7 of 17

MATTDU9PC
Participant
Participant

Ken,

 

This post seems exactly what I am looking for, except I couldn't get it to work. I am running version 9.1.0 on OS X. Here's what I have (using absolute paths) from the command line:

 

> /Applications/EAGLE-9.1.0/EAGLE.app/Contents/MacOS/eagle -X -N -dCAMJOB -j/Users/username/development/circuits/cam/4layer.cam -o/Users/username/development/circuits/projects/pname/ /Users/username/development/circuits/projects/pname/pname.brd

 

This call quietly exits the call, but no output is generated anywhere that I can find. Can you help me out?

 

Attached should be the JSON CAM file I am trying to run. 

 

Thanks,

Matt

Reply
Reply
0 Likes
Message 8 of 17

MATTDU9PC
Participant
Participant

Still working on this, but now get something from the output which gives me hope. Updated to v9.1.1 but still having issues. 

 

/Applications/EAGLE-9.1.1/EAGLE.app/Contents/MacOS/eagle -X -d CAMJOB -j /Users/username/development/circuits/projects/pname/../../cam/ -g 4layer.cam /Users/username/development/circuits/projects/pname/pname.brd

 

error while loading JSON: 

Error open file /Users/username/development/circuits/projects/pname/../../cam/

[Ok](o):

 

I've experimented with prefix paths on the "-g" argument, but this doesn't seem to change anything. 

 

Any suggestions please?

 

- Matt

Reply
Reply
0 Likes
Message 9 of 17

jorge_garcia
Autodesk
Autodesk

Hi @MATTDU9PC,

I hope you're doing well. I'm going to preface this by saying that this is an area our developers want to get into. Remove the extra spaces you have in your commandline entry. It should be -dCAMJOB not -d CAMJOB the same goes for the other tags.

I recommend that you follow the patterns in section 10.2 of the EAGLE manual for now. We'll be improving this shortly.

Let me know if there's anything else I can do for you.

Best Regards,



​Jorge Garcia
​Product Support Specialist for Fusion 360 and EAGLE

Kudos are much appreciated if the information I have shared is helpful to you and/or others.

Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.
Reply
Reply
0 Likes
Message 10 of 17

MATTDU9PC
Participant
Participant

I appreciate the response. The spaces (or lack of spaces) between the command arguments and the information do not produce any difference in output results. I share what I have in hopes I'm simply missing something here. 

 

I've entered:

 

> /Applications/EAGLE-9.1.1/EAGLE.app/Contents/MacOS/eagle 

-X -N -dCAMJOB -j/Users/username/development/circuits/projects/pname/../../cam/ -g4layer.cam /Users/username/development/circuits/projects/pname/pname.brd

 

> error while loading JSON: 

> Error open file /Users/username/development/circuits/projects/pname/../../cam/

> Canceled (option '-N' was given).

 

This seems like it has to be really close to working, but for some reason it's not picking up the JSON file to run. If we review the command line help of the eagle binary (eagle -?), then I see:

 

-dxxx  CAMJOB to run a JSON CAM job or a legacy device name (-d? for legacy DEVICE list)

-gxxx  Gerber X2 configuration (JSON)

-jxxx  path to Gerber X2 configuration file

 

My guess is that the CAM processor in this approach is supposed concatenate the '-j' and '-g' arguments together, but does not seem to be the case at all. Or one can't use '-g' and '-j' together. Or I'm just missing the boat. 

 

We use this for our internal production generation output and would really appreciate the help. This has worked fine with different a different command line approach that worked fine prior to v9.X, but we want to stay current with the latest releases of Eagle. I'm sure you would want that too. 

 

Not sure what you are getting at with regards to reviewing Section 10.2. I don't see anything in my question or command that is obvious and incorrect about what I have entered in my command from reviewing the manual. 

Reply
Reply
0 Likes
Message 11 of 17

jorge_garcia
Autodesk
Autodesk
Hey Matt,

You didn't specify an output directory with the -o directive at least none that I can see. Look at the second post of this thread. Chapter 10.2 covers the old style of CLI cam processing which is still valid.

Let me know if there's anything else I can do for you.

Best Regards,


​Jorge Garcia
​Product Support Specialist for Fusion 360 and EAGLE

Kudos are much appreciated if the information I have shared is helpful to you and/or others.

Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.
Reply
Reply
0 Likes
Message 12 of 17

MATTDU9PC
Participant
Participant

Jorge,

 

Thanks, I should of mentioned that I did try that earlier in my investigations without any difference in output. For the record, I have entered this:

 

$ /Applications/EAGLE-9.1.1/EAGLE.app/Contents/MacOS/eagle -X -N -dCAMJOB -j/Users/username/development/circuits/projects/pname/../../cam/ -g4layer.cam -o/Users/username/development/circuits/projects/pname /Users/username/development/circuits/projects/pname/pname.brd

 

error while loading JSON: 

Error open file /Users/username/development/circuits/projects/pname/../../cam/

Canceled (option '-N' was given).

 

What seems fishy to me is the error open file gives the right bit of pathing, but no matter what else I specify for other arguments, I can NOT get it to pick up the *.cam files I am point it to. I've even tried the JSON block as a string on the command line with no luck (ATTACHED as autodesk_support.txt) . 

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

 

As for using the older style of CAM operations, this is initially why I am wandering down the path of this forum topic. This approach is how we have been doing this for years. Now, as of version 9.1.1, we get the following with no generated output results:

 

> /Applications/EAGLE-9.1.1/EAGLE.app/Contents/MacOS/eagle -X -N -dGERBER_RS274X -oTop_Copper.gbr /Users/username/development/circuits/projects/pname/pname.brd 1 17 18

 

This 'older' command exits with no error only on versions 9.1.0, 9.1.1, but I can't find any output files generated. This 'older' command works fine with Eagle 7.7.0 up to Eagle 8.6.0. Eagle version 8.6.1 and up (until 9.0.1) gives a Segmentation fault: 11

 

I would much rather look forward than backwards on this subject.

 

- Matt

Reply
Reply
0 Likes
Message 13 of 17

jorge_garcia
Autodesk
Autodesk
Hi Matt,

I'm pinging our developers on this issue stay tuned.

Let me know if there's anything else I can do for you.

Best Regards,


​Jorge Garcia
​Product Support Specialist for Fusion 360 and EAGLE

Kudos are much appreciated if the information I have shared is helpful to you and/or others.

Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.
Reply
Reply
0 Likes
Message 14 of 17

Anonymous
Not applicable

Could someone help point me in the right direction for a step by step process on how to write the .scr / .ulp to run a cam job?  I only have two cam jobs that I ever use.  One is for a double sided board, and the other is for a single sided board.  I want to create one ulp that will differentiate between single sided and double sided (already have that part completed for a different ulp) and run the correct cam job.  We just switched to Eagle 9 and this is one of the big things I wanted from this.  I run about 20 cam processes a day minimum and it would be nice to automate it, not to mention less steps, so the other people on my team could also benefit.  Sorry to post this here, but I didn't want to post a brand new thread when this one looks like it has people who have been dealing with this.  By the way, I am using windows 10.  Not sure if that matters.  Thanks!

Reply
Reply
0 Likes
Message 15 of 17

jorge_garcia
Autodesk
Autodesk
Hi @Anonymous,

This thread has our developers running. The commandline version of EAGLE can be used to do these types of automations but this thread has revealed some bugs and other issues that need to be sorted and are being actively sorted as we speak.

For now I'm going to ask you stay tuned while we get this right.

Best Regards,


​Jorge Garcia
​Product Support Specialist for Fusion 360 and EAGLE

Kudos are much appreciated if the information I have shared is helpful to you and/or others.

Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.
Reply
Reply
0 Likes
Message 16 of 17

dderiso
Participant
Participant

Open your cam file in a text editor and set

"generate_job_file": false

and the error

Cannot write Gerber Job output.
[Ok](o): 

should go away. I'm guessing there's a bug somewhere. Running the command as a superuser didn't help (actually throws a QT error), so the write issue is not a permissions thing. 

For reference here's my full command:

/Applications/EAGLE-9.1.3/eagle.app/Contents/MacOS/eagle -X -dCAMJOB -jcam/my_job.cam -o/full/path/to/output/dir myproject.brd
Reply
Reply
Message 17 of 17

Anonymous
Not applicable

Thanks for sharing, people. After some frustration with Eagle's somewhat weird error messages I have also got this working with 9.4.2.

 

Autodesk folks — can we please get a better error message than the below ... in the situation where the specified CAM file doesn't exist?

 

error while loading JSON:
illegal value

 

Took me a while to realise my error there 😕

Reply
Reply
0 Likes