Modbus rtu serial to communicate with multiple ID on a single Thing

  • Platform information:
    • Hardware: CPUArchitecture/RAM/storage RPI3B+
    • OS: what OS is used and which version openhabian
    • Java Runtime Environment: _which java platform is used and what version_openjdk 11.0.12
    • openHAB version: 3.1.0
  • Issue of the topic: please be detailed explaining your issue:
    I need to connect multiple devices(different ID) to a single USB-to-RS485 serial dongle but on the Serial Modbus Thing I created, I can only specify one ID, If I create another Serial Modbus Thing with a different ID but the same Serial Port (Since I only have one dongle) the second Modbus Serial Thing will issue an error.
  • Please post configurations (if applicable):
    • Items configuration related to the issue
    • Sitemap configuration related to the issue
    • Rules code related to the issue
    • Services configuration related to the issue
  • If logs where generated please post these here using code fences: CONFIGURATION_ERROR

Endpoint ‘ModbusSerialSlaveEndpoint [getPortName()=/dev/ttyUSB0]’ has conflicting parameters: parameters of this thing (modbus:serial:integraModbus ‘Integara Modbus’) are different from some other thing’s parameter. Ensure that all endpoints pointing to serial port ‘/dev/ttyUSB0’ have same parameters.

Creating multiple Serial bridge Things with different ID is the correct approach to handle a serial bus.
but
Because they share a serial port, they must all have the same parameters - baud rate, parity etc. - because that is what the bus requires.

Can’t see your config to comment on what it doesn’t like.

2 Likes

Thank you for your reply! That’s logical, and I believe that it should be the case. What happened in my case is I have an existing Modbus serial Thing that polls data from a modbus kwhr meter. It is connected to a serial usb doggle. Whenever I icreated another serial modbus thing with the same parameters but with different IDs, the new Thing will have the error as stated above. And sometimes it affected the existing Modbus Thing, sometimes it will not update the data on the Items connected to it. But now, as I restarted openhab the two Modbus Thing works fine and I am still observing.

When copy/pasting, don’t forget to also give your Things unique UIDs

I am using the openhab3 dashboard to create Things Channels and Items. It would be easy for thin on openhab2 where we can edit Thing and Items files using VSC. But I appreciate openhab3 for using yaml for this purpose. A great leap for openhab developers. So I am also waiting for future improvements from our developers to create a button for copying and creating a new Thing by just changing Thing ID and Label etc.

That’s still available in OH3, for users who’ve got used to managing some Things that way.

Whenever I icreated another serial modbus thing with the same parameters but with different IDs, the new Thing will have the error as stated above. And sometimes it affected the existing Modbus Thing, sometimes it will not update the data on the Items connected to it. But now, as I restarted openhab the two Modbus Thing works fine and I am still observing.

Modbus binding maintainer here.

This sounds like a bug. With same parameters there should not be an error nor restart should be needed.

If you can write down the exact steps (e.g screenshots from mainui) to reproduce the issue I would be happy to file a bug in github and have a look at it some point.