Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Suppress gcode comments in gcode sent to machines. #444

Closed
gsrunion opened this issue Jan 11, 2024 · 9 comments
Closed

Comments

@gsrunion
Copy link

As per https://community.carbide3d.com/t/so5-pro-inline-comment-firmware-issue/64097 there is a bug in the firmware for the Shapeoko 5 Pro that causes the machine to choke on inline gcode comments.

While that ultimately needs to be fixed on their end, forwarding gcode comments to machines serves no purpose. I am proposing a change in gsender that strips out any gcode comments as gcode is being sent to the machine.

@kglovern
Copy link
Member

We'll take a look at this for the next couple of releases.

@gsrunion
Copy link
Author

Awesome. Thanks. JavaScript isn’t my strong suite by I may take a stab at putting up a PR.

@hamanjam
Copy link

I actually edited my post processor to add more comments such as file path and date saved If you have no use for comments, it may be easier to edit your post processor to strip them out if they cause issues with your controller. Parsing comments can be difficult. Is there a specific Shapeoko post processor that doesn't produce comments?

For the purpose of stripping before sending, you'd have to regex to stop anything between "(" and ")" which would be something similar to :

string.replace(/([^()]*)/g, '')

Similar thread with examples this solution was taken from:

https://stackoverflow.com/questions/640001/how-can-i-remove-text-within-parentheses-with-a-regex

@gsrunion
Copy link
Author

gsrunion commented Jan 16, 2024

From what I understand the probing routines on the GSender side insert inline comments as well.

return line.replace('M6', '(M6)');
here is at least one example. It would be easy enough to replace them in a gcode file. The post processors isn't something I have a choice in given C3D has moved to saving gcode internally to the their design file format.

@hamanjam
Copy link

Interesting to see in "check" mode that it changes the commands to comments (I'm assuming just to negate sending the actual command when in debug) I could see that being a problem. I can't see the benefit sending comments to the controller on a regular basis when grbl basically ignores comments and we would never really see them.

It sounds like your options are very limited to using propriety apps and file formats. Almost seems like it would be a lot of manual gcode editing to use anything outside their infrastructure. Learning curve and cost are the downsides but switching to something more "open" seems a bit easier but I totally understand wanting to use something that you're comfortable with. I looked at my Vectric post processor for Shapeoko and they only add their Vectric branding comments which would be easily removed. It's a shame you can't edit your pp in C3D. Hopefully you can get a workaround until the firmware is fixed (really surprised it's been around this long)

@gsrunion
Copy link
Author

gsrunion commented Jan 16, 2024 via email

@gsrunion
Copy link
Author

let bracketCommentLine = /\s*\(.*\)*\)/gm;

and

let bracketCommentLine = /\([^\)]*\)/gm;

Might be the regex I would be looking for and, perhaps, the right place to do this replacement.

@gsrunion
Copy link
Author

#448 I attempted the changes as per guidance found here. https://community.carbide3d.com/t/gsender-any-special-steps-to-use/72349/39

@kglovern
Copy link
Member

This should be merged and part of 1.4.1 release. Thanks everyone for the feedback/pull requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants