Skip to content

Commit

Permalink
RTS/DTR for sending config (#100)
Browse files Browse the repository at this point in the history
A programming device with just RTS to reset and DTR to GPIO0 works with esptool but does not then work for sending config. This is because tasmotizer leaves RTS/DTR to QSerialPort which sets active (low) even when no flow control (default). By setting inactive (high) after opening the port, this therefore causes a clean reset in the same way as esptool does. The sleep allows time for tasmota to start and be ready to accept the config. Perhaps this could be based on the "self-resetting" option, or be a separate option in its own right. I believe it should work with devices like esptool does though.
  • Loading branch information
revk authored Jan 30, 2024
1 parent 737b8e0 commit cc9d34e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tasmotizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,9 @@ def send_config(self):
self.port = QSerialPort(self.cbxPort.currentData())
self.port.setBaudRate(115200)
self.port.open(QIODevice.ReadWrite)
self.port.setDataTerminalReady(0)
self.port.setRequestToSend(0)
sleep(.5)
bytes_sent = self.port.write(bytes(dlg.commands, 'utf8'))
except Exception as e:
QMessageBox.critical(self, 'Error', f'Port access error:\n{e}')
Expand Down

0 comments on commit cc9d34e

Please sign in to comment.