synman / Octoprint-Bettergrblsupport

Better Grbl Support Plugin for Octoprint based (loosely) on the original Grbl Support plugin developed by mic159
https://github.com/synman/Octoprint-Bettergrblsupport/wiki
64 stars 19 forks source link

a and b with origin_axis #110

Closed paukstelis closed 1 year ago

paukstelis commented 1 year ago

cleaned PR for a and b now in origin_axis

synman commented 1 year ago

made some observations. we probably want to keep {original} in there. I don't think octoprint cares what comes after the position update message it recognizes... this is may be why you're not seeing any errors when adding A and B. I'm on the fence atm on how to handle this.

paukstelis commented 1 year ago

the original message is retained in the response, but I have simply concatenated it after the rest of the response is generated: response = response+msg, which I think works OK. msg is just a string so this should work?

synman commented 1 year ago

the original message is retained in the response, but I have simply concatenated it after the rest of the response is generated: response = response+msg, which I think works OK. msg is just a string so this should work?

yeah, I think that would cover it.....

response = response + " " + msg

I'm still not sure if any of this even matters. octoprint is likely going to ignore A and B anyway. A way to test this would be to check the position update event and see what is coming in its payload. that's what this does behind the scenes.

synman commented 1 year ago

I have a couple free minutes so I can dabble:

2023-01-08 21:49:38,363 - octoprint.plugins.bettergrblsupport - DEBUG - event [PositionUpdate] payload [{'reason': None, 'z': 0.0, 'e': 0.0, 'f': None, 'y': -50.0, 'x': -50.0, 't': 0}] received but not subscribed - discarding

That's this code after I moved x -50 / y -50 after homing: https://github.com/synman/Octoprint-Bettergrblsupport/blob/41640fe3aa538133aec696e0789b85dee7b65586/octoprint_bettergrblsupport/_bgs.py#L594

See how octoprint emits z,x, y, e, f, and t? e is your extrusion rate, f is feedrate, and t is tool number. I'm going to dummy up this response to include A and B but my gut tells me Octoprint is going to ignore it.

And we don't have to worry about it getting lost because it is still included in {original}.

synman commented 1 year ago

Yeah, this isn't good.

response = 'X:{1} Y:{2} Z:{3} A:50 B:50 E:0 {original}'.format(*match.groups(), original=msg)

When I dummy up A and B, octoprint stops firing its PositionUpdate event.

paukstelis commented 1 year ago

OK. Makes sense. So remove the A and B modifications to the response. Unfortunately, it was part of a larger commit, so I can't roll that one back, so it will have to be a corrective commit.

I have also included A and B for the Home button function.