From 38886e987f720750f373fd3bfcb4a152b700351d Mon Sep 17 00:00:00 2001 From: SteWers Date: Fri, 7 Jan 2022 12:47:23 +0100 Subject: [PATCH] Resolve RTS-timing problem On some devices there is a timing problem with the RTS line, when not using flush. flush does wait until all data is send: https://www.arduino.cc/reference/en/language/functions/communication/serial/flush/ --- tasmota/xnrg_12_solaxX1.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/tasmota/xnrg_12_solaxX1.ino b/tasmota/xnrg_12_solaxX1.ino index 696b02757..534de4e47 100644 --- a/tasmota/xnrg_12_solaxX1.ino +++ b/tasmota/xnrg_12_solaxX1.ino @@ -162,6 +162,7 @@ void solaxX1_RS485Send(uint16_t msgLen) solaxX1Serial->write(message, msgLen); solaxX1Serial->write(highByte(crc)); solaxX1Serial->write(lowByte(crc)); + solaxX1Serial->flush(); if (PinUsed(GPIO_SOLAXX1_RTS)) { digitalWrite(Pin(GPIO_SOLAXX1_RTS), LOW); }