diff --git a/tasmota/support.ino b/tasmota/support.ino index fad51a83e..c13b2d502 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -1017,6 +1017,11 @@ void SetSerialBegin(void) { Serial.flush(); #ifdef ESP8266 Serial.begin(TasmotaGlobal.baudrate, (SerialConfig)pgm_read_byte(kTasmotaSerialConfig + Settings->serial_config)); + if (15==Pin(GPIO_TXD,0) && 13==Pin(GPIO_RXD,0)) { + Serial.flush(); + Serial.swap(); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_SERIAL "Serial pins swapped to alternate")); + } #endif // ESP8266 #ifdef ESP32 delay(10); // Allow time to cleanup queues - if not used hangs ESP32 diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 980f0b7bf..2dbb8f948 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -408,6 +408,14 @@ void setup(void) { BerryInit(); #endif // USE_BERRY +#ifdef ESP8266 + if (15==Pin(GPIO_TXD,0) && 13==Pin(GPIO_RXD,0)) { + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_SERIAL "Swapping Serial pins to alternate")); + Serial.flush(); + Serial.swap(); + } +#endif + XdrvCall(FUNC_PRE_INIT); XsnsCall(FUNC_PRE_INIT);