hello, i need help with modbus 1.x binding.
I have 9 relay boards with id: 2,3,4,5,7,8,9,10,11 ( https://www.aliexpress.com/item/Modbus-RTU-4-Way-Relay-Module-DIY-STM8S103-System-4-Road-Input-485-Communication/32831233056.html)
Conect via ttyUSB0 usb modbus adapter (https://www.aliexpress.com/item/Usb-to-usb-485-USB-to-RS485-Adapter-converter-plc-modbus/1694879877.html)
example modbus.cfg with modbus slave ID 11:
modbus::serial.r11.connection=/dev/ttyUSB0:9600:8:none:1:rtu
modbus::serial.r11.id=11
modbus::serial.r11.start=0
modbus::serial.r11.length=4
modbus::serial.r11.type=coil
modbus::serial.r11.valuetype=int8
example Items with first relay of board with id11:
Switch LightR11 "R11" <light> (VA_StorageRoom, gLight) ["Lighting"] {modbus="r11:0"}`
log Error:
2018-11-06 22:49:18.084 [WARN ] [org.apache.karaf.services.eventadmin] - EventAdmin: Exception during event dispatch [org.osgi.service.event.Event [topic=openhab/command/LightR11] {item=LightR11, bridgemarker=true, command=OFF, timestamp=1541540958082} | {org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler}={service.id=356, service.bundleid=255, service.scope=bundle, event.topics=openhab/*, service.pid=org.openhab.modbus, component.name=org.openhab.binding.modbus, component.id=230} | Bundle(org.openhab.binding.modbus_1.12.0 [255])]
java.lang.NullPointerException: null
at org.openhab.binding.modbus.internal.ModbusBinding.internalReceiveCommand(ModbusBinding.java:209) [255:org.openhab.binding.modbus:1.12.0]
at org.openhab.core.binding.AbstractBinding.receiveCommand(AbstractBinding.java:94) [197:org.openhab.core.compat1x:2.4.0.201808120805]
at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:45) [197:org.openhab.core.compat1x:2.4.0.201808120805]
at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415) [3:org.apache.karaf.services.eventadmin:4.1.5]
at org.apache.felix.eventadmin.impl.tasks.HandlerTask.runWithoutBlacklistTiming(HandlerTask.java:82) [3:org.apache.karaf.services.eventadmin:4.1.5]
at org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:104) [3:org.apache.karaf.services.eventadmin:4.1.5]
at org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter.run(AsyncDeliverTasks.java:166) [3:org.apache.karaf.services.eventadmin:4.1.5]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
==> /var/log/openhab2/events.log <==
2018-11-06 22:49:18.106 [GroupItemStateChangedEvent] - gLight changed from ON to OFF through LightR11
2018-11-06 22:49:18.112 [vent.ItemStateChangedEvent] - LightR11 changed from ON to OFF
thanks for help