Fix GRBL network disconnect with MKS DLC32#274
Merged
Conversation
Disable client-side WebSocket ping/pong keepalive to prevent protocol errors with MKS DLC32 boards. The board's WebSocket server sends incorrectly masked responses after receiving a ping, causing the websockets library to close the connection every 20-30 seconds. This is safe because: - The server already sends its own pings - HTTP polling provides a secondary keepalive at 0.5s intervals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #273
ping_interval=Noneinwebsockets.connect()Problem
The MKS DLC32 board's WebSocket server sends incorrectly masked response frames. When the
websocketslibrary sends its default keepalive ping (every 20 seconds), the server's response triggers a protocol error:This causes the connection to drop every 20-30 seconds, making machine controls gray out until auto-reconnect completes.
Why this is safe
The client-side ping is redundant because:
< PING '' [0 bytes])Testing
GrblNetworkDriverintest_machine.py(no new tests needed for a one-line transport parameter change)