Skip to content

Commit

Permalink
Merge pull request #86 from benlye/master
Browse files Browse the repository at this point in the history
[lpc1768] Unmount SD card from host before reset
  • Loading branch information
benlye authored May 9, 2019
2 parents 0ce340a + 891e4c1 commit cbc46da
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions octoprint_firmwareupdater/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cbc46da

Please sign in to comment.