openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.88k stars 3.58k forks source link

[Modbus] Poller crashes after few hours ModbusIOException #17426

Open BasvanH opened 2 weeks ago

BasvanH commented 2 weeks ago

Expected Behavior

Poller keeps polling and data should be provided at all times.

Current Behavior

I have a DAT11 configured as Modbus slave on TCP port 1800. In OH I have configured the Modus TCP, Poller and Data. After a few hours of getting data the poller crashes with this error:

Error with read: org.openhab.core.io.transport.modbus.internal.ModbusSlaveIOExceptionImpl: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception - failed to write: Broken pipe', cause2=null

And this in the openhab.log:

2024-09-03 12:29:11.577 [ERROR] [rt.modbus.internal.ModbusManagerImpl] - Last try 1 failed when executing request (ModbusReadRequestBlueprint [slaveId=255, functionCode=READ_MULTIPLE_REGISTERS, start=0, length=9, maxTries=1]). Aborting. Error was I/O error, so resetting the connection. Error details: net.wimpi.modbus.ModbusIOException I/O exception - failed to write: Broken pipe [operation ID f5988cac-492c-4462-8dcf-db5d76b869f0]

When OH is generating these errors, I can read out the register on the DAT11 just fine with QModMaster. So this must be bug related in OH.

Possible Solution

Don't know.

Steps to Reproduce (for Bugs)

This is how I configured my things:

Slave

UID: modbus:tcp:cea7a1d77b
label: PavoneSystems - DAT11 - Y - Slave
thingTypeUID: modbus:tcp
configuration:
  rtuEncoded: false
  connectMaxTries: 1
  reconnectAfterMillis: 5000
  timeBetweenTransactionsMillis: 1000
  port: 1800
  timeBetweenReconnectMillis: 5000
  connectTimeoutMillis: 30000
  host: 192.168.111.22
  afterConnectionDelayMillis: 5000
  id: 255
  enableDiscovery: false

Poller

UID: modbus:poller:cea7a1d77b:850c5d06fc
label: PavoneSystems - DAT11 - Y - Poll
thingTypeUID: modbus:poller
configuration:
  length: 9
  start: 0
  refresh: 10000
  maxTries: 1
  cacheMillis: 0
  type: holding
bridgeUID: modbus:tcp:cea7a1d77b

Data

UID: modbus:data:27284b8263
label: PavoneSystems - DAT11 - Y - Gross weight (MSB)
thingTypeUID: modbus:data
configuration:
  readValueType: uint16
  readTransform: default
  writeTransform: default
  writeType: holding
  readStart: "2"
  updateUnchangedValuesEveryMillis: 1000
  writeValueType: int16
  writeMultipleEvenWithSingleRegisterOrCoil: false
  writeMaxTries: 3
  writeStart: "100"
bridgeUID: modbus:poller:cea7a1d77b:850c5d06fc
channels:
  - id: number
    channelTypeUID: modbus:number-type
    label: Value as Number
    description: Number item channel
    configuration: {}

Findings

Your Environment

I created a topic in the community here: https://community.openhab.org/t/modbus-poller-crashes-after-few-days/158299

lsiepel commented 4 days ago

So you either need to reboot the device or openHAB to get it back into normal operation?

Can you actively reproduce it or does it occur once in a while? And can you see some kind of pattern in that?