Modbus service Start / Stop

Im new to OH2 and i’m exited to use OH2. The installation is quiet straight forward & im using it in a suse OS. I have a modbus controller to which i need to communicate. i’m able to start the modbus service through the modbus.cfg in designer tool. BUt im unable to stop the service. even if i comment the settings in the modbus.cfg file, the polling does not stop.

please help!!

Chendhir kumar.V

You might need to restart OH to force it to re-read the config. I don’t think this is always required in OH 2 but it couldn’t hurt.

Sorry for the late reply. I will explain the problem clearly.

  1. I initially configured one slave modbus device reading 2 digital inputs.
    The OH2 started to send and receive modbus requests / responses
  2. I have configured second slave with some more di’s. But OH2 did not
    send the queries.
  3. I started OH2 and after few tries, queries started .
    4.when I want to stop sending query to 2nd slave, I commented the
    configuration code in the driver. But even after several restart, OH2 did
    not stop sending queries to 2nd slave.

I’m unable to control the modbus requests / responses for modbus in OH2.

Please help.

With regards,

This is mobus specific so I wont be any help.

There is a bug in Modbus binding probably. When you do changes in modbus.cfg they are transferred to userdata/config/org/openhab/modbus.config file. It looks like that this file is modified well in case you add new modbus slaves into modbus.cfg. But in case you modify/comment out existing slaves the changes are not reflected. The solution is to make userdata/config/org/openhab/modbus.config empty and resave modbus.cfg. After that the binding renew userdata/config/org/openhab/modbus.config. It could be done when Openhab is running. No need to restart.

1 Like

The advice about the caching effects with modbus.cfg is good.

Just for future clarity, note this applies to legacy OH1 Modbus binding versions 1.xx

An OH2 version binding is now available from OH 2.4.0 , which is configured in a very different way, Things and channels instead of modbus.cfg