I'm trying to create a new version of flasher based on tasmotizer (https://github.com/tasmota/tasmotizer) and nodemcu-pyflasher (https://github.com/marcelstoer/nodemcu-pyflasher)
I've found one nice thing that I'd like to try first (I'm a beginner with Python)
I found this code that reads device IP via serial:
Code: Select all
class DeviceIP(QDialog):
def __init__(self, port: QSerialPort):
super(DeviceIP, self).__init__()
self.setWindowTitle('Device IP address')
self.setLayout(VLayout(10))
self.ip = QLineEdit()
self.ip.setAlignment(Qt.AlignCenter)
self.ip.setReadOnly(True)
self.ip.setText('xx.xx.xx.xx')
font = self.ip.font()
font.setPointSize(24)
self.ip.setFont(font)
btn = QDialogButtonBox(QDialogButtonBox.Close)
btn.rejected.connect(self.reject)
self.layout().addWidgets([self.ip, btn])
self.data = b''
self.port = port
self.re_ip = re.compile(r'(?:\()((?:[0-9]{1,3}\.){3}[0-9]{1,3})(?:\))')
try:
self.port.open(QIODevice.ReadWrite)
self.port.readyRead.connect(self.read)
self.port.write(bytes('IPAddress1\n', 'utf8'))
except Exception as e:
QMessageBox.critical(self, 'Error', f'Port access error:\n{e}')
def read(self):
try:
self.data += self.port.readAll()
match = self.re_ip.search(bytes(self.data).decode('utf8'))
if match:
self.ip.setText(match[1])
except:
pass
BTW can we flash ESP Easy via esptool (https://github.com/espressif/esptool) if yes can someone post or link an instruction?