TCP Modbus not working from 1.6.2 to 1.7.1

Hello @ssalonen. Please excuse me … i’m a rookie . In your pull request i see there are 11 files changed. In order to test your proposal shall i edit manually the binding java files i the .jar binding according to your modifications ? Many thanks

Hi ssalonen,
Nodes mean slaves. One serial port with 15+ connected slaves. Only
different IDS.
Lyubomir

@lorenzo_leonelli : Here’s the jar matching the pull request https://bintray.com/artifact/download/ssalonen/generic/org.openhab.binding.modbus-1.8.0-SNAPSHOT.jar

@lgeorgiev: thanks for the clarification. OK, so that works then since the parameters are the same… good to know

Hi ssalonen,
As I open this discussion, I describe all problems. At the moment not found any solutions. As I’m also programmer but not Java one :smile: I understand the problem. Modbus binding have two major problems:

  1. Not correct pooling loop for devices.
  2. Not correct parsing results from slave devices.
    This binging have problems even if I setup only one slave. It’s looks like working, but same errors happened less often
    I sniff the serial communications from slave and see all pakets are as expected from the standard. The binding reports errors.
    I check the communications with Windows Modbus tool and no any errors detected.
    If you want, I can prepare for you a Modbus test evirement with several slaves and modbus tcp gate for remote tests (on real IP)
    At the moment the Modbus binding is not possible to use. Usable only for demo purposes :smile:

@lgeorgiev: does it show any errors at all if you enable DEBUG level logging?

I would really appreciate if you can test out the experimental version linked above. It contains fixes for serial modbus such that connections should be closed. Definately it does not resolve all issues with the serial modbus but should make it better…

Example test case

  • modbu.cfg with single serial slave, openhab.cfg update enabled (mainconfig:refresh=)
  • wait that communication is up & running and you can get data from modbus
  • change modbus.cfg such that new config is loaded
  • communication should still work

The above test case did not work for me with modbus tcp when the server is restricted to at most one connection at a time

thank you !

Today I update the OH to 1.8 stable . Stituation with devices is the same:

@lgeorgiev Please try out this version and report back how it works out for you. This version fixes several issues with serial devices due to various technical issues in the binding. We have received really good feedback now, especially on non-windows platforms, and I hope it works for you too as well.

The configuration should be compatible with the official version.

If it does not work with the new version, can you please enable debug level logging (logback_debug.xml), and start the openhab using start_debug.sh.

If the new version works for you, I would appreciate that you report your experiences in the pull request and here.