vitormhenrique / OctoPrint-Enclosure

OctoPrint Enclosure Plugin
GNU General Public License v3.0
397 stars 202 forks source link

5 second Lag between button press and actual movement of machine #426

Closed Ohmarinus closed 2 years ago

Ohmarinus commented 3 years ago

Describe the bug The plugin runs fine, but there is considerable lag (between 4 and 6 seconds) between pressing a button and the machine performing the gcode.

To Reproduce Steps to reproduce the behavior:

  1. I have the machine home with G28 and then move to a desired location on the print surface: X5 Y5
  2. I attach a tool to my machine and press 'resume' which triggers gcode: @resume
  3. The machine then performs a little action and pauses again
  4. Now I use a button to finetune the location of the tool. With each button press the machine performs:
    G91
    Y-0.01
    G90
  5. This takes 5 seconds between a button press and the movement

Finetuning my machine this way takes very long. I do not know what the issue is since I have the exact same setup running on my other machine without any input lag.

The lag also happens when using the web interface button

Expected behavior I expect the machine to act within milliseconds instead of 5 seconds

Additional context Machine 1 is SKR 1.3 + Raspberry Pi 3B Machine 2 is Ramps 1.4 + Raspberry 4B (this is the machine with lag) Both are updated to the latest version of Octoprint. The lag is not caused by Ramps 1.4 since the buffer is empty at the time of using the @pause and @resume commands.

Screenshot 2021-06-29 115602

Systeminfo bundle: octoprint-systeminfo-20210629105753.zip

Is there any way that I can investigate this issue further? I am not experienced with bugfinding in Octoprint plugins.

Thanks for your time and this super handy plugin! Marinus

Update I have found out that the issue only happens when there is an @pause and @resume command in the gcode that I sent with Enclosure. So, the example I'm giving above is not precise enough. However, I have two machines running the same exact setup. And this issue only happens on one of the machines.

vitormhenrique commented 2 years ago

I have no idea why the behaviour is different, the I'm guessing has something to do with octoprint, the enclosure just sends the command as soon as It gets triggered. There is not much i can do.