PDA

View Full Version : Linux CNC Fail to Load File



electrosteam
8th Jun 2020, 07:30 PM
I run Linux Lubuntu in the house and Debian Wheezy with LinuxCNC 2.7.14 in the workshop on a turret mill.
CAD is LibreCAD and CAM is CamBam.

I have done multiple jobs where I do the design in CAD, then generate the GCode, then load on the CNC.
No problems.

The latest job is my 'first paid job'.
A drawing by a friend that I got as a dxf.
Loaded into LibreCAD no problems, a few minor changes, then through the process.
But, LinuxCNC does not even recognize the file on the Debian machine.

Debian sees the file, and allows editing using a text editor.
What gives ?
Any suggestions ?

Don't you just love computers.
Keep well,
John

BaronJ
8th Jun 2020, 09:22 PM
Hi John,

I'm not sure what the problem could be ! However there has been a lot of updates for Debian based systems lately. Actually there were ten or more this morning. It might be worth checking that an update has not upset anything.

russ57
8th Jun 2020, 09:25 PM
Warning : I know nothing about libre cad or li uxcnc. But first thing I'd try is another file. Try to determine if it is linuxcnc not behaving, or the file itself.

Presumably librecad exported as whatever cnc format you wanted, correct extension etc? I don't think debian hides extensions like Windows likes to, but maybe there is an extra '.' Or something...

OxxAndBert
8th Jun 2020, 10:52 PM
When you say LinuxCNC doesn’t recognize the file do you mean it doesn’t see it at all or can’t open it?
Does it see other files in the same directory?
You haven’t still got it open in the text editor by chance?

Steve

electrosteam
9th Jun 2020, 09:40 AM
Thanks for the suggestions.

Debian is running on an isolated machine, so updates not possible.
But in addition, my Debian is several versions old and so not easily upgraded - but it works (normally !).
Planning to make a new system using a Raspberry Pi.

Debian File Manager sees the file and opens it as a text file, allows editing and saving.
LinuxCNC sees other similar files in that folder but does not show the subject file.

I currently use NCViewer on the net as the simulator running on Lubuntu, and it opens and correctly displays the required GCode.

One operational quirk I have to deal with is the file name.
Although Linux is blind to file type, LinuxCNC demands '.ngc' extension, whereas CamBam produces a '.nc' extension.
I always just change the extension when I transfer the GCode file between machines using a USB flashdrive.
(I know - LAN will occur sometime)

I believe there is some sort of header content in the dxf I received from my friend that offends LinuxCNC.
And my editing in LibreCAD does not remove the extra.
It is a simple drawing, so I plan to make a new drawing from scratch, copying the details by keyboard and mouse.

This issue prompts me to search for a Linux hexadecimal editor.
These tools proved quite useful back in the day of CP/M through to Windows XP, but not common since.

Keep well,
John.

caskwarrior
9th Jun 2020, 11:20 AM
Might pay to do an ls -lah in terminal in that directory, make sure the permissions and ownership are all the same?

Sent from my SM-G973F using Tapatalk

OxxAndBert
9th Jun 2020, 11:21 AM
The code file should be just plain text AFAIK, so any header in the original DXF shouldn’t be relevant.

Was your friends file produced on Windows by chance?
Wondering if it’s a case of the intermediate software seeing a windows format file and outputting the same in terms of line termination. Online viewers would probably handle it automatically.
Should be obvious if you open the guide file in a command line text editor like vi, but easy just to run a dos2unix on it which will sort it out.

Steve

caskwarrior
9th Jun 2020, 05:22 PM
Could also be a text encoding issue, utf8 vs ascii?

Sent from my SM-G973F using Tapatalk

BaronJ
9th Jun 2020, 05:28 PM
Hi caskwarrior,


Debian is running on an isolated machine, so updates not possible.
But in addition, my Debian is several versions old and so not easily upgraded - but it works (normally !).

Some of the older versions of Linux didn't like spaces in a file name ! Debian among others was one of them. If that's the case just rename the file.

Try "wxHexEditor" to edit your files, it will show any code hidden in a file !

electrosteam
10th Jun 2020, 11:47 AM
Thanks guys, I was aware of the line termination issue from years ago, but failed to recognize it as the cause this time.

Used vi, and found "CTRL M" as line terminators.
dos2unix was not installed on my Lubuntu box, checked several locations dealing with using it, and installed it.
Converted the original file successfully to remove the 'CTRL M', and LibreCAD opens it for editing.

Will revise the drawing with some changes, and try loading into the CNC later today.

Thanks for the reference to wxHexEditor.
My system has wxhexeditor available for installation, as well as several others that all sound useful.
But typical Linux, too many.
How do you choose ?

Keep well,
John.

OxxAndBert
10th Jun 2020, 02:45 PM
Good to hear you've got it sorted !

All my linux work is CLI stuff on servers (mostly Redhat/Centos base systems but some Ubuntu) so I can't help with recommending GUI applications, but in general I find it better to choose an app that works in a similar way to others I use.
I usually have a search online for "best (or top) tool for blah blah", pick the first couple and have a quick play.
Unless its something that I'm expecting to have a learning curve for - if it doesn't like its going to be easy to do what I want in the first couple of minutes I put it aside and try the next one.

Steve

BaronJ
10th Jun 2020, 07:07 PM
Thanks guys, I was aware of the line termination issue from years ago, but failed to recognize it as the cause this time.

Used vi, and found "CTRL M" as line terminators.
dos2unix was not installed on my Lubuntu box, checked several locations dealing with using it, and installed it.
Converted the original file successfully to remove the 'CTRL M', and LibreCAD opens it for editing.

Will revise the drawing with some changes, and try loading into the CNC later today.

Thanks for the reference to wxHexEditor.
My system has wxhexeditor available for installation, as well as several others that all sound useful.
But typical Linux, too many.
How do you choose ?

Keep well,
John.

Hi Guys,

I'm getting lazy nowadays, most of the command line stuff I've forgotten. Using "Trinity" desktop and graphical applications tends to cause this. Nowadays the menus have an item for dos to unix conversion !

As far as wxHexEditor is concerned, just try them all and see which one you like. I only use it occasionally because its already there. Anyway my days of editing code are long over...
Did I say I hate programming. :o