Move to Modbus 2.X binding

Hi.
I need to check if a modbus slave is online or not.
Friends from this forum told me that it is posble running modbus 2.x binding.
How can I upgrade/move from 1.x to 2.x.
Thanks

  • Platform information:
    • Hardware: Raspberry Pi 3
    • OS: Openhabian

EDIT:

Hi!

Actually, the version 2 is not compatible with the old configuration. Please find the docs here.

Please find very condensed summary of changes in binding version 2 in the section Changes from Modbus 1.x binding. Quoting the introduction:

The older Modbus binding is quite different to the new binding. Major difference is the thing structure introduced in new openHAB2 binding which allows configuration uisng the PaperUI.

Unfortunately there is no conversion tool to convert old configurations to new thing structure.

Due to the introduction of things, the configuration was bound to be backwards incompatible. This offered opportunity to simplify some aspects of configuration.

As you are probably are familiar with basic concepts of Modbus, I recommend reading the docs through and get an overview and understanding of the logic with the new binding. The examples are likely useful to get started fast.

I need to check if a modbus slave is online or not.

There are new channels telling information of last successful read/write as well as last erroring read/write. Using these you can decide when the slave is down. It might be also to react to thing status changes in rules, but haven’t tried it personally.

Thanks ssalonen.
I’m working with Modbus for more than 10 years with Arduino. That is the reason I want to use it now.
I have read the docs and I understand the new config files are not compatible with old ones.
But my question is about how to migrate from 1.x binding to 2.x.
Can you help me?
Has somebody tried the “status changes” in Modbus 2.x binding?
Thanks in advance.

Hi @Jose_Francisco !

I tried to help you – the links and advice are of no use? I’m afraid I do not have any other advice to give you at this stage.

Has somebody tried the “status changes” in Modbus 2.x binding?

It’s more like a general thing of openHAB2, nothing specific to the binding actually. For more information, see this post in the modbus v2 thread

Found the official docs from here:

https://docs.openhab.org/configuration/rules-dsl.html#thing-based-triggers

Especially this syntax:

Thing <thingUID> changed [from <status>] [to <status>]

Should be easy to try out?

Best,
Sami

Thanks ssalonen
My problem is I don’t know how to uninstall 1.x Modbus binding and how to install 2.x version.

Oh, ok.

Uninstalling old binding is easiest from paper ui, I think.

Installation

  1. Install serial transport: feature:install openhab-transport-serial
  2. install modbus transport bundle (copy it to addons folder)
  3. install modbus binding bundle (same way as the transport bundle)
  4. List modbus bundles bundle:list | grep -i modbus . If necessary, start them with bundle:start BUNDLENUMER
  5. Check logs for errors

I believe you found the download links already.

1 Like