From 831597e7d98837428d5815be213d444cc533e0d9 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Fri, 23 Aug 2024 11:22:26 +0200 Subject: [PATCH] Version v14.2.0.3 - Add command ``SetOption69 1`` to enable Serial Bridge inverted Receive (#22000) --- CHANGELOG.md | 10 +++++++--- RELEASENOTES.md | 3 ++- tasmota/include/tasmota_types.h | 3 ++- tasmota/include/tasmota_version.h | 2 +- tasmota/tasmota_support/settings.ino | 3 +++ tasmota/tasmota_support/support_command.ino | 3 +++ tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino | 11 ++++++++--- tools/decode-status.py | 4 ++-- 8 files changed, 28 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c397a1d30..033d80301 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,19 +3,23 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - Development -## [14.2.0.2] +## [14.2.0.3] ### Added +- Command ``SetOption69 1`` to enable Serial Bridge inverted Receive (#22000) ### Breaking Changed ### Changed -- Energy BL09xx command ``CurrentSet`` input changed from Ampere to milliAmpere -- GPIOViewer from v1.5.5 to v1.5.6 ### Fixed ### Removed +## [14.2.0.2] 20240823 +### Changed +- Energy BL09xx command ``CurrentSet`` input changed from Ampere to milliAmpere +- GPIOViewer from v1.5.5 to v1.5.6 + ## [14.2.0.1] 20240821 ### Added - Energy Log level 4 message when (Calculated) Apparent Power is less than Active Power indicating wrong calibration (#20653) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index b390c49ae..b1874d94d 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -119,8 +119,9 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm [Complete list](BUILDS.md) of available feature and sensors. -## Changelog v14.2.0.2 +## Changelog v14.2.0.3 ### Added +- Command ``SetOption69 1`` to enable Serial Bridge inverted Receive [#22000](https://github.com/arendst/Tasmota/issues/22000) - Energy command ``PowerSet 60,230`` to calibrate both Current and Power with known resistive load of 60W at 230V using calibrated Voltage - Energy command ``CurrentSet 60,230`` to calibrate both Power and Current with known resistive load of 60W at 230V using calibrated Voltage - Energy Log level 4 message when (Calculated) Apparent Power is less than Active Power indicating wrong calibration [#20653](https://github.com/arendst/Tasmota/issues/20653) diff --git a/tasmota/include/tasmota_types.h b/tasmota/include/tasmota_types.h index ddd0566a6..8e22f4fc6 100755 --- a/tasmota/include/tasmota_types.h +++ b/tasmota/include/tasmota_types.h @@ -82,7 +82,8 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t tuya_serial_mqtt_publish : 1; // bit 16 (v6.6.0.21) - SetOption66 - (Tuya) Enable (1) TuyaMcuReceived messages over Mqtt uint32_t buzzer_enable : 1; // bit 17 (v6.6.0.1) - SetOption67 - (Buzzer) Enable (1) buzzer when available uint32_t pwm_multi_channels : 1; // bit 18 (v6.6.0.3) - SetOption68 - (Light) Enable multi-channels PWM (1) instead of Color PWM (0) - uint32_t ex_tuya_dimmer_min_limit : 1; // bit 19 (v6.6.0.5) - SetOption69 - (not used) Limits Tuya dimmers to minimum of 10% (25) when enabled +// uint32_t ex_tuya_dimmer_min_limit : 1; // bit 19 (v6.6.0.5) - SetOption69 - (not used) Limits Tuya dimmers to minimum of 10% (25) when enabled + uint32_t sb_receive_invert : 1; // bit 19 (v14.2.0.3) - SetOption69 - (Serial) Invert Serial receive on SerialBridge (1) uint32_t energy_weekend : 1; // bit 20 (v6.6.0.8) - CMND_TARIFF uint32_t dds2382_model : 1; // bit 21 (v6.6.0.14) - SetOption71 - (DDS2382) Select different Modbus registers (1) for Active Energy (#6531) uint32_t hardware_energy_total : 1; // bit 22 (v6.6.0.15) - SetOption72 - (Energy) Enable (1) hardware energy total counter as reference (#6561) diff --git a/tasmota/include/tasmota_version.h b/tasmota/include/tasmota_version.h index 044db53f8..01493cea3 100644 --- a/tasmota/include/tasmota_version.h +++ b/tasmota/include/tasmota_version.h @@ -22,6 +22,6 @@ #define TASMOTA_SHA_SHORT // Filled by Github sed -const uint32_t TASMOTA_VERSION = 0x0E020002; // 14.2.0.2 +const uint32_t TASMOTA_VERSION = 0x0E020003; // 14.2.0.3 #endif // _TASMOTA_VERSION_H_ diff --git a/tasmota/tasmota_support/settings.ino b/tasmota/tasmota_support/settings.ino index aa1457983..c1aa52a59 100644 --- a/tasmota/tasmota_support/settings.ino +++ b/tasmota/tasmota_support/settings.ino @@ -1829,6 +1829,9 @@ void SettingsDelta(void) { if (Settings->version < 0x0E010002) { // 14.1.0.2 Settings->sserial_mode = Settings->sbflag1.ex_serbridge_console; } + if (Settings->version < 0x0E020003) { // 14.2.0.3 + Settings->flag3.sb_receive_invert = 0; // SetOption69 - (Serial) Invert Serial receive on SerialBridge + } Settings->version = TASMOTA_VERSION; SettingsSave(1); diff --git a/tasmota/tasmota_support/support_command.ino b/tasmota/tasmota_support/support_command.ino index 593bfdac5..f84eab6c8 100644 --- a/tasmota/tasmota_support/support_command.ino +++ b/tasmota/tasmota_support/support_command.ino @@ -1565,6 +1565,9 @@ void CmndSetoptionBase(bool indexed) { WiFiSetSleepMode(); // Update WiFi sleep mode accordingly break; case 18: // SetOption68 for multi-channel PWM, requires a reboot +#ifdef USE_SERIAL_BRIDGE + case 19: // SetOption69 - (Serial) Invert Serial receive on SerialBridge +#endif // USE_SERIAL_BRIDGE case 25: // SetOption75 grouptopic change TasmotaGlobal.restart_flag = 2; break; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino index 938194fc2..0eb9a0c43 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino @@ -179,7 +179,7 @@ void SerialBridgeInput(void) { } #ifdef USE_SERIAL_BRIDGE_TEE - if (SB_TEE == Settings->sserial_mode) { // CMND_SSERIALSEND9 - Enable logging tee to serialbridge + if (SB_TEE == Settings->sserial_mode) { // CMND_SSERIALSEND9 - Enable logging tee to serialbridge return; } #endif // USE_SERIAL_BRIDGE_TEE @@ -240,8 +240,12 @@ void SerialBridgeInput(void) { void SerialBridgeInit(void) { if (PinUsed(GPIO_SBR_RX) || PinUsed(GPIO_SBR_TX)) { -// SerialBridgeSerial = new TasmotaSerial(Pin(GPIO_SBR_RX), Pin(GPIO_SBR_TX), HARDWARE_FALLBACK); // Default TM_SERIAL_BUFFER_SIZE (=64) size - SerialBridgeSerial = new TasmotaSerial(Pin(GPIO_SBR_RX), Pin(GPIO_SBR_TX), HARDWARE_FALLBACK, 0, MIN_INPUT_BUFFER_SIZE); // 256 + SerialBridgeSerial = new TasmotaSerial(Pin(GPIO_SBR_RX), + Pin(GPIO_SBR_TX), + HARDWARE_FALLBACK, + 0, // Software receive mode (FALLING edge) + MIN_INPUT_BUFFER_SIZE, // 256 + Settings->flag3.sb_receive_invert); // SetOption69 - (Serial) Invert Serial receive on SerialBridge if (SetSSerialBegin()) { if (SerialBridgeSerial->hardwareSerial()) { ClaimSerial(); @@ -384,6 +388,7 @@ void CmndSSerialMode(void) { #ifdef USE_SERIAL_BRIDGE_WTS01 case SB_WTS01: Settings->sserial_mode = XdrvMailbox.payload; + Settings->flag3.sb_receive_invert = 0; // SetOption69 - (Serial) Invert Serial receive on SerialBridge Settings->sbaudrate = 9600 / 300; // 9600bps SetSSerialConfig(3); // 8N1 break; diff --git a/tools/decode-status.py b/tools/decode-status.py index 0f55bfbe3..329c9985e 100755 --- a/tools/decode-status.py +++ b/tools/decode-status.py @@ -121,7 +121,7 @@ a_setoption = [[ "(Tuya) Enable (1) TuyaMcuReceived messages over Mqtt", "(Buzzer) Enable (1) buzzer when available", "(Light) Enable multi-channels PWM (1) instead of Color PWM (0)", - "(not used) Limits Tuya dimmers to minimum of 10% (25) when enabled", + "(Serial) Invert Serial receive on SerialBridge (1)", "(Energy) Enable Weekend Energy Tariff", "(DDS2382) Select different Modbus registers (1) for Active Energy (#6531)", "(Energy) Enable (1) hardware energy total counter as reference (#6561)", @@ -339,7 +339,7 @@ else: obj = json.load(fp) def StartDecode(): - print ("\n*** decode-status.py v14.1.0.1 by Theo Arends and Jacek Ziolkowski ***") + print ("\n*** decode-status.py v14.2.0.3 by Theo Arends and Jacek Ziolkowski ***") # print("Decoding\n{}".format(obj))