diff --git a/AUTHORS.md b/AUTHORS.md index 4fb77ffb..a0860229 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -85,6 +85,7 @@ date of first contribution): * [Luke McKechnie](https://github.com/galamdring) * [Peter Backx](https://github.com/pbackx) * [Josh Major](https://github.com/astateofblank) + * ["alex-gh"](https://github.com/alex-gh) OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by [Daid Braam](https://github.com/daid). Parts of its communication layer and diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 394f9cc9..44a6605a 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -2472,8 +2472,8 @@ class MachineCom(object): def _do_send_with_checksum(self, command, linenumber): command_to_send = "N" + str(linenumber) + " " + command checksum = 0 - for c in command_to_send: - checksum ^= ord(c) + for c in bytearray(command_to_send): + checksum ^= c command_to_send = command_to_send + "*" + str(checksum) self._do_send_without_checksum(command_to_send)