diff --git a/CHANGELOG.md b/CHANGELOG.md index eabc7b99..535e7b0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,8 @@ will actually get sent. * Additional baud rates to allow for connecting can now be specified along side additional serial ports via the settings dialog and the configuration file. +* Option to never send checksums (e.g. if the printer firmware doesn't support it), + see [#949](https://github.com/foosel/OctoPrint/issues/949). * Documentation improvements ### Bug Fixes diff --git a/src/octoprint/plugins/softwareupdate/scripts/update-octoprint.py b/src/octoprint/plugins/softwareupdate/scripts/update-octoprint.py index b12f1729..54df463c 100644 --- a/src/octoprint/plugins/softwareupdate/scripts/update-octoprint.py +++ b/src/octoprint/plugins/softwareupdate/scripts/update-octoprint.py @@ -93,7 +93,8 @@ def _git(args, cwd, verbose=False, git_executable=None): for c in commands: try: - return _execute([c] + args, cwd=cwd) + returncode, stdout, stderr = _execute([c] + args, cwd=cwd) + return returncode, "\n".join(stdout), "\n".join(stderr) except EnvironmentError: e = sys.exc_info()[1] if e.errno == errno.ENOENT: diff --git a/src/octoprint/server/api/settings.py b/src/octoprint/server/api/settings.py index 36650fd2..7c269b98 100644 --- a/src/octoprint/server/api/settings.py +++ b/src/octoprint/server/api/settings.py @@ -63,6 +63,7 @@ def getSettings(): "temperatureGraph": s.getBoolean(["feature", "temperatureGraph"]), "waitForStart": s.getBoolean(["feature", "waitForStartOnConnect"]), "alwaysSendChecksum": s.getBoolean(["feature", "alwaysSendChecksum"]), + "neverSendChecksum": s.getBoolean(["feature", "neverSendChecksum"]), "sdSupport": s.getBoolean(["feature", "sdSupport"]), "sdAlwaysAvailable": s.getBoolean(["feature", "sdAlwaysAvailable"]), "swallowOkAfterResend": s.getBoolean(["feature", "swallowOkAfterResend"]), @@ -215,6 +216,7 @@ def _saveSettings(data): if "temperatureGraph" in data["feature"].keys(): s.setBoolean(["feature", "temperatureGraph"], data["feature"]["temperatureGraph"]) if "waitForStart" in data["feature"].keys(): s.setBoolean(["feature", "waitForStartOnConnect"], data["feature"]["waitForStart"]) if "alwaysSendChecksum" in data["feature"].keys(): s.setBoolean(["feature", "alwaysSendChecksum"], data["feature"]["alwaysSendChecksum"]) + if "neverSendChecksum" in data["feature"].keys(): s.setBoolean(["feature", "neverSendChecksum"], data["feature"]["neverSendChecksum"]) if "sdSupport" in data["feature"].keys(): s.setBoolean(["feature", "sdSupport"], data["feature"]["sdSupport"]) if "sdAlwaysAvailable" in data["feature"].keys(): s.setBoolean(["feature", "sdAlwaysAvailable"], data["feature"]["sdAlwaysAvailable"]) if "swallowOkAfterResend" in data["feature"].keys(): s.setBoolean(["feature", "swallowOkAfterResend"], data["feature"]["swallowOkAfterResend"]) diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index 1bfd73f1..502b1056 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -147,6 +147,7 @@ default_settings = { "temperatureGraph": True, "waitForStartOnConnect": False, "alwaysSendChecksum": False, + "neverSendChecksum": False, "sendChecksumWithUnknownCommands": False, "unknownCommandsNeedAck": False, "sdSupport": True, diff --git a/src/octoprint/static/js/app/viewmodels/settings.js b/src/octoprint/static/js/app/viewmodels/settings.js index 9ac886e4..a176cca3 100644 --- a/src/octoprint/static/js/app/viewmodels/settings.js +++ b/src/octoprint/static/js/app/viewmodels/settings.js @@ -113,7 +113,7 @@ $(function() { self.feature_gcodeViewer = ko.observable(undefined); self.feature_temperatureGraph = ko.observable(undefined); self.feature_waitForStart = ko.observable(undefined); - self.feature_alwaysSendChecksum = ko.observable(undefined); + self.feature_sendChecksum = ko.observable("print"); self.feature_sdSupport = ko.observable(undefined); self.feature_sdAlwaysAvailable = ko.observable(undefined); self.feature_swallowOkAfterResend = ko.observable(undefined); @@ -530,7 +530,9 @@ $(function() { // some special read functions for various observables var specialMappings = { feature: { - externalHeatupDetection: function() { return !self.feature_disableExternalHeatupDetection() } + externalHeatupDetection: function() { return !self.feature_disableExternalHeatupDetection()}, + alwaysSendChecksum: function() { return self.feature_sendChecksum() == "always"}, + neverSendChecksum: function() { return self.feature_sendChecksum() == "never"} }, serial: { additionalPorts : function() { return commentableLinesToArray(self.serial_additionalPorts()) }, @@ -619,7 +621,9 @@ $(function() { } }, feature: { - externalHeatupDetection: function(value) { self.feature_disableExternalHeatupDetection(!value) } + externalHeatupDetection: function(value) { self.feature_disableExternalHeatupDetection(!value) }, + alwaysSendChecksum: function(value) { if (value) { self.feature_sendChecksum("always")}}, + neverSendChecksum: function(value) { if (value) { self.feature_sendChecksum("never")}} }, serial: { additionalPorts : function(value) { self.serial_additionalPorts(value.join("\n"))}, diff --git a/src/octoprint/templates/dialogs/settings/features.jinja2 b/src/octoprint/templates/dialogs/settings/features.jinja2 index 97a5864f..abb0c38a 100644 --- a/src/octoprint/templates/dialogs/settings/features.jinja2 +++ b/src/octoprint/templates/dialogs/settings/features.jinja2 @@ -41,13 +41,6 @@ -
-
- -
-
+
+ +
+ + + +
+
diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 0ed8a471..bb2230fc 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -240,6 +240,7 @@ class MachineCom(object): self._hello_command = settings().get(["serial", "helloCommand"]) self._alwaysSendChecksum = settings().getBoolean(["feature", "alwaysSendChecksum"]) + self._neverSendChecksum = settings().getBoolean(["feature", "neverSendChecksum"]) self._sendChecksumWithUnknownCommands = settings().getBoolean(["feature", "sendChecksumWithUnknownCommands"]) self._unknownCommandsNeedAck = settings().getBoolean(["feature", "unknownCommandsNeedAck"]) self._currentLine = 1 @@ -1618,7 +1619,7 @@ class MachineCom(object): # now comes the part where we increase line numbers and send stuff - no turning back now command_requiring_checksum = gcode is not None and gcode in self._checksum_requiring_commands command_allowing_checksum = gcode is not None or self._sendChecksumWithUnknownCommands - checksum_enabled = self.isPrinting() or self._alwaysSendChecksum + checksum_enabled = self._alwaysSendChecksum or (self.isPrinting() and not self._neverSendChecksum) if command_requiring_checksum or (command_allowing_checksum and checksum_enabled): self._doIncrementAndSendWithChecksum(command)