-
Notifications
You must be signed in to change notification settings - Fork 542
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
Fix STATUSPAT and POSPAT for non-6-axes GRBL0 controllers #1525
Conversation
...by removing regex capture groups for the 4th, 5th and 6th fields
Hello, thanks for improvements... Have you tested this to work for 3-axis machines as well as the 6-axis? |
I have tested it with a 3-axis machine. I do not have a 6-axis machine to test against. However, for a line like:
The old code produces variables:
which I suspect are wrong. The new code produces:
in addition to working properly with 3-axes. (As has been reported, the old code does not produce variables at all with 3 axes.) This is because the old regex (last changed in the commit I mentioned) made the ma-mb-mc-wa-wb-wc numbers optional without changing the capture groups. Therefore, the groups 4-5-6 and 10-11-12 are optional (i.e. can be It might have been better to fix the code's assumption that wx/y/z lie at 4-5-6 (i.e. leave groups 4-5-6 optional and assign wx/y/z from 7-8-9) but that would have required more time, testing, and knowledge I did not have until I started writing this explanation. And other declared to use I'd be willing to do some of these other improvements as well, now that I know they are being considered. |
Ok, i've noticed there is another PR for the same issue. I've done quick diff between proposed POSPATs: Thank you |
I am sure as far as that I'm modifying variables used by GRBLv0.py and unused by GRBLv1.py.
I just wanted to test this board, which came with v0, before upgrading the firmware. That's when I noticed and quickly fixed the bug. As a matter of principle, I make proper commits out of my bug fixes and share them with the original project. You are right that using v0 is weird/obsolete. In fact, it's not worth any more of my time—and I've already spent way more than I was planning to. I am closing this request. |
:-D |
Now i see. It was actualy imported in GRBLv1, but not used. I will remove the import.
Sorry i was hesitant with merging, your work is certainly appreciated... Actualy there are still people reporting GRBLv0 bugs now and then. But i am kinda busy and regular expressions are not easy to code-review. Especialy when i don't have any GRBLv0 device to test it. Thank you. |
You are right and I defintiely appreciate the effort. I will try to find a way to keep or re-upload v0 firmware so I can go back and forth for better testing. Thank you, too. |
I've cleaned up the regex code a bit and in the moment of horror i realized that only the following regex is used in the GRBLv1: SPLITPAT = re.compile(r"[:,]") I have no idea how this is sufficient to properly parse everything... I thik i will have to review the GRBLv1 code later... |
VARPAT was commented out as not being used but in the generic routine it is used in line 248 |
@rschell Thank you. Good point :-) |
The optional, non-capturing groups introduced with 5abe8cb had capturing groups inside them, causing nulls to be captured, causing:
with <6-axis GRBL 0 controllers, e.g.:
This would in turn cause the program to be stuck at Status "Not connected" and not work at all.
Probably fixes #779