po zabiciu wszystkich procesów dodać jeszcz "socat -d -d pty,link=/dev/tty10,raw,echo=0,waitslave tcp:192.168.86.7:500 &"?
uruchomić ponownie OH?
@szpila86 Tak i popraw konfigurację w OH. Poniższe polecenie powinno wyświetlić tylko jedną linikjkę z socat na początku:
ps w|grep socat
I oczywiście sprawdź, czy wszystko się zgadza w konfiguracji, mogłem coś pomylić (parametry transmisji, adresy, nry portów).
[~] # ps w|grep socat
20526 admin 2368 S grep socat
[~] #
Teraz pisze tylko że połączenie z hostem nie powiodło się
@szpila86 To może adres bramki się nie zgadza lub port?
Możesz wkleić cały komunikat?
Spróbuj uruchomić socat bez & na końcu polecenia.
Nawet z openhab@192.168.86.60 8101 nie da się połączyć
[~] # socat -d -d pty,link=/dev/tty10,raw,echo=0,waitslave tcp:192.168.86.7:500
2021/01/18 21:27:38 socat[3773] N PTY is /dev/pts/5
^C2021/01/18 21:28:21 socat[3773] N socat_signal(): handling signal 2
2021/01/18 21:28:21 socat[3773] N exiting on signal 2
2021/01/18 21:28:21 socat[3773] N socat_signal(): finishing signal 2
2021/01/18 21:28:21 socat[3773] N exit(130)
[~] # ps w|grep socat
4626 admin 236 S grep socat
[~] #
Nie szybciej odinstalować OH z QNAP i ponownie zainstalować?
@szpila86 W ogóle Ci OH nie startuje?
A z konsoli QNAP działa
ssh -p 8101 openhab@localhost
?
Uparcie linkuje do /dev/pts/5 zamiast do /dev/tty10. Spóbuj jeszcze w OH zmienić /dev/tty10 na /dev/pty/5
Ja wymiękam. Chyba łatwiej będzie kupić konwerter obsługujący MODBUS.
Zatrzymaj OH z panelu QNAPa i uruchom ponownie.
Odinstalowałem całkowicie OH
po ponownym zainstalowaniu wróciła konsola ale dalej nie idzie się połączyć z komórki z OH
"Uzgadnianie SSL nie powiodło się - może potrzebujesz właściwego certyfikatu klienta"
Wróciło! Nie wiem co się odwaliło ale na dziś PASS :/
OK inny konwerter...
ustawienia:
things
Bridge modbus:tcp:localhostTCP [ host="192.168.86.200", port=4196, id=4 ] {
Bridge poller holding [ start=16, length=3, refresh=500, type="holding" ] {
Thing data index5 [ readStart="16", readValueType="int16" ]
}
}
Items
String VoPower "Stan [%d]" { channel="modbus:data:localhostTCP:holding:index5:number" }
Brak logów
05:47:39.235 [INFO ] [del.core.internal.ModelRepositoryImpl] - Refreshing model 'modbus.things'
gdy zmienię ip na .201
05:50:45.947 [INFO ] [del.core.internal.ModelRepositoryImpl] - Refreshing model 'modbus.things'
05:50:46.029 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:tcp:localhostTCP' changed from ONLINE to OFFLINE
05:50:46.031 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:poller:localhostTCP:holding' changed from ONLINE to OFFLINE
05:50:46.038 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:tcp:localhostTCP' changed from OFFLINE to ONLINE
05:50:46.040 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:poller:localhostTCP:holding' changed from OFFLINE to ONLINE
05:50:46.042 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:poller:localhostTCP:holding' changed from ONLINE to OFFLINE
05:50:46.043 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:data:localhostTCP:holding:index5' changed from ONLINE to OFFLINE (BRIDGE_OFFLINE): No online bridge
05:50:46.045 [INFO ] [smarthome.event.ThingUpdatedEvent ] - Thing 'modbus:tcp:localhostTCP' has been updated.
05:50:46.047 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:poller:localhostTCP:holding' changed from OFFLINE to ONLINE
05:50:46.048 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:data:localhostTCP:holding:index5' changed from OFFLINE (BRIDGE_OFFLINE): No online bridge to ONLINE
05:50:49.113 [ERROR] [ling.ModbusSlaveConnectionFactoryImpl] - connect try 1/1 error: No route to host (Host unreachable). Connection TCPMasterConnection@79e87845[socket=Socket[unconnected]]. Endpoint ModbusTCPSlaveEndpoint@23ef8f32[address=192.168.86.201,port=4196]
05:50:49.116 [ERROR] [ling.ModbusSlaveConnectionFactoryImpl] - re-connect reached max tries 1, throwing last error: No route to host (Host unreachable). Connection TCPMasterConnection@79e87845[socket=Socket[unconnected]]. Endpoint ModbusTCPSlaveEndpoint@23ef8f32[address=192.168.86.201,port=4196]
05:50:49.118 [ERROR] [ling.ModbusSlaveConnectionFactoryImpl] - Error connecting connection TCPMasterConnection@79e87845[socket=Socket[unconnected]] for endpoint ModbusTCPSlaveEndpoint@23ef8f32[address=192.168.86.201,port=4196]: No route to host (Host unreachable)
05:50:49.120 [WARN ] [ort.modbus.internal.ModbusManagerImpl] - Could not connect to endpoint ModbusTCPSlaveEndpoint@23ef8f32[address=192.168.86.201,port=4196] -- aborting request ModbusReadRequestBlueprint@360afa2[slaveId=4,functionCode=READ_MULTIPLE_REGISTERS,start=16,length=3,maxTries=3] [operation ID 2a3ea5b2-46f9-4d43-b92d-68b9d4af270e]
05:50:49.124 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:data:localhostTCP:holding:index5' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Error (ModbusConnectionException) with read. Request: ModbusReadRequestBlueprint@360afa2[slaveId=4,functionCode=READ_MULTIPLE_REGISTERS,start=16,length=3,maxTries=3]. Description: ModbusConnectionException(Error connecting to endpoint=ModbusTCPSlaveEndpoint@23ef8f32[address=192.168.86.201,port=4196]). Message: Error connecting to endpoint ModbusTCPSlaveEndpoint@23ef8f32[address=192.168.86.201,port=4196]
05:50:49.126 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:poller:localhostTCP:holding' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Error with read: org.openhab.io.transport.modbus.exception.ModbusConnectionException: Error connecting to endpoint ModbusTCPSlaveEndpoint@23ef8f32[address=192.168.86.201,port=4196]
05:50:49.127 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:data:localhostTCP:holding:index5' changed from OFFLINE (COMMUNICATION_ERROR): Error (ModbusConnectionException) with read. Request: ModbusReadRequestBlueprint@360afa2[slaveId=4,functionCode=READ_MULTIPLE_REGISTERS,start=16,length=3,maxTries=3]. Description: ModbusConnectionException(Error connecting to endpoint=ModbusTCPSlaveEndpoint@23ef8f32[address=192.168.86.201,port=4196]). Message: Error connecting to endpoint ModbusTCPSlaveEndpoint@23ef8f32[address=192.168.86.201,port=4196] to OFFLINE (BRIDGE_OFFLINE): No online bridge
05:50:52.185 [ERROR] [ling.ModbusSlaveConnectionFactoryImpl] - connect try 1/1 error: No route to host (Host unreachable). Connection TCPMasterConnection@3970d299[socket=Socket[unconnected]]. Endpoint ModbusTCPSlaveEndpoint@23ef8f32[address=192.168.86.201,port=4196]
05:50:52.187 [ERROR] [ling.ModbusSlaveConnectionFactoryImpl] - re-connect reached max tries 1, throwing last error: No route to host (Host unreachable). Connection TCPMasterConnection@3970d299[socket=Socket[unconnected]]. Endpoint ModbusTCPSlaveEndpoint@23ef8f32[address=192.168.86.201,port=4196]
05:50:52.189 [ERROR] [ling.ModbusSlaveConnectionFactoryImpl] - Error connecting connection TCPMasterConnection@3970d299[socket=Socket[unconnected]] for endpoint ModbusTCPSlaveEndpoint@23ef8f32[address=192.168.86.201,port=4196]: No route to host (Host unreachable)
05:50:52.190 [WARN ] [ort.modbus.internal.ModbusManagerImpl] - Could not connect to endpoint ModbusTCPSlaveEndpoint@23ef8f32[address=192.168.86.201,port=4196] -- aborting request ModbusReadRequestBlueprint@78a1006b[slaveId=4,functionCode=READ_MULTIPLE_REGISTERS,start=16,length=3,maxTries=3] [operation ID a6812a45-fe9c-4cab-9278-350c66b26480]
@szpila86 Jak zmienisz IP na prawidłowe to zrestartuj OH. U mnie zawsze są jakieś hocki-klocki, jak nie zrestartuję OH przy grzebaniu przy MODBUSie. A to nie odświeża, a to nie te things są przekazywane do items - istny cyrk.
Konfiguracja wygląda na prawidłową, mam tylko wątpliwości, czy na pewno parity ma być even - ustawiłeś tak w Volcano? Próbowałeś jakimś programem zrobić odczyt z bramki (nie w OH)?
Nie próbowałem.
IP 201 i po restarcie OH
14:56:22.779 [INFO ] [ort.modbus.internal.ModbusManagerImpl] - Modbus manager ac tivated
14:56:23.008 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:tcp:local hostTCP' changed from UNINITIALIZED to INITIALIZING
14:56:23.033 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:tcp:local hostTCP' changed from INITIALIZING to ONLINE
14:56:23.047 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:poller:lo calhostTCP:holding' changed from UNINITIALIZED to INITIALIZING
14:56:23.066 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:poller:lo calhostTCP:holding' changed from INITIALIZING to ONLINE
14:56:23.096 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:data:loca lhostTCP:holding:index5' changed from UNINITIALIZED to INITIALIZING
14:56:23.170 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:data:loca lhostTCP:holding:index5' changed from INITIALIZING to ONLINE
14:56:25.107 [INFO ] [nternal.scheduler.WeatherJobScheduler] - Starting and sche duling weatherJob-home with interval of 6 minutes
14:56:26.201 [ERROR] [ling.ModbusSlaveConnectionFactoryImpl] - connect try 1/1 e rror: No route to host (Host unreachable). Connection TCPMasterConnection@151bf2 cf[socket=Socket[unconnected]]. Endpoint ModbusTCPSlaveEndpoint@24c0568a[address =192.168.86.201,port=4196]
14:56:26.204 [ERROR] [ling.ModbusSlaveConnectionFactoryImpl] - re-connect reache d max tries 1, throwing last error: No route to host (Host unreachable). Connect ion TCPMasterConnection@151bf2cf[socket=Socket[unconnected]]. Endpoint ModbusTCP SlaveEndpoint@24c0568a[address=192.168.86.201,port=4196]
14:56:26.206 [ERROR] [ling.ModbusSlaveConnectionFactoryImpl] - Error connecting connection TCPMasterConnection@151bf2cf[socket=Socket[unconnected]] for endpoint ModbusTCPSlaveEndpoint@24c0568a[address=192.168.86.201,port=4196]: No route to host (Host unreachable)
14:56:26.213 [WARN ] [ort.modbus.internal.ModbusManagerImpl] - Could not connect to endpoint ModbusTCPSlaveEndpoint@24c0568a[address=192.168.86.201,port=4196] - - aborting request ModbusReadRequestBlueprint@6d8bcf85[slaveId=4,functionCode=RE AD_MULTIPLE_REGISTERS,start=16,length=3,maxTries=3] [operation ID b564b984-5b85- 4a3e-beb3-389ca3e45b00]
14:56:26.230 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:data:loca lhostTCP:holding:index5' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): E rror (ModbusConnectionException) with read. Request: ModbusReadRequestBlueprint@ 6d8bcf85[slaveId=4,functionCode=READ_MULTIPLE_REGISTERS,start=16,length=3,maxTri es=3]. Description: ModbusConnectionException(Error connecting to endpoint=Modbu sTCPSlaveEndpoint@24c0568a[address=192.168.86.201,port=4196]). Message: Error co nnecting to endpoint ModbusTCPSlaveEndpoint@24c0568a[address=192.168.86.201,port =4196]
14:56:26.234 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:poller:lo calhostTCP:holding' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Error with read: org.openhab.io.transport.modbus.exception.ModbusConnectionException: Error connecting to endpoint ModbusTCPSlaveEndpoint@24c0568a[address=192.168.86. 201,port=4196]
14:56:26.237 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'modbus:data:loca lhostTCP:holding:index5' changed from OFFLINE (COMMUNICATION_ERROR): Error (Modb usConnectionException) with read. Request: ModbusReadRequestBlueprint@6d8bcf85[s laveId=4,functionCode=READ_MULTIPLE_REGISTERS,start=16,length=3,maxTries=3]. Des cription: ModbusConnectionException(Error connecting to endpoint=ModbusTCPSlaveE ndpoint@24c0568a[address=192.168.86.201,port=4196]). Message: Error connecting t o endpoint ModbusTCPSlaveEndpoint@24c0568a[address=192.168.86.201,port=4196] to OFFLINE (BRIDGE_OFFLINE): No online bridge
14:56:27.853 [ERROR] [.ui.internal.items.ItemUIRegistryImpl] - Cannot retrieve v isibility item tryMe for widget org.eclipse.smarthome.model.sitemap.sitemap.Swit ch
14:56:29.272 [ERROR] [ling.ModbusSlaveConnectionFactoryImpl] - connect try 1/1 e rror: No route to host (Host unreachable). Connection TCPMasterConnection@2da540 48[socket=Socket[unconnected]]. Endpoint ModbusTCPSlaveEndpoint@24c0568a[address =192.168.86.201,port=4196]
14:56:29.275 [ERROR] [ling.ModbusSlaveConnectionFactoryImpl] - re-connect reache d max tries 1, throwing last error: No route to host (Host unreachable). Connect ion TCPMasterConnection@2da54048[socket=Socket[unconnected]]. Endpoint ModbusTCP SlaveEndpoint@24c0568a[address=192.168.86.201,port=4196]
14:56:29.282 [ERROR] [ling.ModbusSlaveConnectionFactoryImpl] - Error connecting connection TCPMasterConnection@2da54048[socket=Socket[unconnected]] for endpoint ModbusTCPSlaveEndpoint@24c0568a[address=192.168.86.201,port=4196]: No route to host (Host unreachable)
14:56:29.290 [WARN ] [ort.modbus.internal.ModbusManagerImpl] - Could not connect to endpoint ModbusTCPSlaveEndpoint@24c0568a[address=192.168.86.201,port=4196] - - aborting request ModbusReadRequestBlueprint@6d8bcf85[slaveId=4,functionCode=RE AD_MULTIPLE_REGISTERS,start=16,length=3,maxTries=3] [operation ID e3f9f4d3-49d0- 46e3-b376-a37a4ba24d74]
@szpila86 Według tego, co mi przysłałeś na priw bramka ma adres 192.168.86.200, popraw i zrestartuj OH.
Spróbuj najpierw coś odczytać z poziomu komputera używając tego programu https://sourceforge.net/projects/qmodmaster/
Ustaw Modbus mode TCP, TCP Settings Slave IP 192.168.86.200, TCP Port 4196, Unit ID 4, Function Code Read Holding Registers, Start Address 17 (u mnie jest przesunięcie o 1 w adresacji w stosunku do tego co mam w OpenHAB), Number Of Registers 1.
Potem Connect i jeśli nie będzie błędu to Read/Write.
Zweryfikuj, czy masz Parity ustawione w ZLANie tak samo jak w Volcano.
Na poprzedniej stronie podałem link do skanera Modbus może będzie łatwiej on skanuje i podaje dostępne rejestry.
Przy okazji znalazłem właśnie najprostszy konwerter protokołów w tym Modbus na MQTT. Potrzebny jest ESP8266 lub jak kto woli Sonoff i Tasmota
https://tasmota.github.io/docs/Smart-Meter-Interface/
podłączasz tylko konwerter RS 485 na TTL. Będę testował z EBUS i piec Vaillanta, tylko konwerter muszę zmontować.