From 2b97b725bf50d33e45ace292b0f1c57bee376e66 Mon Sep 17 00:00:00 2001 From: dingo35 Date: Sun, 17 Nov 2024 12:05:08 -0500 Subject: [PATCH] main.cpp: fix slave not receiving modbus info --- SmartEVSE-3/src/main.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/SmartEVSE-3/src/main.cpp b/SmartEVSE-3/src/main.cpp index 5be364df..d5e12694 100644 --- a/SmartEVSE-3/src/main.cpp +++ b/SmartEVSE-3/src/main.cpp @@ -5333,12 +5333,6 @@ void setup() { } - firmwareUpdateTimer = random(FW_UPDATE_DELAY, 0xffff); - //firmwareUpdateTimer = random(FW_UPDATE_DELAY, 120); // DINGO TODO debug max 2 minutes - // Set eModbus LogLevel to 1, to suppress possible E5 errors - MBUlogLvl = LOG_LEVEL_CRITICAL; - ConfigureModbusMode(255); - CP_ON; // CP signal ACTIVE #else //SMARTEVSE_VERSION uint8_t writeValue; uint8_t readValue; @@ -5596,10 +5590,22 @@ void setup() { NULL // Task handle ); + WiFiSetup(); + +#if SMARTEVSE_VERSION == 3 + // Set eModbus LogLevel to 1, to suppress possible E5 errors + MBUlogLvl = LOG_LEVEL_CRITICAL; + ConfigureModbusMode(255); +#endif + BacklightTimer = BACKLIGHT; GLCD_init(); - WiFiSetup(); +#if SMARTEVSE_VERSION == 3 + CP_ON; // CP signal ACTIVE +#endif + + firmwareUpdateTimer = random(FW_UPDATE_DELAY, 0xffff); }