Add serial Modbus transmit enable GPIOs

Add serial Modbus transmit enable GPIOs to all modbus energy drivers and modbus bridge (#17247)
This commit is contained in:
Theo Arends 2022-12-03 12:33:42 +01:00
parent 816fd78fbb
commit bbde894628
52 changed files with 191 additions and 91 deletions

View File

@ -5,10 +5,12 @@ All notable changes to this project will be documented in this file.
## [12.2.0.6]
### Added
- Serial Modbus transmit enable GPIOs to all modbus energy drivers and modbus bridge (#17247)
### Breaking Changed
### Changed
- TasmotaSerial library from v3.5.0 to v3.6.0
### Fixed
- TasmotaSerial ``read(buffer, size)`` regression from v9.3.0

View File

@ -129,6 +129,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo
- Support for HMC5883L 3-Axis Digital Compass sensor by Andreas Achtzehn [#17069](https://github.com/arendst/Tasmota/issues/17069)
- WS2812 and Light ArtNet DMX control over UDP port 6454 [#17059](https://github.com/arendst/Tasmota/issues/17059)
- Teleinfo TEMPO (BBR) contract [#17160](https://github.com/arendst/Tasmota/issues/17160)
- Serial Modbus transmit enable GPIOs to all modbus energy drivers and modbus bridge [#17247](https://github.com/arendst/Tasmota/issues/17247)
- Berry ``bytes().setbytes()`` method [#16892](https://github.com/arendst/Tasmota/issues/16892)
- Berry ``bytes().reverse()`` method [#16977](https://github.com/arendst/Tasmota/issues/16977)
- Berry ``mdns`` module [#17202](https://github.com/arendst/Tasmota/issues/17202)
@ -140,6 +141,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo
- Redesign distance sensors VL53LXX, TOF10120, HRXL and DYP to use cm instead of mm [#17021](https://github.com/arendst/Tasmota/issues/17021)
### Changed
- TasmotaSerial library from v3.5.0 to v3.6.0
- ESP32 Framework (Core) from v2.0.5 to v2.0.5.3
- ESP32 LVGL library from v8.3.2 to v8.3.3 (no functional change)
- ESP32 NimBLE library from v1.4.0 to v1.4.1 [#16775](https://github.com/arendst/Tasmota/issues/16775)

View File

@ -1,6 +1,6 @@
{
"name": "TasmotaSerial",
"version": "3.5.0",
"version": "3.6.0",
"keywords": [
"serial", "io", "TasmotaSerial"
],

View File

@ -1,5 +1,5 @@
name=TasmotaSerial
version=3.5.0
version=3.6.0
author=Theo Arends
maintainer=Theo Arends <theo@arends.com>
sentence=Implementation of software serial with hardware serial fallback for ESP8266 and ESP32.

View File

@ -46,9 +46,11 @@ static uint32_t tasmota_serial_uart_bitmap = 0; // Assigned UARTs
TasmotaSerial::TasmotaSerial(int receive_pin, int transmit_pin, int hardware_fallback, int nwmode, int buffer_size) {
m_valid = false;
m_tx_enable_valid = false;
m_hardserial = false;
m_hardswap = false;
m_overflow = false;
m_data_bits = 8;
m_stop_bits = 1;
m_nwmode = nwmode;
serial_buffer_size = buffer_size;
@ -122,7 +124,23 @@ TasmotaSerial::~TasmotaSerial(void) {
}
bool TasmotaSerial::isValidGPIOpin(int pin) {
#ifdef ESP8266
return (pin >= -1 && pin <= 5) || (pin >= 12 && pin <= 15);
#endif
#ifdef ESP32
return GPIO_IS_VALID_OUTPUT_GPIO(pin);
#endif
}
void TasmotaSerial::setTransmitEnablePin(int tx_enable_pin) {
if ((tx_enable_pin > -1) && isValidGPIOpin(tx_enable_pin)) {
m_tx_enable_valid = true;
m_tx_enable_pin = tx_enable_pin;
pinMode(m_tx_enable_pin, OUTPUT);
digitalWrite(m_tx_enable_pin, LOW);
} else {
m_tx_enable_valid = false;
}
}
#ifdef ESP32
@ -239,12 +257,17 @@ bool TasmotaSerial::begin(uint32_t speed, uint32_t config) {
// Serial.printf("TSR: Using UART%d\n", m_uart);
#endif // ESP32
} else {
// #define UART_NB_BIT_5 0B00000000
// #define UART_NB_BIT_6 0B00000100
// #define UART_NB_BIT_7 0B00001000
// #define UART_NB_BIT_8 0B00001100
m_data_bits = 5 + ((config &0x0C) >> 2);
// Software serial fakes two stop bits if either stop bits is 2 or parity is not None
// #define UART_NB_STOP_BIT_0 0B00000000
// #define UART_NB_STOP_BIT_1 0B00010000
// #define UART_NB_STOP_BIT_15 0B00100000
// #define UART_NB_STOP_BIT_2 0B00110000
m_stop_bits = ((config &0x30) >> 5) +1;
m_stop_bits = 1 + ((config &0x30) >> 5);
// #define UART_PARITY_NONE 0B00000000
// #define UART_PARITY_EVEN 0B00000010
// #define UART_PARITY_ODD 0B00000011
@ -368,9 +391,9 @@ int TasmotaSerial::available(void) {
}
}
#define TM_SERIAL_WAIT_SND { while (ESP.getCycleCount() < (wait + start)) if (!m_high_speed) optimistic_yield(1); wait += m_bit_time; } // Watchdog timeouts
#define TM_SERIAL_WAIT_SND { while (ESP.getCycleCount() < (wait + start)) if (!m_high_speed) optimistic_yield(1); wait += m_bit_time; } // Watchdog timeouts
#define TM_SERIAL_WAIT_SND_FAST { while (ESP.getCycleCount() < (wait + start)); wait += m_bit_time; }
#define TM_SERIAL_WAIT_RCV { while (ESP.getCycleCount() < (wait + start)); wait += m_bit_time; }
#define TM_SERIAL_WAIT_RCV { while (ESP.getCycleCount() < (wait + start)); wait += m_bit_time; }
#define TM_SERIAL_WAIT_RCV_LOOP { while (ESP.getCycleCount() < (wait + start)); }
void IRAM_ATTR TasmotaSerial::_fast_write(uint8_t b) {
@ -379,7 +402,7 @@ void IRAM_ATTR TasmotaSerial::_fast_write(uint8_t b) {
// Start bit;
digitalWrite(m_tx_pin, LOW);
TM_SERIAL_WAIT_SND_FAST;
for (uint32_t i = 0; i < 8; i++) {
for (uint32_t i = 0; i < m_data_bits; i++) {
digitalWrite(m_tx_pin, (b & 1) ? HIGH : LOW);
TM_SERIAL_WAIT_SND_FAST;
b >>= 1;
@ -392,15 +415,20 @@ void IRAM_ATTR TasmotaSerial::_fast_write(uint8_t b) {
}
size_t TasmotaSerial::write(uint8_t b) {
if (!m_hardserial && (-1 == m_tx_pin)) { return 0; }
if (m_tx_enable_valid) {
digitalWrite(m_tx_enable_pin, HIGH);
}
size_t size = 0;
if (m_hardserial) {
#ifdef ESP8266
return Serial.write(b);
size = Serial.write(b);
#endif // ESP8266
#ifdef ESP32
return TSerial->write(b);
size = TSerial->write(b);
#endif // ESP32
} else {
if (-1 == m_tx_pin) return 0;
if (m_high_speed) {
cli(); // Disable interrupts in order to get a clean transmit
_fast_write(b);
@ -412,7 +440,7 @@ size_t TasmotaSerial::write(uint8_t b) {
// Start bit;
digitalWrite(m_tx_pin, LOW);
TM_SERIAL_WAIT_SND;
for (uint32_t i = 0; i < 8; i++) {
for (uint32_t i = 0; i < m_data_bits; i++) {
digitalWrite(m_tx_pin, (b & 1) ? HIGH : LOW);
TM_SERIAL_WAIT_SND;
b >>= 1;
@ -424,25 +452,29 @@ size_t TasmotaSerial::write(uint8_t b) {
TM_SERIAL_WAIT_SND;
}
}
return 1;
size = 1;
}
if (m_tx_enable_valid) {
digitalWrite(m_tx_enable_pin, LOW);
}
return size;
}
void IRAM_ATTR TasmotaSerial::rxRead(void) {
uint32_t m_out_pos_fixed = m_out_pos;
if (!m_nwmode) {
int32_t loop_read = m_very_high_speed ? serial_buffer_size : 1;
uint32_t bit_mask = 0x01 << (m_data_bits -1);
// Advance the starting point for the samples but compensate for the
// initial delay which occurs before the interrupt is delivered
uint32_t wait = m_bit_start_time;
uint32_t start = ESP.getCycleCount();
while (loop_read-- > 0) { // try to receveive all consecutive bytes in a row
while (loop_read-- > 0) { // try to receive all consecutive bytes in a row
uint32_t rec = 0;
for (uint32_t i = 0; i < 8; i++) {
for (uint32_t i = 0; i < m_data_bits; i++) {
TM_SERIAL_WAIT_RCV;
rec >>= 1;
if (digitalRead(m_rx_pin)) rec |= 0x80;
if (digitalRead(m_rx_pin)) rec |= bit_mask;
}
// Store the received value in the buffer unless we have an overflow
uint32_t next = (m_in_pos + 1) % serial_buffer_size;
@ -485,6 +517,7 @@ void IRAM_ATTR TasmotaSerial::rxRead(void) {
// it gets set even when interrupts are disabled
GPIO_REG_WRITE(GPIO_STATUS_W1TC_ADDRESS, 1 << m_rx_pin);
} else {
// Currently supports 8-bit data only
uint32_t diff;
uint32_t level;

View File

@ -39,6 +39,7 @@ class TasmotaSerial : public Stream {
public:
TasmotaSerial(int receive_pin, int transmit_pin, int hardware_fallback = 0, int nwmode = 0, int buffer_size = TM_SERIAL_BUFFER_SIZE);
virtual ~TasmotaSerial();
void setTransmitEnablePin(int tx_enable_pin);
size_t setRxBufferSize(size_t size);
size_t getRxBufferSize() { return serial_buffer_size; }
@ -80,6 +81,8 @@ class TasmotaSerial : public Stream {
// Member variables
int m_rx_pin;
int m_tx_pin;
int m_tx_enable_pin;
uint32_t m_data_bits;
uint32_t m_stop_bits;
uint32_t ss_byte;
uint32_t ss_bstart;
@ -91,6 +94,7 @@ class TasmotaSerial : public Stream {
uint32_t m_out_pos;
uint32_t serial_buffer_size = TM_SERIAL_BUFFER_SIZE;
bool m_valid;
bool m_tx_enable_valid;
bool m_nwmode;
bool m_hardserial;
bool m_hardswap;

View File

@ -27,8 +27,9 @@ enum LoggingLevels {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_D
//#define TASMOTAMODBUSDEBUG
TasmotaModbus::TasmotaModbus(int receive_pin, int transmit_pin) : TasmotaSerial(receive_pin, transmit_pin, 1)
TasmotaModbus::TasmotaModbus(int receive_pin, int transmit_pin, int tx_enable_pin) : TasmotaSerial(receive_pin, transmit_pin, 1)
{
setTransmitEnablePin(tx_enable_pin);
mb_address = 0;
}
@ -91,7 +92,7 @@ uint8_t TasmotaModbus::Send(uint8_t device_address, uint8_t function_code, uint1
}
else if ((function_code == 5) || (function_code == 6))
{
if (write_data == NULL)
if (write_data == NULL)
{
free(frame);
return 13; // Register data not specified
@ -108,10 +109,10 @@ uint8_t TasmotaModbus::Send(uint8_t device_address, uint8_t function_code, uint1
{
frame[framepointer++] = (uint8_t)(count >> 8); // MSB
frame[framepointer++] = (uint8_t)(count); // LSB
frame[framepointer++] = byte_count;
if (write_data == NULL)
if (write_data == NULL)
{
free(frame);
return 13; // Register data not specified
@ -126,7 +127,7 @@ uint8_t TasmotaModbus::Send(uint8_t device_address, uint8_t function_code, uint1
frame[framepointer++] = (uint8_t)(write_data[bytepointer/2] >> (bytepointer % 2 ? 0 : 8)); // MSB, LSB, MSB ....
}
}
else
else
{
free(frame);
return 1; // Wrong function code
@ -136,7 +137,7 @@ uint8_t TasmotaModbus::Send(uint8_t device_address, uint8_t function_code, uint1
frame[framepointer++] = (uint8_t)(crc);
frame[framepointer++] = (uint8_t)(crc >> 8);
#ifdef TASMOTAMODBUSDEBUG
#ifdef TASMOTAMODBUSDEBUG
uint8_t *buf;
uint16_t bufsize=(framepointer + 1) * 3;
buf = (uint8_t *)malloc(bufsize);
@ -147,7 +148,7 @@ uint8_t TasmotaModbus::Send(uint8_t device_address, uint8_t function_code, uint1
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("MBS: Serial Send: %s"), buf);
free(buf);
#endif
flush();
write(frame, framepointer);
free(frame);
@ -213,7 +214,7 @@ uint8_t TasmotaModbus::ReceiveBuffer(uint8_t *buffer, uint8_t register_count, ui
// 10 = Gateway Path Unavailable
// 11 = Gateway Target device failed to respond
}
if (mb_len < 6) { return 7; } // 7 = Not enough data
/*

View File

@ -27,7 +27,7 @@
class TasmotaModbus : public TasmotaSerial {
public:
TasmotaModbus(int receive_pin, int transmit_pin);
TasmotaModbus(int receive_pin, int transmit_pin, int tx_enable_pin = -1);
virtual ~TasmotaModbus() {}
int Begin(long speed = TM_MODBUS_BAUDRATE, uint32_t config = SERIAL_8N1);

View File

@ -202,6 +202,7 @@ enum UserSelectablePins {
GPIO_BP1658CJ_CLK, GPIO_BP1658CJ_DAT,// BP1658CJ
GPIO_DINGTIAN_CLK, GPIO_DINGTIAN_SDI, GPIO_DINGTIAN_Q7, GPIO_DINGTIAN_PL, GPIO_DINGTIAN_RCK, // Dingtian relay board - 595's & 165's pins
GPIO_LD2410_TX, GPIO_LD2410_RX, // HLK-LD2410
GPIO_MBR_TX_ENA, GPIO_NRG_MBS_TX_ENA, // Modbus Bridge Serial Transmit Enable
GPIO_SENSOR_END };
// Error as warning to rethink GPIO usage with max 2045
@ -451,6 +452,7 @@ const char kSensorNames[] PROGMEM =
D_SENSOR_BP1658CJ_CLK "|" D_SENSOR_BP1658CJ_DAT "|"
D_GPIO_DINGTIAN_CLK "|" D_GPIO_DINGTIAN_SDI "|" D_GPIO_DINGTIAN_Q7 "|" D_GPIO_DINGTIAN_PL "|" D_GPIO_DINGTIAN_RCK "|"
D_SENSOR_LD2410_TX "|" D_SENSOR_LD2410_RX "|"
D_SENSOR_MBR_TX_ENA "|" D_SENSOR_NRG_MBS_TX_ENA "|"
;
const char kSensorNamesFixed[] PROGMEM =
@ -822,6 +824,7 @@ const uint16_t kGpioNiceList[] PROGMEM = {
AGPIO(GPIO_MCP39F5_RX), // MCP39F501 Serial interface (Shelly2)
AGPIO(GPIO_MCP39F5_RST), // MCP39F501 Reset (Shelly2)
#endif
AGPIO(GPIO_NRG_MBS_TX_ENA), // Generic Energy Modbus Transmit Enable
#if defined(USE_PZEM004T) || defined(USE_PZEM_AC) || defined(USE_PZEM_DC)
AGPIO(GPIO_PZEM0XX_TX), // PZEM0XX Serial interface
#endif
@ -900,6 +903,7 @@ const uint16_t kGpioNiceList[] PROGMEM = {
AGPIO(GPIO_SBR_RX), // Serial Bridge Serial interface
#endif
#ifdef USE_MODBUS_BRIDGE
AGPIO(GPIO_MBR_TX_ENA), // Modbus Bridge Serial interface
AGPIO(GPIO_MBR_TX), // Modbus Bridge Serial interface
AGPIO(GPIO_MBR_RX), // Modbus Bridge Serial interface
#endif

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr TX"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 TX"
#define D_SENSOR_SDM72_RX "SDM72 RX"
#define D_SENSOR_SDM120_TX "SDMx20 TX"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr - TX"
#define D_SENSOR_MBR_TX "ModBr - TX"
#define D_SENSOR_MBR_RX "ModBr - RX"
#define D_SENSOR_MBR_TX_ENA "ModBr - TX ENA"
#define D_SENSOR_SR04_TRIG "SR04 Tri - TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech - RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus - TX"
#define D_SENSOR_NRG_MBS_RX "NrgModbus - RX"
#define D_SENSOR_NRG_MBS_TX "NrgMbs - TX"
#define D_SENSOR_NRG_MBS_RX "NrgMbs - RX"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs - TX ENA"
#define D_SENSOR_SDM72_TX "SDM72 - TX"
#define D_SENSOR_SDM72_RX "SDM72 - RX"
#define D_SENSOR_SDM120_TX "SDMx20 - TX"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -691,10 +691,12 @@
#define D_SENSOR_SBR_TX "SerBr Tx"
#define D_SENSOR_MBR_TX "ModBr Tx"
#define D_SENSOR_MBR_RX "ModBr Rx"
#define D_SENSOR_MBR_TX_ENA "ModBr Tx Ena"
#define D_SENSOR_SR04_TRIG "SR04 Tri/TX"
#define D_SENSOR_SR04_ECHO "SR04 Ech/RX"
#define D_SENSOR_NRG_MBS_TX "NrgModbus Tx"
#define D_SENSOR_NRG_MBS_RX "NrgModbus Rx"
#define D_SENSOR_NRG_MBS_TX "NrgMbs Tx"
#define D_SENSOR_NRG_MBS_RX "NrgMbs Rx"
#define D_SENSOR_NRG_MBS_TX_ENA "NrgMbs Tx Ena"
#define D_SENSOR_SDM72_TX "SDM72 Tx"
#define D_SENSOR_SDM72_RX "SDM72 Rx"
#define D_SENSOR_SDM120_TX "SDMx20 Tx"

View File

@ -558,7 +558,7 @@ void ModbusBridgeInit(void)
{
if (PinUsed(GPIO_MBR_RX) && PinUsed(GPIO_MBR_TX))
{
modbusBridgeModbus = new TasmotaModbus(Pin(GPIO_MBR_RX), Pin(GPIO_MBR_TX));
modbusBridgeModbus = new TasmotaModbus(Pin(GPIO_MBR_RX), Pin(GPIO_MBR_TX), Pin(GPIO_MBR_TX_ENA));
ModbusBridgeBegin();
#ifdef USE_MODBUS_BRIDGE_TCP
// If TCP bridge is enabled allocate a TCP receive buffer

View File

@ -114,7 +114,7 @@ void PzemAcEverySecond(void)
void PzemAcSnsInit(void)
{
PzemAcModbus = new TasmotaModbus(Pin(GPIO_PZEM016_RX), Pin(GPIO_PZEM0XX_TX));
PzemAcModbus = new TasmotaModbus(Pin(GPIO_PZEM016_RX), Pin(GPIO_PZEM0XX_TX), Pin(GPIO_NRG_MBS_TX_ENA));
uint8_t result = PzemAcModbus->Begin(9600);
if (result) {
if (2 == result) { ClaimSerial(); }

View File

@ -111,7 +111,7 @@ void PzemDcEverySecond(void)
void PzemDcSnsInit(void)
{
PzemDcModbus = new TasmotaModbus(Pin(GPIO_PZEM017_RX), Pin(GPIO_PZEM0XX_TX));
PzemDcModbus = new TasmotaModbus(Pin(GPIO_PZEM017_RX), Pin(GPIO_PZEM0XX_TX), Pin(GPIO_NRG_MBS_TX_ENA));
uint8_t result = PzemDcModbus->Begin(9600, SERIAL_8N2);
if (result) {
if (2 == result) { ClaimSerial(); }

View File

@ -177,7 +177,7 @@ void SDM120Every250ms(void)
void Sdm120SnsInit(void)
{
Sdm120Modbus = new TasmotaModbus(Pin(GPIO_SDM120_RX), Pin(GPIO_SDM120_TX));
Sdm120Modbus = new TasmotaModbus(Pin(GPIO_SDM120_RX), Pin(GPIO_SDM120_TX), Pin(GPIO_NRG_MBS_TX_ENA));
uint8_t result = Sdm120Modbus->Begin(SDM120_SPEED);
if (result) {
if (2 == result) { ClaimSerial(); }

View File

@ -90,7 +90,7 @@ void Dds2382EverySecond(void)
void Dds2382SnsInit(void)
{
Dds2382Modbus = new TasmotaModbus(Pin(GPIO_DDS2382_RX), Pin(GPIO_DDS2382_TX));
Dds2382Modbus = new TasmotaModbus(Pin(GPIO_DDS2382_RX), Pin(GPIO_DDS2382_TX), Pin(GPIO_NRG_MBS_TX_ENA));
uint8_t result = Dds2382Modbus->Begin(DDS2382_SPEED);
if (result) {
if (2 == result) { ClaimSerial(); }

View File

@ -213,7 +213,7 @@ void SDM630Every250ms(void)
void Sdm630SnsInit(void)
{
Sdm630Modbus = new TasmotaModbus(Pin(GPIO_SDM630_RX), Pin(GPIO_SDM630_TX));
Sdm630Modbus = new TasmotaModbus(Pin(GPIO_SDM630_RX), Pin(GPIO_SDM630_TX), Pin(GPIO_NRG_MBS_TX_ENA));
uint8_t result = Sdm630Modbus->Begin(SDM630_SPEED);
if (result) {
if (2 == result) { ClaimSerial(); }

View File

@ -132,7 +132,7 @@ void DDSU666Every250ms(void)
void Ddsu666SnsInit(void)
{
Ddsu666Modbus = new TasmotaModbus(Pin(GPIO_DDSU666_RX), Pin(GPIO_DDSU666_TX));
Ddsu666Modbus = new TasmotaModbus(Pin(GPIO_DDSU666_RX), Pin(GPIO_DDSU666_TX), Pin(GPIO_NRG_MBS_TX_ENA));
uint8_t result = Ddsu666Modbus->Begin(DDSU666_SPEED);
if (result) {
if (2 == result) { ClaimSerial(); }

View File

@ -214,7 +214,7 @@ void FifLEEvery250ms(void)
void FifLESnsInit(void)
{
FifLEModbus = new TasmotaModbus(Pin(GPIO_LE01MR_RX), Pin(GPIO_LE01MR_TX));
FifLEModbus = new TasmotaModbus(Pin(GPIO_LE01MR_RX), Pin(GPIO_LE01MR_TX), Pin(GPIO_NRG_MBS_TX_ENA));
uint8_t result = FifLEModbus->Begin(LE01MR_SPEED);
if (result) {
if (2 == result) { ClaimSerial(); }

View File

@ -181,7 +181,7 @@ void IEM3000Every250ms(void)
void Iem3000SnsInit(void)
{
Iem3000Modbus = new TasmotaModbus(Pin(GPIO_IEM3000_RX), Pin(GPIO_IEM3000_TX));
Iem3000Modbus = new TasmotaModbus(Pin(GPIO_IEM3000_RX), Pin(GPIO_IEM3000_TX), Pin(GPIO_NRG_MBS_TX_ENA));
uint8_t result = Iem3000Modbus->Begin(IEM3000_SPEED);
if (result) {
if (2 == result) { ClaimSerial(); }

View File

@ -185,7 +185,7 @@ void WE517Every250ms(void)
void We517SnsInit(void)
{
We517Modbus = new TasmotaModbus(Pin(GPIO_WE517_RX), Pin(GPIO_WE517_TX));
We517Modbus = new TasmotaModbus(Pin(GPIO_WE517_RX), Pin(GPIO_WE517_TX), Pin(GPIO_NRG_MBS_TX_ENA));
uint8_t result = We517Modbus->Begin(WE517_SPEED);
if (result) {
if (2 == result) {

View File

@ -130,7 +130,7 @@ void Sdm72Every250ms(void)
void Sdm72SnsInit(void)
{
Sdm72Modbus = new TasmotaModbus(Pin(GPIO_SDM72_RX), Pin(GPIO_SDM72_TX));
Sdm72Modbus = new TasmotaModbus(Pin(GPIO_SDM72_RX), Pin(GPIO_SDM72_TX), Pin(GPIO_NRG_MBS_TX_ENA));
uint8_t result = Sdm72Modbus->Begin(SDM72_SPEED);
if (result) {
if (2 == result) {

View File

@ -188,7 +188,7 @@ void SDM230Every250ms(void)
void Sdm230SnsInit(void)
{
Sdm230Modbus = new TasmotaModbus(Pin(GPIO_SDM230_RX), Pin(GPIO_SDM230_TX));
Sdm230Modbus = new TasmotaModbus(Pin(GPIO_SDM230_RX), Pin(GPIO_SDM230_TX), Pin(GPIO_NRG_MBS_TX_ENA));
uint8_t result = Sdm230Modbus->Begin(SDM230_SPEED);
if (result) {
if (2 == result) { ClaimSerial(); }

View File

@ -663,7 +663,7 @@ bool EnergyModbusRegisters(void) {
void EnergyModbusSnsInit(void) {
if (EnergyModbusRegisters()) {
EnergyModbus = new TasmotaModbus(Pin(GPIO_NRG_MBS_RX), Pin(GPIO_NRG_MBS_TX));
EnergyModbus = new TasmotaModbus(Pin(GPIO_NRG_MBS_RX), Pin(GPIO_NRG_MBS_TX), Pin(GPIO_NRG_MBS_TX_ENA));
uint8_t result = EnergyModbus->Begin(NrgMbsParam.serial_bps, NrgMbsParam.serial_config);
if (result) {
if (2 == result) { ClaimSerial(); }