From da44ff3c024321e0fdfd4ad51dbe36d4ff941ca9 Mon Sep 17 00:00:00 2001 From: Jan ten Hove Date: Tue, 31 Mar 2020 19:56:36 +0200 Subject: [PATCH] SoftwareSerial fix for ESP boards > 2.4.2. Fixes #23 --- GoodWeCommunicator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GoodWeCommunicator.cpp b/GoodWeCommunicator.cpp index 25341b3..2527f46 100644 --- a/GoodWeCommunicator.cpp +++ b/GoodWeCommunicator.cpp @@ -11,9 +11,9 @@ void GoodWeCommunicator::start() { auto settings = settingsManager->GetSettings(); //create the software serial on the custom pins so we can use the hardware serial for debug comms. - goodweSerial = new SoftwareSerial(settings->RS485Rx, settings->RS485Tx, false, BufferSize); // (RX, TX. inverted, buffer) - //start the software serial - goodweSerial->begin(9600); //inverter fixed baud rate + goodweSerial = new SoftwareSerial(); // (RX, TX. inverted, buffer) + //start the software serial with the params (buffersize is larger than default, that's why we cant ue the constructor) + goodweSerial->begin(9600, SWSERIAL_8N1, settings->RS485Rx, settings->RS485Tx, false, BufferSize); //inverter fixed baud rate inverters.clear(); //set the fixed part of our buffer headerBuffer[0] = 0xAA;