diff --git a/connections/gvretserial.cpp b/connections/gvretserial.cpp index 5a1a211..9479a36 100644 --- a/connections/gvretserial.cpp +++ b/connections/gvretserial.cpp @@ -342,11 +342,14 @@ void GVRetSerial::connectDevice() serial->setBaudRate(115200); if (!serial->open(QIODevice::ReadWrite)) { - qDebug() << serial->errorString(); + //qDebug() << serial->errorString(); + } + else + { + serial->setDataTerminalReady(false); //ESP32 uses these for bootloader selection and reset so turn them off + serial->setRequestToSend(false); + QTimer::singleShot(3000, this, SLOT(tcpConnected())); //give ESP32 some time as it probably rebooted } - serial->setDataTerminalReady(false); //ESP32 uses these for bootloader selection and reset so turn them off - serial->setRequestToSend(false); - QTimer::singleShot(3000, this, SLOT(tcpConnected())); //give ESP32 some time as it probably rebooted } else { @@ -354,11 +357,14 @@ void GVRetSerial::connectDevice() serial->setBaudRate(1000000); if (!serial->open(QIODevice::ReadWrite)) { - qDebug() << serial->errorString(); + //qDebug() << serial->errorString(); + } + else + { + serial->setDataTerminalReady(true); //you do need to set these or the fan gets dirty + serial->setRequestToSend(true); + tcpConnected(); //well, not a proper function name I guess... } - serial->setDataTerminalReady(true); //you do need to set these or the fan gets dirty - serial->setRequestToSend(true); - tcpConnected(); //well, not a proper function name I guess... } } } @@ -511,9 +517,13 @@ void GVRetSerial::serialError(QSerialPort::SerialPortError err) killConnection = true; break; } - serial->clearError(); - serial->flush(); - serial->close(); + /* + if (serial) + { + serial->clearError(); + serial->flush(); + serial->close(); + }*/ if (errMessage.length() > 1) { qDebug() << errMessage;