OctoprintKlipperPlugin
OctoprintKlipperPlugin copied to clipboard
Assisted Homing G-code is sent out of order
Sometimes the G-code commands are sent out of order. They should obviously be in the following order:
- Lift nozzle
- Move to new position
- Move nozzle down to calibration height
Usually this works, but sometimes the order of the three commands is mixed up as in the following annotated OctoPrint terminal dump:
# First calibration move: broken
Send: G1 X200 Y20 F1500
Recv: ok
Send: G1 Z8 F500
Recv: ok
Send: G1 Z3 F500
Recv: ok
Send: M105
Recv: ok T0:22.8 /0.0 B:21.3 /0.0
# Second calibration move: broken in a different way
Send: G1 Z8 F500
Recv: ok
Send: G1 Z3 F500
Recv: ok
Send: G1 X20 Y20 F1500
Recv: ok
Send: M105
Recv: ok T0:22.8 /0.0 B:21.2 /0.0
# Third calibration move: okay
Send: G1 Z8 F500
Recv: ok
Send: G1 X200 Y20 F1500
Send: G1 Z3 F500
Recv: ok
Recv: ok
Send: M105
Recv: ok T0:22.8 /0.0 B:21.3 /0.0
Wild idea: Maybe the 3 G-code commands are sent to OctoPrint using 3 different HTTP requests, which get reordered somewhere on the way -- either in JavaScript or by HAproxy or by the OctoPrint server. Is it possible to send all 3 commands using a single request?
Environment:
- octopi Version 0.14
- Octoprint Version 1.3.9 octoprint.log
@fritzw You are absolutely correct. This is a case of the commands being sent separately and occasionally being received out of order. I have modified the klipper_leveling.js so that the three Gcode commands are sent as an array of strings with one OctoPrintClient.control.sendGcode command instead of separately as individual strings with separate OctoPrintClient.control.sendGcode commands.
I've run dozens of repositioning commands and am no longer having this issue.
I've committed the changes.
any news on when this will be available to update to? I am having this issue on 0.2.5 version
So, I'm a complete novice to Github, commits, forks, merging, javascript, etc., so I actually did it wrong. I've since forked this repository, committed the change to the fork and submitted a pull request (this is the RIGHT way to do this).
Hopefully this makes it easy for @mmone to process this fix.
I've released this fix on a my repository and would be interested in feedback. It's available here: https://github.com/jameseleach/OctoprintKlipperPlugin/releases
I've released this fix on a my repository and would be interested in feedback. It's available here: https://github.com/jameseleach/OctoprintKlipperPlugin/releases
thanks will give it a whirl!
edit: works like a charm! Thanks