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

Grbl mega 5x compatibility #356

Open
Shkolik opened this issue Jan 23, 2024 · 2 comments
Open

Grbl mega 5x compatibility #356

Shkolik opened this issue Jan 23, 2024 · 2 comments

Comments

@Shkolik
Copy link

Shkolik commented Jan 23, 2024

Hello! Thank you for you work - using ioSender on my 3 axis cnc running teensy just fine. But now I playing with 5 axis foam cutter running latest GRBL Mega 5X and having issue right from connect. Looks like ioSender parse OPT incorrectly (also reproducible on my old 3 axis cnc running grbl 1.1h).
Controller sends OPT with value "VNMGL,35,255,64" and code try to parse 64 as NumAxes that obviously incorrect.

according to https://github.com/fra589/grbl-Mega-5X/wiki/grbl-Mega-5X-v1.2-interface

  • [OPT:] line follows immediately after and contains character codes for compile-time options that were either enabled or disabled.
    - The codes are defined below and a CSV file is also provided for quick parsing. This is generally only used for diagnosing firmware bugs or compatibility issues.
    - The value after the first comma contains the blockBufferSize, as int.
    - The value after the second comma contains the rxBufferSize, as int.
    - The value after the third comma contain the settings.flags, as int.

so there we should parse flags, not number of axis but flags. Not sure what to do next - have no exp with grbl protocol. For now I just replaced

if (s.Length > 3 && NumAxes != int.Parse(s[3], CultureInfo.InvariantCulture))

with

if (s.Length > 3 && int.TryParse(s[3], out int flags) && NumAxes != flags && flags < 10 && flags > 0)

to make it run, but I'm sure you know more elegant solution to this problem.

PS: Want to adapt ioSender as much as possible to FoamCutter mode, if you don't mind - digging trough code. If you interested in additional mode - let me know and I'll contribute as much as I can.

@terjeio
Copy link
Owner

terjeio commented Jan 23, 2024

The correct fix is:

if (s.Length > 3 && IsGrblHAL && NumAxes != int.Parse(s[3], CultureInfo.InvariantCulture))

since the third element is a grblHAL extension, and also an incompatible GRBL Mega 5X extension (compared to legacy Grbl). I'll add it to the next build.

If you fork the ioSender repo and commit updates to it I can see what you are changing and may provide input on how to best proceed.

@Shkolik
Copy link
Author

Shkolik commented Jan 23, 2024

Wow, didn't expect such a fast response :) Sure - will fork and do my work. Only thing - I already converted solution to .Net 4.8, but it should be a problem while it doesn't alter older C# syntax.
Found and fixed couple minor bugs in xaml and files handling so far - maybe my changes will be useful for you. Will commit couple hours later.

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

2 participants