Tasmota/tasmota
Damian Wrobel 6650dee578
Fix ModbusBridge request/response logic (#22075)
- Fix cases where the subsequent Modbus packet
  can be send to the serial port (triggered either by
  'ModbusSend' command or request from TCP bridge)
  before an answer was received to the previous packet.

  This can happen in a setup where simultaneously:
  - two (or more) modbus TCP clients are sending requests
    through the modbus-proxy [1] to Tasmota,
  - ModbusSend commands are executed (e.g. using Berry).

  Log excerpt (from build with TASMOTAMODBUSDEBUG enabled):
  14:51:18.940 MBS: Serial Send: 04 03 01 00 00 09 84 65
  14:51:19.054 MBS: Serial Send: 04 03 10 0A 00 05 A1 5E
  14:51:19.136 MBS: Serial Received: 04 03 0A 00 00 00 D0 00 00 01 AB 00 00 89 62

  Fix adds 'waitingForAnswerFromSerial' flag which is set after
  we send data to the serial port and prevents sending another
  requests before we receive an answer or timeout happened.

  Fix stores temporarily a 'ModbusSend' command data and tries
  to execute it after Modbus response has been received or
  timeout has happened.

- Add 'ModbusSerialTimeout' command which sets timeout in [ms]
  for how long we will be waiting for an answer from the client device.
  Default value is 1000 [ms] and it is not restored after reboot.

- Sends error 11 (0xB) (as TCP response) when no answer was received
  from the serial port within the timeout set by 'ModbusSerialTimeout'
  command.

- Add Modbus 'TransactionId' to the logging.

[1] https://github.com/tiagocoutinho/modbus-proxy

Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
2024-09-09 10:26:20 +02:00
..
berry Zigbee Koenkk firmware 20240710 for Sonoff Zigbee ZBPro (#22076) 2024-09-02 22:20:41 +02:00
displaydesc add support for 4.2 inch epaper display from WeAct Studio (partial up… (#21717) 2024-07-08 17:25:06 +02:00
energy_modbus_configs Add entry for Growatt 12KTL-3S (#18898) 2023-06-18 20:26:42 +02:00
html_compressed Remove dash from GUI title 2024-08-26 14:20:51 +02:00
html_uncompressed Remove dash from GUI title 2024-08-26 14:20:51 +02:00
include Enhance the KNX capabilities of Tasmota to offer more flexibility and features (#22071) 2024-09-09 09:25:11 +02:00
language Update de_DE.h (#21857) 2024-07-28 14:24:47 +02:00
lvgl_berry LVGL Added OpenHASP icons to font montserrat-28 (#22048) 2024-08-29 16:57:01 +02:00
tasmota_support Bump version v14.2.0.4 2024-09-08 17:32:35 +02:00
tasmota_xdrv_driver Fix ModbusBridge request/response logic (#22075) 2024-09-09 10:26:20 +02:00
tasmota_xdsp_display Fix universal display slow response 2024-07-17 17:13:24 +02:00
tasmota_xlgt_light Remove non IDF5 code 2024-05-15 16:45:42 +02:00
tasmota_xnrg_energy Version v14.2.0.2 2024-08-21 16:27:43 +02:00
tasmota_xsns_sensor Bump version v14.2.0.4 2024-09-08 17:32:35 +02:00
tasmota_xx2c_global Add Rule and Scripter xdrv sensor polling 2024-08-13 12:28:09 +02:00
zigbee Zigbee DIYRuZ_Geiger (#19151) 2023-07-19 20:41:49 +02:00
my_user_config.h Clarify MAX7219 display driver (#21977) 2024-08-26 08:49:48 +02:00
tasmota.ino Add command `Backlog3` to execute commands without response but rule processing (#21740) 2024-07-08 15:53:15 +02:00
user_config_override_sample.h Support for second DNS server 2021-07-29 16:57:04 +02:00