From 35363e1dde172538314eb26aa12faaa09b0e51be Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Fri, 23 Aug 2024 09:57:46 +0200 Subject: [PATCH] sml special option 2,8 pullup disable --- lib/libesp32/berry/generate/be_const_bytes.h | 14 +++++++------- lib/libesp32/berry/generate/be_const_bytes_def.h | 14 +++++++------- tasmota/tasmota_xsns_sensor/xsns_53_sml.ino | 7 +++++++ 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/lib/libesp32/berry/generate/be_const_bytes.h b/lib/libesp32/berry/generate/be_const_bytes.h index aa6bbe256774..9de3f6ee1146 100644 --- a/lib/libesp32/berry/generate/be_const_bytes.h +++ b/lib/libesp32/berry/generate/be_const_bytes.h @@ -1,21 +1,21 @@ /* extern binary arrays */ extern const binstance_arg3 be_const_instance_; -extern const binstance_arg3 be_const_instance_0000FFF8FFF9FFFAFFFBFFFCFFFD; -extern const binstance_arg3 be_const_instance_00000001FFF8FFF9FFFAFFFBFFFCFFFD; extern const binstance_arg3 be_const_instance_000000010002000300040005FFF8FFF9FFFAFFFBFFFCFFFD; extern const binstance_arg3 be_const_instance_0000000100020003FFF8FFF9FFFAFFFBFFFCFFFD; extern const binstance_arg3 be_const_instance_00030005000A000F00110012FFF8FFF9FFFAFFFBFFFCFFFD; +extern const binstance_arg3 be_const_instance_0000FFF8FFF9FFFAFFFBFFFCFFFD; +extern const binstance_arg3 be_const_instance_00000001FFF8FFF9FFFAFFFBFFFCFFFD; extern const binstance_arg3 be_const_instance_000000010002FFF8FFF9FFFAFFFBFFFCFFFD; extern const binstance_arg3 be_const_instance_000000020003000F0011FFF8FFF9FFFAFFFBFFFCFFFD; extern const binstance_arg3 be_const_instance_000000050007000A000B000D000E0017FFF8FFF9FFFAFFFBFFFCFFFD; extern const binstance_arg3 be_const_instance_00070008000F400B400CFFF8FFF9FFFAFFFBFFFCFFFD; extern const binstance_arg3 be_const_instance_00000001000200080009FFF8FFF9FFFAFFFBFFFCFFFD; -extern const binstance_arg3 be_const_instance_0000000100020008FFF8FFF9FFFAFFFBFFFCFFFD; -extern const binstance_arg3 be_const_instance_00030004FFF8FFF9FFFAFFFBFFFCFFFD; extern const binstance_arg3 be_const_instance_00000001000200030004FFF8FFF9FFFAFFFBFFFCFFFD; -extern const binstance_arg3 be_const_instance_000000010007FFF8FFF9FFFAFFFBFFFCFFFD; -extern const binstance_arg3 be_const_instance_0000000100020003000400050006000700080009000A000F001100120013FFF8FFF9FFFAFFFBFFFCFFFD; -extern const binstance_arg3 be_const_instance_FFF8FFF9FFFAFFFBFFFCFFFD; +extern const binstance_arg3 be_const_instance_00030004FFF8FFF9FFFAFFFBFFFCFFFD; extern const binstance_arg3 be_const_instance_0000000200030004FFF8FFF9FFFAFFFBFFFCFFFD; +extern const binstance_arg3 be_const_instance_0000000100020008FFF8FFF9FFFAFFFBFFFCFFFD; +extern const binstance_arg3 be_const_instance_FFF8FFF9FFFAFFFBFFFCFFFD; +extern const binstance_arg3 be_const_instance_0000000100020003000400050006000700080009000A000F001100120013FFF8FFF9FFFAFFFBFFFCFFFD; +extern const binstance_arg3 be_const_instance_000000010007FFF8FFF9FFFAFFFBFFFCFFFD; extern const binstance_arg3 be_const_instance_000000050007000A000B000C000D000E000F0017FFF8FFF9FFFAFFFBFFFCFFFD; extern const binstance_arg3 be_const_instance_0000000100070008000F4001400AFFF8FFF9FFFAFFFBFFFCFFFD; diff --git a/lib/libesp32/berry/generate/be_const_bytes_def.h b/lib/libesp32/berry/generate/be_const_bytes_def.h index 284b2958ffcb..dcd243b81dd8 100644 --- a/lib/libesp32/berry/generate/be_const_bytes_def.h +++ b/lib/libesp32/berry/generate/be_const_bytes_def.h @@ -1,21 +1,21 @@ /* binary arrays */ be_define_const_bytes_empty(); -be_define_const_bytes(0000FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); -be_define_const_bytes(00000001FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); be_define_const_bytes(000000010002000300040005FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); be_define_const_bytes(0000000100020003FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); be_define_const_bytes(00030005000A000F00110012FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x03, 0x00, 0x05, 0x00, 0x0A, 0x00, 0x0F, 0x00, 0x11, 0x00, 0x12, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); +be_define_const_bytes(0000FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); +be_define_const_bytes(00000001FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); be_define_const_bytes(000000010002FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); be_define_const_bytes(000000020003000F0011FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x0F, 0x00, 0x11, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); be_define_const_bytes(000000050007000A000B000D000E0017FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x0A, 0x00, 0x0B, 0x00, 0x0D, 0x00, 0x0E, 0x00, 0x17, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); be_define_const_bytes(00070008000F400B400CFFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x07, 0x00, 0x08, 0x00, 0x0F, 0x40, 0x0B, 0x40, 0x0C, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); be_define_const_bytes(00000001000200080009FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x08, 0x00, 0x09, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); -be_define_const_bytes(0000000100020008FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x08, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); -be_define_const_bytes(00030004FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x03, 0x00, 0x04, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); be_define_const_bytes(00000001000200030004FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); -be_define_const_bytes(000000010007FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x01, 0x00, 0x07, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); -be_define_const_bytes(0000000100020003000400050006000700080009000A000F001100120013FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x08, 0x00, 0x09, 0x00, 0x0A, 0x00, 0x0F, 0x00, 0x11, 0x00, 0x12, 0x00, 0x13, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); -be_define_const_bytes(FFF8FFF9FFFAFFFBFFFCFFFD, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); +be_define_const_bytes(00030004FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x03, 0x00, 0x04, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); be_define_const_bytes(0000000200030004FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); +be_define_const_bytes(0000000100020008FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x08, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); +be_define_const_bytes(FFF8FFF9FFFAFFFBFFFCFFFD, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); +be_define_const_bytes(0000000100020003000400050006000700080009000A000F001100120013FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x08, 0x00, 0x09, 0x00, 0x0A, 0x00, 0x0F, 0x00, 0x11, 0x00, 0x12, 0x00, 0x13, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); +be_define_const_bytes(000000010007FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x01, 0x00, 0x07, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); be_define_const_bytes(000000050007000A000B000C000D000E000F0017FFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x05, 0x00, 0x07, 0x00, 0x0A, 0x00, 0x0B, 0x00, 0x0C, 0x00, 0x0D, 0x00, 0x0E, 0x00, 0x0F, 0x00, 0x17, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); be_define_const_bytes(0000000100070008000F4001400AFFF8FFF9FFFAFFFBFFFCFFFD, 0x00, 0x00, 0x00, 0x01, 0x00, 0x07, 0x00, 0x08, 0x00, 0x0F, 0x40, 0x01, 0x40, 0x0A, 0xFF, 0xF8, 0xFF, 0xF9, 0xFF, 0xFA, 0xFF, 0xFB, 0xFF, 0xFC, 0xFF, 0xFD); diff --git a/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino b/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino index 433af4462d13..f1a399eeab58 100755 --- a/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino @@ -443,6 +443,7 @@ typedef union { uint8_t SO_DWS74_BUG : 1; uint8_t SO_OBIS_LINE : 1; uint8_t SO_TRX_INVERT : 1; + uint8_t SO_DISS_PULL : 1; }; } SO_FLAGS; @@ -3639,6 +3640,9 @@ next_line: #ifdef ESP32 mp->meter_ss->begin(mp->params, smode, mp->srcpin, mp->trxpin, mp->so_flags.SO_TRX_INVERT); + if (mp->so_flags.SO_DISS_PULL) { + gpio_pullup_dis((gpio_num_t)mp->srcpin); + } #ifdef USE_ESP32_SW_SERIAL mp->meter_ss->setRxBufferSize(mp->sibsiz); #endif @@ -3770,6 +3774,9 @@ uint32_t SML_Write(int32_t meter, char *hstr) { Serial.begin(baud, (SerialConfig)smode); #else meter_desc[meter].meter_ss->begin(baud, smode, sml_globs.mp[meter].srcpin, sml_globs.mp[meter].trxpin, sml_globs.mp[meter].so_flags.SO_TRX_INVERT); + if (sml_globs.mp[meter].so_flags.SO_DISS_PULL) { + gpio_pullup_dis((gpio_num_t)sml_globs.mp[meter].srcpin); + } #endif } return 1;