瀏覽代碼

Keeps things working, if RTS and DTR are wired

esptool.py (https://github.com/themadinventor/esptool.git) uses following connections
RTS = CH_PD (i.e reset)
DTR = GPIO0
Thomas Gfuellner 9 年之前
父節點
當前提交
b8231c0e48
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      nodemcu-uploader.py

+ 9 - 0
nodemcu-uploader.py

@@ -61,6 +61,15 @@ class Uploader:
 
     def __init__(self, port = 0, baud = BAUD):
         self._port = serial.Serial(port, Uploader.BAUD, timeout=Uploader.TIMEOUT)
+
+        # Keeps things working, if following conections are made:
+        ## RTS = CH_PD (i.e reset)
+        ## DTR = GPIO0
+        self._port.setRTS(False)
+        self._port.setDTR(False)
+        time.sleep(0.5)
+        self.dump()
+
         if baud != Uploader.BAUD:
             log.info('Changing communication to %s baud', baud)
             self._port.write('uart.setup(0,%s,8,0,1,1)\r\n' % baud)