From 2d8d39f0108fd7fee85f632eac51cd5849039b49 Mon Sep 17 00:00:00 2001 From: Ben Lye Date: Thu, 9 May 2019 12:23:31 +0100 Subject: [PATCH 1/2] Update __init__.py Unmount the SD card from the host before resetting. --- octoprint_firmwareupdater/__init__.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/octoprint_firmwareupdater/__init__.py b/octoprint_firmwareupdater/__init__.py index e9b7a46..e677e22 100644 --- a/octoprint_firmwareupdater/__init__.py +++ b/octoprint_firmwareupdater/__init__.py @@ -510,6 +510,15 @@ def _flash_lpc1768(self, firmware=None, printer_port=None): if self._settings.get_boolean(["lpc1768_preflashreset"]): self._send_status("progress", subtype="boardreset") + + unmount_command = 'sudo umount ' + lpc1768_path + self._logger.info(u"Unmounting SD card: '{}'".format(unmount_command)) + try: + r = os.system(unmount_command) + except: + e = sys.exc_info()[0] + self._logger.error("Error executing unmount command '{}'".format(unmount_command)) + self._logger.info(u"Pre-flash reset: attempting to reset the board") if not self._reset_lpc1768(printer_port): self._logger.error(u"Reset failed") @@ -551,6 +560,14 @@ def _flash_lpc1768(self, firmware=None, printer_port=None): self._send_status("flasherror") return False + unmount_command = 'sudo umount ' + lpc1768_path + self._logger.info(u"Unmounting SD card: '{}'".format(unmount_command)) + try: + r = os.system(unmount_command) + except: + e = sys.exc_info()[0] + self._logger.error("Error executing unmount command '{}'".format(unmount_command)) + self._logger.info(u"Firmware update reset: attempting to reset the board") if not self._reset_lpc1768(printer_port): self._logger.error(u"Reset failed") From 891e4c1ab1388d633b1bbc460b7fa5045f305ef2 Mon Sep 17 00:00:00 2001 From: Ben Lye Date: Thu, 9 May 2019 12:24:27 +0100 Subject: [PATCH 2/2] Increment version to 1.3.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 23e4f7f..8058dad 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ plugin_name = "OctoPrint-FirmwareUpdater" # The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module -plugin_version = "1.3.0" +plugin_version = "1.3.1" # The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin # module