From 8b70608e58f168ceeeae5cf92c26926ab8db0380 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 9 Jan 2023 13:53:07 +0100 Subject: [PATCH] Add more ESP32 logging --- tasmota/tasmota_xnrg_energy/xnrg_02_cse7766.ino | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasmota/tasmota_xnrg_energy/xnrg_02_cse7766.ino b/tasmota/tasmota_xnrg_energy/xnrg_02_cse7766.ino index 472f04cbc..5b34b7668 100644 --- a/tasmota/tasmota_xnrg_energy/xnrg_02_cse7766.ino +++ b/tasmota/tasmota_xnrg_energy/xnrg_02_cse7766.ino @@ -233,11 +233,15 @@ void CseSnsInit(void) { uint32_t option = GetPin(pin_rx) - AGPIO(GPIO_CSE7766_RX); uint32_t config = (1 == option) ? SERIAL_8N1 : SERIAL_8E1; if (CseSerial->begin(4800, config)) { + config = (1 == option) ? TS_SERIAL_8N1 : TS_SERIAL_8E1; if (CseSerial->hardwareSerial()) { - config = (1 == option) ? TS_SERIAL_8N1 : TS_SERIAL_8E1; SetSerial(4800, config); ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("NRG: Serial UART%d set to %s 4800 bit/s"), CseSerial->getUart(), GetSerialConfig(config).c_str()); +#endif + if (0 == Settings->param[P_CSE7766_INVALID_POWER]) { Settings->param[P_CSE7766_INVALID_POWER] = CSE_MAX_INVALID_POWER; // SetOption39 1..255 }