openhab / openhab1-addons

Add-ons for openHAB 1.x
Eclipse Public License 2.0
3.43k stars 1.71k forks source link

[org.openhab.binding.plcbus] throws warning "Error while parsing ReceiveFrame" in openhab 2.5.x-x #5952

Open arjenbarnhard opened 4 years ago

arjenbarnhard commented 4 years ago

Binding [org.openhab.binding.plcbus] throws "Error while parsing ReceiveFrame" in openHAB 2.5.x-x.

Expected Behavior

Process the command and communicate by serial to PLCbus device. Binding version 1.13 did work as expected on openHAB 2.4.

Current Behavior

The binding (versions 1.12, 1.13, 1.14 tested) throws an error under openHAB 2.5.x-x and does not process the command (sending serial data to PLCbus device connected through USB).

2020-04-24 22:11:53.989 [WARN ] [otocol.AbstractReceiveFrameContainer] - Error while parsing ReceiveFrame java.lang.ArrayIndexOutOfBoundsException: 0 at org.openhab.binding.plcbus.internal.protocol.SerialPortByteProvider.getByte(SerialPortByteProvider.java:58) ~[bundleFile:?] at org.openhab.binding.plcbus.internal.protocol.AbstractReceiveFrameContainer.parseFrame(AbstractReceiveFrameContainer.java:64) [bundleFile:?] at org.openhab.binding.plcbus.internal.protocol.AbstractReceiveFrameContainer.process(AbstractReceiveFrameContainer.java:46) [bundleFile:?] at org.openhab.binding.plcbus.internal.protocol.SerialPortGateway.send(SerialPortGateway.java:51) [bundleFile:?] at org.openhab.binding.plcbus.internal.protocol.PLCBusController.send(PLCBusController.java:60) [bundleFile:?] at org.openhab.binding.plcbus.internal.protocol.PLCBusController.sendWithoutAnswer(PLCBusController.java:43) [bundleFile:?] at org.openhab.binding.plcbus.internal.protocol.PLCBusController.switchOn(PLCBusController.java:97) [bundleFile:?] at org.openhab.binding.plcbus.internal.PLCBusBinding.internalReceiveCommand(PLCBusBinding.java:87) [bundleFile:?] at org.openhab.core.binding.AbstractBinding.receiveCommand(AbstractBinding.java:97) [bundleFile:?] at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:49) [bundleFile:?] at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415) [bundleFile:?] at org.apache.felix.eventadmin.impl.tasks.HandlerTask.runWithoutBlacklistTiming(HandlerTask.java:82) [bundleFile:?] at org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:104) [bundleFile:?] at org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter.run(AsyncDeliverTasks.java:166) [bundleFile:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_152] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_152] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_152] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_152] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_152]

Possible Solution

Binding (version 1.9 ?) had comparable issue under openHAB 2.4. This was fixed in a later binding version.

Steps to Reproduce (for bugs)

  1. Use openHAB 2.4 with binding version 1.13.
  2. Upgrade openHAB to 2.5.x-x.
  3. Change state of item and error shows in log.

    Context

    Currenlty home automation does not work for any PLCbus item (27 switches and dimmers) used in the house.

Your Environment

openHABianPi 9.01.180106 Release = Raspbian GNU/Linux 8 (jessie) Kernel = Linux 4.9.35-v7+ Platform = Raspberry Pi 3 Model B Rev 1.2 openHAB 2.5.4-1 (Release Build) PLCbus adapter PLCbus devices PLCbus addon [org.openhab.binding.plcbus-1.14.0.jar]