From d5a4f8441bfc0b98d6b482b684cc542d5ed4969b Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Thu, 28 Dec 2023 17:25:01 +0100 Subject: [PATCH] Fix Berry claiming UART0 if needed (#20324) --- CHANGELOG.md | 2 ++ RELEASENOTES.md | 2 ++ tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino | 6 ++++++ tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino | 3 +++ tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino | 3 +++ tasmota/tasmota_xdrv_driver/xdrv_18_armtronix_dimmers.ino | 3 +++ tasmota/tasmota_xdrv_driver/xdrv_19_ps16dz_dimmer.ino | 3 +++ tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_9_serial.ino | 3 +++ tasmota/tasmota_xdrv_driver/xdrv_30_exs_dimmer.ino | 3 +++ tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino | 2 +- tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino | 3 +++ tasmota/tasmota_xdrv_driver/xdrv_45_shelly_dimmer.ino | 4 ++++ tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_serial.ino | 5 +++++ tasmota/tasmota_xdrv_driver/xdrv_53_projector_ctrl.ino | 3 +++ tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino | 3 +++ tasmota/tasmota_xdrv_driver/xdrv_65_tuyamcubr.ino | 4 ++++ tasmota/tasmota_xdrv_driver/xdrv_86_esp32_sonoff_spm.ino | 5 +++++ tasmota/tasmota_xnrg_energy/xnrg_02_cse7766.ino | 3 +++ tasmota/tasmota_xnrg_energy/xnrg_03_pzem004t.ino | 3 +++ tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino | 3 +++ tasmota/tasmota_xnrg_energy/xnrg_12_solaxX1.ino | 3 +++ tasmota/tasmota_xnrg_energy/xnrg_14_bl09xx.ino | 3 +++ tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino | 3 +++ tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_102_ld2410.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_105_lox_o2.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_107_gm861.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_113_hc8.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_15_mhz19.ino | 4 +++- tasmota/tasmota_xsns_sensor/xsns_18_pms5003.ino | 4 +++- tasmota/tasmota_xsns_sensor/xsns_20_novasds.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_22_sr04.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_23_me007.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_38_az7798.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_40_pn532.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_51_rdm6300.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_52_ibeacon.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_56_hpma.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_60_GPS.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_62_MI_HM10.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_64_hrxl.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_76_dyp.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_79_as608.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_86_tfminiplus.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_90_hrg15.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_91_vindriktning.ino | 3 +++ tasmota/tasmota_xsns_sensor/xsns_95_cm110x.ino | 3 +++ 47 files changed, 146 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 722216896..e726623d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. - NeoPool hydrolysis FL1 and Redox flag (#20258) - Matter support for password for remote Tasmota devices (#20296) - Display of active drivers using command ``status 4`` +- ESP32 used UART information ### Breaking Changed - Refactoring of Berry `animate` module for WS2812 Leds (#20236) @@ -24,6 +25,7 @@ All notable changes to this project will be documented in this file. - ESP32 piezo ceramic buzzer doesn't buzz (#20118) - Syslog server warning caused by lack of field and hostname starting with 'z' (#14689) - Support for Domoticz floor/room topics. Regression from v12.0.1 (#20299) +- Berry claiming UART0 if needed (#20324) ### Removed diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 1dfa0a653..9fe82cdde 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -122,6 +122,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - Support for Sonoff Basic R4 Magic Switch [#20247](https://github.com/arendst/Tasmota/issues/20247) - Display of active drivers using command ``status 4`` - NeoPool hydrolysis FL1 and Redox flag [#20258](https://github.com/arendst/Tasmota/issues/20258) +- ESP32 used UART information - Matter support for password for remote Tasmota devices [#20296](https://github.com/arendst/Tasmota/issues/20296) ### Breaking Changed @@ -135,6 +136,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - Syslog server warning caused by lack of field and hostname starting with 'z' [#14689](https://github.com/arendst/Tasmota/issues/14689) - Support for Domoticz floor/room topics. Regression from v12.0.1 [#20299](https://github.com/arendst/Tasmota/issues/20299) - ESP32 piezo ceramic buzzer doesn't buzz [#20118](https://github.com/arendst/Tasmota/issues/20118) +- Berry claiming UART0 if needed [#20324](https://github.com/arendst/Tasmota/issues/20324) - Matter Contact sensor was not triggering any update [#20232](https://github.com/arendst/Tasmota/issues/20232) ### Removed \ No newline at end of file diff --git a/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino b/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino index 82582b5c5..e4855ee2e 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_14_mp3.ino @@ -183,6 +183,12 @@ void MP3PlayerInit(void) // start serial communication fixed to 9600 baud if (MP3Player->begin(9600)) { +#ifdef ESP32 + if (MP3Player->hardwareSerial()) { + ClaimSerial(); // Disable console using uart0 + } + AddLog(LOG_LEVEL_DEBUG, PSTR("MP3: Serial UART%d"), MP3Player->getUart()); +#endif // ESP32 MP3Player->flush(); delay(1000); MP3_CMD(MP3_CMD_RESET, MP3_CMD_RESET_VALUE); // reset the player to defaults diff --git a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino index cb7184922..9e8e4d462 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v1.ino @@ -1248,6 +1248,9 @@ void TuyaInit(void) { TuyaSerial = new TasmotaSerial(Pin(GPIO_TUYA_RX), Pin(GPIO_TUYA_TX), 2); if (TuyaSerial->begin(baudrate)) { if (TuyaSerial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("TYA: Serial UART%d"), TuyaSerial->getUart()); +#endif // ESP32 // Get MCU Configuration Tuya.SuspendTopic = true; Tuya.ignore_topic_timeout = millis() + 1000; // suppress /STAT topic for 1000ms to avoid data overflow diff --git a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino index c9c0908e0..549e48be3 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_16_tuyamcu_v2.ino @@ -2032,6 +2032,9 @@ void TuyaInit(void) { TuyaSerial = new TasmotaSerial(Pin(GPIO_TUYA_RX), Pin(GPIO_TUYA_TX), 2); if (TuyaSerial->begin(baudrate)) { if (TuyaSerial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("TYA: Serial UART%d"), TuyaSerial->getUart()); +#endif // ESP32 // Get MCU Configuration pTuya->SuspendTopic = true; pTuya->ignore_topic_timeout = millis() + 1000; // suppress /STAT topic for 1000ms to avoid data overflow diff --git a/tasmota/tasmota_xdrv_driver/xdrv_18_armtronix_dimmers.ino b/tasmota/tasmota_xdrv_driver/xdrv_18_armtronix_dimmers.ino index c512fdc3c..e67a0e542 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_18_armtronix_dimmers.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_18_armtronix_dimmers.ino @@ -101,6 +101,9 @@ void ArmtronixInit(void) if (ArmtronixSerial->begin(115200)) { if (ArmtronixSerial->hardwareSerial()) { ClaimSerial(); } ArmtronixSerial->println("Status"); +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("ARM: Serial UART%d"), ArmtronixSerial->getUart()); +#endif // ESP32 } } diff --git a/tasmota/tasmota_xdrv_driver/xdrv_19_ps16dz_dimmer.ino b/tasmota/tasmota_xdrv_driver/xdrv_19_ps16dz_dimmer.ino index a7c513bd7..09d4715e9 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_19_ps16dz_dimmer.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_19_ps16dz_dimmer.ino @@ -190,6 +190,9 @@ void PS16DZInit(void) PS16DZSerial = new TasmotaSerial(Pin(GPIO_RXD), Pin(GPIO_TXD), 2); if (PS16DZSerial->begin(19200)) { if (PS16DZSerial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("PS1: Serial UART%d"), PS16DZSerial->getUart()); +#endif // ESP32 } } } diff --git a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_9_serial.ino b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_9_serial.ino index 05a049c8c..0f5249258 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_9_serial.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_9_serial.ino @@ -303,6 +303,9 @@ void ZigbeeInitSerial(void) if (ZigbeeSerial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_ZIGBEE "Serial UART%d"), ZigbeeSerial->getUart()); +#endif // ESP32 zigbee_buffer = new SBuffer(ZIGBEE_BUFFER_SIZE); zigbee.active = true; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_30_exs_dimmer.ino b/tasmota/tasmota_xdrv_driver/xdrv_30_exs_dimmer.ino index fed86a93d..6b80805c6 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_30_exs_dimmer.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_30_exs_dimmer.ino @@ -415,6 +415,9 @@ void ExsInit(void) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("EXS: Serial UART%d"), ExsSerial->getUart()); +#endif // ESP32 ExsSerial->flush(); EsxMcuStart(); ExsSendCmd(EXS_CH_LOCK, 0); diff --git a/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino index 55ada143a..fdd4a2ad3 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_41_tcp_bridge.ino @@ -156,7 +156,7 @@ void TCPInit(void) { ClaimSerial(); } #ifdef ESP32 - AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_TCP "using hardserial %d"), TCPSerial->getUart()); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_TCP "Serial UART%d"), TCPSerial->getUart()); #endif } else { AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_TCP "failed init serial")); diff --git a/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino b/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino index 5b9f19054..36baa3749 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino @@ -1084,6 +1084,9 @@ miel_hvac_pre_init(void) ClaimSerial(); SetSerial(baudrate, TS_SERIAL_8E1); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR(MIEL_HVAC_LOGNAME ": Serial UART%d"), sc->sc_serial->getUart()); +#endif sc->sc_device = TasmotaGlobal.devices_present; UpdateDevicesPresent(1); /* claim a POWER device slot */ diff --git a/tasmota/tasmota_xdrv_driver/xdrv_45_shelly_dimmer.ino b/tasmota/tasmota_xdrv_driver/xdrv_45_shelly_dimmer.ino index 2bd091488..560f2cfbe 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_45_shelly_dimmer.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_45_shelly_dimmer.ino @@ -664,6 +664,10 @@ void ShdInit(void) if (ShdSerial->hardwareSerial()) ClaimSerial(); +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR(SHD_LOGNAME "Serial UART%d"), ShdSerial->getUart()); +#endif + ShdSerial->flush(); ShdResetToAppMode(); diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_serial.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_serial.ino index 5f20c8a8a..2ffe1dab6 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_serial.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_serial.ino @@ -56,6 +56,11 @@ extern "C" { if (!ok) { delete ser; be_raise(vm, "internal_error", "Unable to start serial"); + } else { + if (ser->hardwareSerial()) { + ClaimSerial(); // Disable console using uart0 + } + AddLog(LOG_LEVEL_DEBUG, PSTR("BRY: Serial UART%d"), ser->getUart()); } be_pushcomptr(vm, (void*) ser); be_setmember(vm, 1, ".p"); diff --git a/tasmota/tasmota_xdrv_driver/xdrv_53_projector_ctrl.ino b/tasmota/tasmota_xdrv_driver/xdrv_53_projector_ctrl.ino index 801a1ab00..0a4224d30 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_53_projector_ctrl.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_53_projector_ctrl.ino @@ -122,6 +122,9 @@ projector_ctrl_pre_init(void) ClaimSerial(); SetSerial(baudrate, TS_SERIAL_8N1); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR(PROJECTOR_CTRL_LOGNAME ": Serial UART%d"), sc->sc_serial->getUart()); +#endif UpdateDevicesPresent(1); /* claim a POWER device slot */ sc->sc_device = TasmotaGlobal.devices_present; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino index c8f3fa109..ed82cd0ff 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_63_modbus_bridge.ino @@ -207,6 +207,9 @@ bool ModbusBridgeBegin(void) { if (2 == result) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("MBS: Serial UART%d"), modbusBridgeModbus->getUart()); +#endif AddLog(LOG_LEVEL_DEBUG, PSTR("MBS: MBR %s ser init at %d baud"), (2 == result ? "HW" : "SW"), Settings->modbus_sbaudrate * 300); if (nullptr == modbusBridge.buffer) { diff --git a/tasmota/tasmota_xdrv_driver/xdrv_65_tuyamcubr.ino b/tasmota/tasmota_xdrv_driver/xdrv_65_tuyamcubr.ino index caa1cefd3..150930dab 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_65_tuyamcubr.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_65_tuyamcubr.ino @@ -996,6 +996,10 @@ tuyamcubr_pre_init(void) if (sc->sc_serial->hardwareSerial()) ClaimSerial(); +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR(TUYAMCUBR_LOGNAME ": Serial UART%d"), sc->sc_serial->getUart()); +#endif + /* commit */ tuyamcubr_sc = sc; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_86_esp32_sonoff_spm.ino b/tasmota/tasmota_xdrv_driver/xdrv_86_esp32_sonoff_spm.ino index 882407f21..e9319da56 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_86_esp32_sonoff_spm.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_86_esp32_sonoff_spm.ino @@ -1917,6 +1917,11 @@ void SSPMInit(void) { return; } + if (SspmSerial->hardwareSerial()) { + ClaimSerial(); + } + AddLog(LOG_LEVEL_DEBUG, PSTR("SPM: Serial UART%d"), SspmSerial->getUart()); + Xdrv86SettingsLoad(0); pinMode(SSPM_GPIO_ARM_RESET, OUTPUT); diff --git a/tasmota/tasmota_xnrg_energy/xnrg_02_cse7766.ino b/tasmota/tasmota_xnrg_energy/xnrg_02_cse7766.ino index 9ca4c5ce8..6e33897dd 100644 --- a/tasmota/tasmota_xnrg_energy/xnrg_02_cse7766.ino +++ b/tasmota/tasmota_xnrg_energy/xnrg_02_cse7766.ino @@ -232,6 +232,9 @@ void CseSnsInit(void) { SetSerial(4800, TS_SERIAL_8E1); ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("CSE: Serial UART%d"), CseSerial->getUart()); +#endif if (0 == Settings->param[P_CSE7766_INVALID_POWER]) { Settings->param[P_CSE7766_INVALID_POWER] = CSE_MAX_INVALID_POWER; // SetOption39 1..255 } diff --git a/tasmota/tasmota_xnrg_energy/xnrg_03_pzem004t.ino b/tasmota/tasmota_xnrg_energy/xnrg_03_pzem004t.ino index a965dbb6d..a275483c5 100644 --- a/tasmota/tasmota_xnrg_energy/xnrg_03_pzem004t.ino +++ b/tasmota/tasmota_xnrg_energy/xnrg_03_pzem004t.ino @@ -246,6 +246,9 @@ void PzemSnsInit(void) if (PzemSerial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("PZM: Serial UART%d"), PzemSerial->getUart()); +#endif Energy->phase_count = ENERGY_MAX_PHASES; // Start off with three phases Pzem.phase = 0; Pzem.read_state = 1; diff --git a/tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino b/tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino index 9cd8c4a52..1c4695b4d 100644 --- a/tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino +++ b/tasmota/tasmota_xnrg_energy/xnrg_04_mcp39f501.ino @@ -572,6 +572,9 @@ void McpSnsInit(void) } else { mcp_buffer = (char*)(malloc(MCP_BUFFER_SIZE)); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("MCP: Serial UART%d"), McpSerial->getUart()); +#endif DigitalWrite(GPIO_MCP39F5_RST, 0, 1); // MCP enable Energy->use_overtemp = true; // Use global temperature for overtemp detection } else { diff --git a/tasmota/tasmota_xnrg_energy/xnrg_12_solaxX1.ino b/tasmota/tasmota_xnrg_energy/xnrg_12_solaxX1.ino index a087295b9..5945cf1f6 100644 --- a/tasmota/tasmota_xnrg_energy/xnrg_12_solaxX1.ino +++ b/tasmota/tasmota_xnrg_energy/xnrg_12_solaxX1.ino @@ -470,6 +470,9 @@ void solaxX1_SnsInit(void) solaxX1Serial = new TasmotaSerial(Pin(GPIO_SOLAXX1_RX), Pin(GPIO_SOLAXX1_TX), 1); if (solaxX1Serial->begin(SOLAXX1_SPEED)) { if (solaxX1Serial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("SX1: Serial UART%d"), solaxX1Serial->getUart()); +#endif } else { TasmotaGlobal.energy_driver = ENERGY_NONE; } diff --git a/tasmota/tasmota_xnrg_energy/xnrg_14_bl09xx.ino b/tasmota/tasmota_xnrg_energy/xnrg_14_bl09xx.ino index 343210e71..af1f0f6fc 100644 --- a/tasmota/tasmota_xnrg_energy/xnrg_14_bl09xx.ino +++ b/tasmota/tasmota_xnrg_energy/xnrg_14_bl09xx.ino @@ -307,6 +307,9 @@ void Bl09XXInit(void) { if (Bl09XXSerial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("BL9: Serial UART%d"), Bl09XXSerial->getUart()); +#endif if (HLW_UREF_PULSE == EnergyGetCalibration(ENERGY_VOLTAGE_CALIBRATION)) { for (uint32_t i = 0; i < 2; i++) { EnergySetCalibration(ENERGY_POWER_CALIBRATION, bl09xx_pref[Bl09XX.model], i); diff --git a/tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino b/tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino index b176065df..09a454201 100644 --- a/tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino +++ b/tasmota/tasmota_xnrg_energy/xnrg_19_cse7761.ino @@ -583,6 +583,9 @@ void Cse7761SnsInit(void) { SetSerial(38400, TS_SERIAL_8E1); ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("C61: Serial UART%d"), Cse7761Serial->getUart()); +#endif #ifdef CSE7761_FREQUENCY #ifdef CSE7761_ZEROCROSS diff --git a/tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino b/tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino index 6df796461..b0b5d442a 100644 --- a/tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino +++ b/tasmota/tasmota_xnrg_energy/xnrg_22_bl6523.ino @@ -238,6 +238,9 @@ void Bl6523Init(void) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("BL6: Serial UART%d and UART%d"), Bl6523RxSerial->getUart(), Bl6523TxSerial->getUart()); +#endif Bl6523.type = 1; Energy->phase_count = 1; AddLog(LOG_LEVEL_DEBUG, PSTR("BL6:Init Success" )); diff --git a/tasmota/tasmota_xsns_sensor/xsns_102_ld2410.ino b/tasmota/tasmota_xsns_sensor/xsns_102_ld2410.ino index b21a9b03a..3914179cd 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_102_ld2410.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_102_ld2410.ino @@ -407,6 +407,9 @@ void Ld2410Detect(void) { LD2410Serial = new TasmotaSerial(Pin(GPIO_LD2410_RX), Pin(GPIO_LD2410_TX), 2); if (LD2410Serial->begin(256000)) { if (LD2410Serial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("LD2: Serial UART%d"), LD2410Serial->getUart()); +#endif LD2410.retry = 4; LD2410.step = 12; diff --git a/tasmota/tasmota_xsns_sensor/xsns_105_lox_o2.ino b/tasmota/tasmota_xsns_sensor/xsns_105_lox_o2.ino index a644e964f..f006498b5 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_105_lox_o2.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_105_lox_o2.ino @@ -65,6 +65,9 @@ void LOXInit() if (LOXSerial->hardwareSerial()) ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("LOX: Serial UART%d"), LOXSerial->getUart()); +#endif } } diff --git a/tasmota/tasmota_xsns_sensor/xsns_107_gm861.ino b/tasmota/tasmota_xsns_sensor/xsns_107_gm861.ino index c54019c09..6d79911ac 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_107_gm861.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_107_gm861.ino @@ -265,6 +265,9 @@ void Gm861Init(void) { if (Gm861Serial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("GM8: Serial UART%d"), Gm861Serial->getUart()); +#endif Gm861->barcode[0] = '0'; // No barcode yet Gm861->state = GM861_STATE_INIT_OFFSET; } diff --git a/tasmota/tasmota_xsns_sensor/xsns_113_hc8.ino b/tasmota/tasmota_xsns_sensor/xsns_113_hc8.ino index 79845e837..bc1abae22 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_113_hc8.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_113_hc8.ino @@ -86,6 +86,9 @@ void Hc8Init(void) Hc8Serial = new TasmotaSerial(Pin(GPIO_HC8_RXD), -1, 1); if (Hc8Serial->begin(9600)) { if (Hc8Serial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("HC8: Serial UART%d"), Hc8Serial->getUart()); +#endif Hc8Initialized = true; } } diff --git a/tasmota/tasmota_xsns_sensor/xsns_15_mhz19.ino b/tasmota/tasmota_xsns_sensor/xsns_15_mhz19.ino index 3d89ff470..e1c21fffc 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_15_mhz19.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_15_mhz19.ino @@ -329,9 +329,11 @@ void MhzInit(void) MhzSerial = new TasmotaSerial(Pin(GPIO_MHZ_RXD), Pin(GPIO_MHZ_TXD), 1); if (MhzSerial->begin(9600)) { if (MhzSerial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("MHZ: Serial UART%d"), MhzSerial->getUart()); +#endif mhz_type = 1; } - } } diff --git a/tasmota/tasmota_xsns_sensor/xsns_18_pms5003.ino b/tasmota/tasmota_xsns_sensor/xsns_18_pms5003.ino index 426b6e286..a5f9e0ced 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_18_pms5003.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_18_pms5003.ino @@ -332,6 +332,9 @@ void PmsInit(void) { PmsSerial = new TasmotaSerial(Pin(GPIO_PMS5003_RX), (PinUsed(GPIO_PMS5003_TX)) ? Pin(GPIO_PMS5003_TX) : -1, 1); if (PmsSerial->begin(9600)) { if (PmsSerial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("PMS: Serial UART%d"), PmsSerial->getUart()); +#endif if (!PinUsed(GPIO_PMS5003_TX)) { // setting interval not supported if TX pin not connected Settings->pms_wake_interval = 0; @@ -345,7 +348,6 @@ void PmsInit(void) { Pms.time = Settings->pms_wake_interval - WARMUP_PERIOD; // Let it wake up in the next second } } - Pms.type = 1; } } diff --git a/tasmota/tasmota_xsns_sensor/xsns_20_novasds.ino b/tasmota/tasmota_xsns_sensor/xsns_20_novasds.ino index 20f6d8e30..417aa699d 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_20_novasds.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_20_novasds.ino @@ -208,6 +208,9 @@ void NovaSdsInit(void) if (NovaSdsSerial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("SDS: Serial UART%d"), NovaSdsSerial->getUart()); +#endif novasds_type = 1; NovaSdsSetWorkPeriod(); } diff --git a/tasmota/tasmota_xsns_sensor/xsns_22_sr04.ino b/tasmota/tasmota_xsns_sensor/xsns_22_sr04.ino index 4a4e28e17..21bd425da 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_22_sr04.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_22_sr04.ino @@ -146,6 +146,9 @@ void Sr04TModeDetect(void) { if (sonar_serial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("SR4: Serial UART%d"), sonar_serial->getUart()); +#endif } } diff --git a/tasmota/tasmota_xsns_sensor/xsns_23_me007.ino b/tasmota/tasmota_xsns_sensor/xsns_23_me007.ino index ebef6edd3..1332d7ae9 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_23_me007.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_23_me007.ino @@ -211,6 +211,9 @@ void me007_init( void ) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR(ME007_DEBUG_MSG_TAG "Serial UART%d"), gp_serial_if->getUart()); +#endif pinMode( me007_data_s.pin_trig_u8, OUTPUT ); /**< @details Configure trigger pin as output */ digitalWrite( me007_data_s.pin_trig_u8, HIGH ); /**< @details Set trigger pin to high-level as it ME007 requires a falling edge to initiate measurement */ diff --git a/tasmota/tasmota_xsns_sensor/xsns_38_az7798.ino b/tasmota/tasmota_xsns_sensor/xsns_38_az7798.ino index 1869ed76f..b456f8dd2 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_38_az7798.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_38_az7798.ino @@ -271,6 +271,9 @@ void AzInit(void) AzSerial = new TasmotaSerial(Pin(GPIO_AZ_RXD), Pin(GPIO_AZ_TXD), 1); if (AzSerial->begin(9600)) { if (AzSerial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("AZ7: Serial UART%d"), AzSerial->getUart()); +#endif az_type = 1; } } diff --git a/tasmota/tasmota_xsns_sensor/xsns_40_pn532.ino b/tasmota/tasmota_xsns_sensor/xsns_40_pn532.ino index dee669dd5..716178358 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_40_pn532.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_40_pn532.ino @@ -97,6 +97,9 @@ void PN532_Init(void) { PN532_Serial = new TasmotaSerial(Pin(GPIO_PN532_RXD), Pin(GPIO_PN532_TXD), 1); if (PN532_Serial->begin(115200)) { if (PN532_Serial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("NFC: Serial UART%d"), PN532_Serial->getUart()); +#endif PN532_wakeup(); uint32_t ver = PN532_getFirmwareVersion(); if (ver) { diff --git a/tasmota/tasmota_xsns_sensor/xsns_51_rdm6300.ino b/tasmota/tasmota_xsns_sensor/xsns_51_rdm6300.ino index 5a929524d..c4ca3a7ca 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_51_rdm6300.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_51_rdm6300.ino @@ -70,6 +70,9 @@ void RDM6300Init() { if (RDM6300Serial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("RDM: Serial UART%d"), RDM6300Serial->getUart()); +#endif } } } diff --git a/tasmota/tasmota_xsns_sensor/xsns_52_ibeacon.ino b/tasmota/tasmota_xsns_sensor/xsns_52_ibeacon.ino index 411e82e21..96420a010 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_52_ibeacon.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_52_ibeacon.ino @@ -326,6 +326,9 @@ void IBEACON_Init() { if (IBEACON_Serial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("BLE: Serial UART%d"), IBEACON_Serial->getUart()); +#endif hm17_sendcmd(HM17_TEST); hm17_lastms=millis(); // in case of using Settings this has to be moved diff --git a/tasmota/tasmota_xsns_sensor/xsns_56_hpma.ino b/tasmota/tasmota_xsns_sensor/xsns_56_hpma.ino index a318150d7..358b8febd 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_56_hpma.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_56_hpma.ino @@ -71,6 +71,9 @@ void HpmaInit(void) if (HpmaSerial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("HPM: Serial UART%d"), HpmaSerial->getUart()); +#endif hpma_type = 1; hpma115S0->Init(); hpma115S0->StartParticleMeasurement(); diff --git a/tasmota/tasmota_xsns_sensor/xsns_60_GPS.ino b/tasmota/tasmota_xsns_sensor/xsns_60_GPS.ino index fc53bd920..d37e4cf0c 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_60_GPS.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_60_GPS.ino @@ -383,6 +383,9 @@ void UBXDetect(void) ClaimSerial(); DEBUG_SENSOR_LOG(PSTR("UBX: claim HW")); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("UBX: Serial UART%d"), UBXSerial->getUart()); +#endif } } else { diff --git a/tasmota/tasmota_xsns_sensor/xsns_62_MI_HM10.ino b/tasmota/tasmota_xsns_sensor/xsns_62_MI_HM10.ino index b9334cf96..80609ff73 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_62_MI_HM10.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_62_MI_HM10.ino @@ -698,6 +698,9 @@ void HM10SerialInit(void) { ClaimSerial(); DEBUG_SENSOR_LOG(PSTR("%s: claim HW"),D_CMND_HM10); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("HM1: Serial UART%d"), HM10Serial->getUart()); +#endif HM10_Reset(); HM10.mode.pending_task = 1; HM10.mode.init = 1; diff --git a/tasmota/tasmota_xsns_sensor/xsns_64_hrxl.ino b/tasmota/tasmota_xsns_sensor/xsns_64_hrxl.ino index 727778fe1..22c40487a 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_64_hrxl.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_64_hrxl.ino @@ -43,6 +43,9 @@ void HRXLInit(void) { if (HRXLSerial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("HRX: Serial UART%d"), HRXLSerial->getUart()); +#endif HRXLSerial->setTimeout(HRXL_READ_TIMEOUT); } } diff --git a/tasmota/tasmota_xsns_sensor/xsns_76_dyp.ino b/tasmota/tasmota_xsns_sensor/xsns_76_dyp.ino index 9aa3ecaa2..203de7b56 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_76_dyp.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_76_dyp.ino @@ -52,6 +52,9 @@ void DYPInit(void) { if (DYPSerial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("DYP: Serial UART%d"), DYPSerial->getUart()); +#endif } } } diff --git a/tasmota/tasmota_xsns_sensor/xsns_79_as608.ino b/tasmota/tasmota_xsns_sensor/xsns_79_as608.ino index b2059a90d..7850ecb0c 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_79_as608.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_79_as608.ino @@ -116,6 +116,9 @@ void As608Init(void) { As608Finger->begin(57600); if (As608Serial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("AS6: Serial UART%d"), As608Serial->getUart()); +#endif if (As608Finger->verifyPassword()) { As608Finger->getTemplateCount(); diff --git a/tasmota/tasmota_xsns_sensor/xsns_86_tfminiplus.ino b/tasmota/tasmota_xsns_sensor/xsns_86_tfminiplus.ino index 02cce9e27..ebfcdd551 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_86_tfminiplus.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_86_tfminiplus.ino @@ -97,6 +97,9 @@ void TfmpInit(void) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("TFM: Serial UART%d"), TfmpSerial->getUart()); +#endif tfminiplus_sensor.ready = true; TfmpSerial->flush(); } diff --git a/tasmota/tasmota_xsns_sensor/xsns_90_hrg15.ino b/tasmota/tasmota_xsns_sensor/xsns_90_hrg15.ino index c83d92238..0f2f45244 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_90_hrg15.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_90_hrg15.ino @@ -159,6 +159,9 @@ void Rg15Init(void) { if (HydreonSerial) { if (HydreonSerial->begin(RG15_BAUDRATE)) { if (HydreonSerial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("HRG: Serial UART%d"), HydreonSerial->getUart()); +#endif Rg15.init_step = 5; // Perform RG-15 init } } diff --git a/tasmota/tasmota_xsns_sensor/xsns_91_vindriktning.ino b/tasmota/tasmota_xsns_sensor/xsns_91_vindriktning.ino index 2f866bf9c..f98605294 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_91_vindriktning.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_91_vindriktning.ino @@ -114,6 +114,9 @@ void VindriktningInit(void) { VindriktningSerial = new TasmotaSerial(Pin(GPIO_VINDRIKTNING_RX), -1, 1); if (VindriktningSerial->begin(9600)) { if (VindriktningSerial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("VDN: Serial UART%d"), VindriktningSerial->getUart()); +#endif Vindriktning.type = 1; } } diff --git a/tasmota/tasmota_xsns_sensor/xsns_95_cm110x.ino b/tasmota/tasmota_xsns_sensor/xsns_95_cm110x.ino index c71a91093..aa0b22697 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_95_cm110x.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_95_cm110x.ino @@ -394,6 +394,9 @@ void CM11Init(void) CM11Serial = new TasmotaSerial(Pin(GPIO_CM11_RXD), Pin(GPIO_CM11_TXD), 1); if (CM11Serial->begin(9600)) { if (CM11Serial->hardwareSerial()) { ClaimSerial(); } +#ifdef ESP32 + AddLog(LOG_LEVEL_DEBUG, PSTR("CM1: Serial UART%d"), CM11Serial->getUart()); +#endif cm11_type = 1; CM11SendCmd(CM11_CMND_SW_VERSION); }