NEWS
CWT-BK-2222 lässt sich nicht mit Modbus Adapter auslesen
-
Hallo zusammen,
habe mir einen CWT-BK-2222 gekauft, um mein SmartHome zu erweitern. Die Idee war diesen über Modbus zu integrieren, was aktuell leider nicht funktioniert. Evtl. hat jemand von euch eine Idee warum es nicht klappt. Danke für Rückmeldung.
Hier jetzt die Gegebenheiten:
Gerät ist über das Configtool erreichbar und steuerbar. Dort habe ich auch die IP angepasst.
Ich habe aktuell mal Eingang DI2 beschaltet, damit man die Funktion sieht.
Zudem habe ich eine Software, die auch Kommunizieren kann.
Der Modbus-Adapter ist genauso konfiguriert.
Leider erscheinen im Log immer diese Warnungen und der Adapter steigt mit Error aus.
modbus.3 2024-05-05 10:04:49.373 info Disconnected from slave 192.168.2.3 modbus.3 2024-05-05 10:04:49.373 debug Closing client on purpose. modbus.3 2024-05-05 10:04:48.374 debug Cleaning up request fifo. modbus.3 2024-05-05 10:04:48.374 debug Clearing timeout of the current request. modbus.3 2024-05-05 10:04:48.374 debug Socket closed with error modbus.3 2024-05-05 10:04:48.373 warn Poll error count: 3 code: {"err":"timeout","timeout":5000} modbus.3 2024-05-05 10:04:48.372 error Client in error state. modbus.3 2024-05-05 10:04:48.372 error Request timed out. modbus.3 2024-05-05 10:04:48.371 warn Error: undefined modbus.3 2024-05-05 10:04:43.370 debug [DevID_1/inputRegs] Poll address 10001 - 8 registers modbus.3 2024-05-05 10:04:43.369 debug [DevID_1] Poll start --------------------- modbus.3 2024-05-05 10:04:38.316 warn Poll error count: 2 code: "App Timeout" modbus.3 2024-05-05 10:04:33.118 warn Error in handler for 4: RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds modbus.3 2024-05-05 10:04:33.115 debug [DevID_1/inputRegs] Poll address 10001 - 8 registers modbus.3 2024-05-05 10:04:33.114 debug [DevID_1] Poll start --------------------- modbus.3 2024-05-05 10:04:28.062 warn Poll error count: 1 code: "App Timeout" modbus.3 2024-05-05 10:04:22.870 warn Error in handler for 4: RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds modbus.3 2024-05-05 10:04:22.869 warn Error in handler for 4: RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds modbus.3 2024-05-05 10:04:22.869 warn Error in handler for 4: RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds modbus.3 2024-05-05 10:04:22.862 debug [DevID_1/inputRegs] Poll address 10001 - 8 registers modbus.3 2024-05-05 10:04:22.862 debug Initialization of scale factors done! modbus.3 2024-05-05 10:04:22.861 debug [DevID_1] Poll start --------------------- modbus.3 2024-05-05 10:04:22.860 info Connected to slave 192.168.2.3 modbus.3 2024-05-05 10:04:22.653 debug Initialize Objects for holdingRegs: [] modbus.3 2024-05-05 10:04:22.653 debug Add inputRegisters.10008_DI_7: {"_id":"inputRegisters.10008_DI_7","type":"state","common":{"name":"DI 7","role":"state","type":"number","read":true,"write":false,"def":0,"unit":""},"native":{"regType":"inputRegs","address":10008,"deviceId":1,"type":"uint16be","len":1,"offset":0,"factor":1}} modbus.3 2024-05-05 10:04:22.653 debug Add inputRegisters.10007_DI_6: {"_id":"inputRegisters.10007_DI_6","type":"state","common":{"name":"DI 6","role":"state","type":"number","read":true,"write":false,"def":0,"unit":""},"native":{"regType":"inputRegs","address":10007,"deviceId":1,"type":"uint16be","len":1,"offset":0,"factor":1}} modbus.3 2024-05-05 10:04:22.653 debug Add inputRegisters.10006_DI_5: {"_id":"inputRegisters.10006_DI_5","type":"state","common":{"name":"DI 5","role":"state","type":"number","read":true,"write":false,"def":0,"unit":""},"native":{"regType":"inputRegs","address":10006,"deviceId":1,"type":"uint16be","len":1,"offset":0,"factor":1}} modbus.3 2024-05-05 10:04:22.653 debug Add inputRegisters.10005_DI_4: {"_id":"inputRegisters.10005_DI_4","type":"state","common":{"name":"\tDI 4","role":"state","type":"number","read":true,"write":false,"def":0,"unit":""},"native":{"regType":"inputRegs","address":10005,"deviceId":1,"type":"uint16be","len":1,"offset":0,"factor":1}} modbus.3 2024-05-05 10:04:22.652 debug Add inputRegisters.10004_DI_3: {"_id":"inputRegisters.10004_DI_3","type":"state","common":{"name":"DI 3","role":"state","type":"number","read":true,"write":false,"def":0,"unit":""},"native":{"regType":"inputRegs","address":10004,"deviceId":1,"type":"uint16be","len":1,"offset":0,"factor":1}} modbus.3 2024-05-05 10:04:22.652 debug Add inputRegisters.10003_DI_2: {"_id":"inputRegisters.10003_DI_2","type":"state","common":{"name":"\tDI 2","role":"state","type":"number","read":true,"write":false,"def":0,"unit":""},"native":{"regType":"inputRegs","address":10003,"deviceId":1,"type":"uint16be","len":1,"offset":0,"factor":1}} modbus.3 2024-05-05 10:04:22.652 debug Add inputRegisters.10002_DI_1: {"_id":"inputRegisters.10002_DI_1","type":"state","common":{"name":"DI 1","role":"state","type":"number","read":true,"write":false,"def":0,"unit":""},"native":{"regType":"inputRegs","address":10002,"deviceId":1,"type":"uint16be","len":1,"offset":0,"factor":1}} modbus.3 2024-05-05 10:04:22.652 debug Add inputRegisters.10001_DI_0: {"_id":"inputRegisters.10001_DI_0","type":"state","common":{"name":"DI 0","role":"state","type":"number","read":true,"write":false,"def":0,"unit":""},"native":{"regType":"inputRegs","address":10001,"deviceId":1,"type":"uint16be","len":1,"offset":0,"factor":1}} modbus.3 2024-05-05 10:04:22.651 debug Initialize Objects for inputRegs: [{"_address":10001,"name":"DI 0","description":"DI 0","unit":"","type":"uint16be","len":1,"factor":1,"offset":0,"formula":"","role":"state","room":"","cw":"","isScale":"","address":10001,"deviceId":1,"id":"inputRegisters.10001_DI_0"},{"_address":10002,"name":"DI 1","description":"DI 1","unit":"","type":"uint16be","len":1,"factor":1,"offset":0,"formula":"","role":"state","room":"","cw":"","isScale":"","address":10002,"deviceId":1,"id":"inputRegisters.10002_DI_1"},{"_address":10003,"name":"DI 2","description":"\tDI 2","unit":"","type":"uint16be","len":1,"factor":1,"offset":0,"formula":"","role":"state","room":"","cw":"","isScale":"","address":10003,"deviceId":1,"id":"inputRegisters.10003_DI_2"},{"_address":10004,"name":"DI 3","description":"DI 3","unit":"","type":"uint16be","len":1,"factor":1,"offset":0,"formula":"","role":"state","room":"","cw":"","isScale":"","address":10004,"deviceId":1,"id":"inputRegisters.10004_DI_3"},{"_address":10005,"name":"DI 4","description":"\tDI 4","unit":"","type":"uint16be","len":1,"factor":1,"offset":0,"formula":"","role":"state","room":"","cw":"","isScale":"","address":10005,"deviceId":1,"id":"inputRegisters.10005_DI_4"},{"_address":10006,"name":"DI 5","description":"DI 5","unit":"","type":"uint16be","len":1,"factor":1,"offset":0,"formula":"","role":"state","room":"","cw":"","isScale":"","address":10006,"deviceId":1,"id":"inputRegisters.10006_DI_5"},{"_address":10007,"name":"DI 6","description":"DI 6","unit":"","type":"uint16be","len":1,"factor":1,"offset":0,"formula":"","role":"state","room":"","cw":"","isScale":"","address":10007,"deviceId":1,"id":"inputRegisters.10007_DI_6"},{"_address":10008,"name":"DI 7","description":"DI 7","unit":"","type":"uint16be","len":1,"factor":1,"offset":0,"formula":"","role":"state","room":"","cw":"","isScale":"","address":10008,"deviceId":1,"id":"inputRegisters.10008_DI_7"}] modbus.3 2024-05-05 10:04:22.651 debug Initialize Objects for coils: [] modbus.3 2024-05-05 10:04:22.651 debug Initialize Objects for disInputs: [] modbus.3 2024-05-05 10:04:22.565 info starting. Version 6.1.0 in /opt/iobroker/node_modules/iobroker.modbus, node: v18.17.1, js-controller: 5.0.19 modbus.3 2024-05-05 10:04:22.503 info Plugin sentry Sentry Plugin disabled for this process because sending of statistic data is disabled for the system modbus.3 2024-05-05 10:04:22.500 debug Plugin sentry Initialize Plugin (enabled=true) host.ioBroker-VM 2024-05-05 10:04:21.750 info instance system.adapter.modbus.3 started with pid 20425 host.ioBroker-VM 2024-05-05 10:04:21.657 info "system.adapter.modbus.3" enabled
Aktuell nutze ich nur diese Eingangsregister.
Welche auch den Vorgaben entsprechen und mit den anderen beiden Methoden funktionieren.
-
@jb_mystery Function Code 2 sind Diskrete Eingänge.
Möglicherweise liegt hier schon dein Problem.
Ich würde aber auch nur mit einem Register Testen und erst wenn das Funktioniert würde ich weitere hinzufügen.
Was mich etwas stutzig macht ist das laut deinem Tool 8-Bit ausgelesen werden wenn ich das richtig interpretiere, im Dokument aber Unit16 steht.
-
@wendy2702
Das habe ich natürlich auch alles getestet. Es ändert sich nur die Warnmeldung. Handler 2 anstatt 4.modbus.3 2024-05-05 11:51:38.951 warn Error in handler for 2: RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds
Und als Diskrete Eingänge kann man ja keinen Typ mehr vorwählen.
Aber du hast Recht, komisch ist das mit den Bits und dem Dokument UINT 16. Aber Bits kann ich ja nicht im Adapter wählen.
Wenn ich alles auf UINT 8 umstelle, müsste ja 4 raus kommen.
Tut es auch in meinem Tool, nur der Adapter schluckt es leider auch nicht. -
Hat keiner mehr Ideen für mich?
Oder Tipps über Produkte die ich in ioBroker einbinden kann mit mindestens 16 Eingängen und 16 Ausgängen.
Danke euch.