--- a/eric6/MicroPython/EspDevices.py Sat Dec 07 17:47:24 2019 +0100 +++ b/eric6/MicroPython/EspDevices.py Sun Dec 08 12:38:34 2019 +0100 @@ -11,7 +11,7 @@ import sys -from PyQt5.QtCore import pyqtSlot +from PyQt5.QtCore import pyqtSlot, QProcess from PyQt5.QtWidgets import QDialog from E5Gui import E5MessageBox @@ -352,10 +352,25 @@ """ Private slot to reset the connected device. """ - self.microPython.commandsInterface().execute([ - "import machine", - "machine.reset()", - ]) + if self.microPython.isConnected(): + self.microPython.commandsInterface().execute([ + "import machine", + "machine.reset()", + ]) + else: + # perform a reset via esptool using flash_id command ignoring + # the output + args = [ + "-u", + "-m", "esptool", + "--port", self.microPython.getCurrentPort(), + "flash_id" + ] + proc = QProcess() + proc.start(sys.executable, args) + procStarted = proc.waitForStarted(10000) + if procStarted: + proc.waitForFinished(10000) @pyqtSlot() def __installEspTool(self):