diff --git a/Arduino/BTCDieselHeater/BTCDieselHeater.ino b/Arduino/BTCDieselHeater/BTCDieselHeater.ino index 1670bf9..336bceb 100644 --- a/Arduino/BTCDieselHeater/BTCDieselHeater.ino +++ b/Arduino/BTCDieselHeater/BTCDieselHeater.ino @@ -158,6 +158,7 @@ bool bHasOEMController = false; bool bHasHtrData = false; bool bReportBlueWireData = REPORT_RAW_DATA; bool bReportJSONData = REPORT_JSON_TRANSMIT; +bool bReportRecyleEvents = REPORT_BLUEWIRE_RECYCLES; CProtocolPackage HeaterData; @@ -375,23 +376,25 @@ void loop() if(RxTimeElapsed >= moderator) { moderator += 10; - DebugPort.print(RxTimeElapsed); - DebugPort.print("ms - "); + if(bReportRecyleEvents) { + DebugPort.print(RxTimeElapsed); + DebugPort.print("ms - "); + } if(CommState.is(CommStates::OEMCtrlRx)) { - DebugPort.println("Timeout collecting OEM controller data, returning to Idle State"); bHasOEMController = false; + if(bReportRecyleEvents) DebugPort.println("Timeout collecting OEM controller data, returning to Idle State"); } else if(CommState.is(CommStates::HeaterRx1)) { - DebugPort.println("Timeout collecting OEM heater response data, returning to Idle State"); bHasHtrData = false; + if(bReportRecyleEvents) DebugPort.println("Timeout collecting OEM heater response data, returning to Idle State"); } else { - DebugPort.println("Timeout collecting BTC heater response data, returning to Idle State"); bHasHtrData = false; + if(bReportRecyleEvents) DebugPort.println("Timeout collecting BTC heater response data, returning to Idle State"); } } - DebugPort.println("Recycling blue wire serial interface"); + if(bReportRecyleEvents) DebugPort.println("Recycling blue wire serial interface"); initBlueWireSerial(); CommState.set(CommStates::TemperatureRead); // revert to idle mode, after passing thru temperature mode } @@ -829,12 +832,13 @@ void checkDebugCommands() if(rxVal == ' ') { // SPACE to bring up menu DebugPort.print("\014"); DebugPort.println("MENU options"); - DebugPort.println("<+> - request heater turns ON"); - DebugPort.println("<-> - request heater turns OFF"); - DebugPort.println(" - toggle raw blue wire data reporting"); - DebugPort.println(" - toggle output JSON reporting"); - DebugPort.println(" - restart the ESP"); DebugPort.println(""); + DebugPort.print(" - toggle raw blue wire data reporting, currently "); DebugPort.println(bReportBlueWireData ? "ON" : "OFF"); + DebugPort.print(" - toggle output JSON reporting, currently "); DebugPort.println(bReportJSONData ? "ON" : "OFF"); + DebugPort.print(" - toggle reporting of blue wire recycling event, currently "); DebugPort.println(bReportRecyleEvents ? "ON" : "OFF"); + DebugPort.println(" <+> - request heater turns ON"); + DebugPort.println(" <-> - request heater turns OFF"); + DebugPort.println(" - restart the ESP"); DebugPort.println(""); DebugPort.println(""); DebugPort.println(""); @@ -869,12 +873,16 @@ void checkDebugCommands() } #endif else if(rxVal == 'b') { - DebugPort.println("Toggling raw blue wire data reporting"); bReportBlueWireData = !bReportBlueWireData; + DebugPort.print("Toggled raw blue wire data reporting "); DebugPort.println(bReportBlueWireData ? "ON" : "OFF"); } else if(rxVal == 'j') { - DebugPort.println("Toggling JSON data reporting"); bReportJSONData = !bReportJSONData; + DebugPort.print("Toggled JSON data reporting "); DebugPort.println(bReportJSONData ? "ON" : "OFF"); + } + else if(rxVal == 'w') { + bReportRecyleEvents = !bReportRecyleEvents; + DebugPort.print("Toggled blue wire recycling event reporting "); DebugPort.println(bReportRecyleEvents ? "ON" : "OFF"); } else if(rxVal == '+') { TxManage.queueOnRequest(); diff --git a/Arduino/BTCDieselHeater/src/cfg/BTCConfig.h b/Arduino/BTCDieselHeater/src/cfg/BTCConfig.h index d1174c6..d437068 100644 --- a/Arduino/BTCDieselHeater/src/cfg/BTCConfig.h +++ b/Arduino/BTCDieselHeater/src/cfg/BTCConfig.h @@ -56,6 +56,7 @@ #define TERMINATE_BTC_LINE 0 /* when an OEM controller does not exist */ #define REPORT_OEM_RESYNC 0 /* report idle time if OEM controller detected */ #define SHOW_STATE_MACHINE_TRANSITIONS 0 /* state machine changes reported to DebugPort */ +#define REPORT_BLUEWIRE_RECYCLES 1 /* best default on as this is abnormal behaviour can toggle using on debug console */ /////////////////////////////////////////////////////////////////////////////// // LED monitoring