Hello Jörg,
Thanks for your reply.
I actually want to connect to a plc via modbus tcp port 510
I tried via port 510 after that I tried 502, so when copying my log
I manually changed the port value, so I messed up here a little bit.
Today I tried with another program (Modbus poll) and I can communicate with
the plc at 192.168.10.222 port 510, so that is OK.
Then I changed the modbus config from ‘slave1’ into ‘plc’ and now
the error of the baudrate is solved.
Buth when I alter the config file sometimes ‘slave1’ shows up again instead of 'plc’
I seems like OH2 gets sometimes older configs to work with, its very confusing.
Please take a look to my config and logs
Thanks
Luigi
# sets refresh interval to Modbus polling service.
# Value in milliseconds (optional, defaults to 200)
poll=10000
## Example of Modbus TCP slave
# Connection parameters to Modbus TCP server ("slave"), values separated by colon (:)
# - host or ip of the modbus server ("slave"), mandatory
# - port, optional, default 502
# - interTransactionDelayMillis, optional, in milliseconds, default 60
# - reconnectAfterMillis, optional, in milliseconds, default 0
# - interConnectDelayMillis, optional, in milliseconds, default 0
# - connectMaxTries, optional, default 3
# - connectTimeout, optional, in milliseconds, default 0 (=infinite or OS default)
#
# As a general rule, usually only host needs to be specified. Parameters other than host
# and port should be overridden only in cases when extreme performance is required, or when there are
# errors with the default parameter values.
#
# See wiki for more details.
#
#
#
# (slave name) (host or IP)
# | | (port)
# | | | (interTransactionDelayMillis, in milliseconds)
# | | | | (reconnectAfterMillis, in milliseconds)
# | | | | | (interConnectDelayMillis, in milliseconds)
# | | | | | | (connectMaxTries)
# | | | | | | | (connectTimeout)
# | | | | | | | |
tcp.plc.connection=192.168.10.222:502:60:0:0:3:100
# The data type, can be "coil" "discrete" "holding" "input". See wiki for more details.
tcp.plc.type=holding
# The slave id (optional, defaults to '1')
tcp.plc.id=1
# The slave start address (optional, defaults to '0')
tcp.plc.start=1
# The number of data item to read
# (optional, defaults to '0' - but set it to something meaningful)
tcp.plc.length=1
# Value type, required for combined registers (details: http://www.simplymodbus.ca/FAQ.htm#Types)
# Can be "bit", "int8", "uint8", "int16", "uint16", "int32", "uint32", "float32"
# (optional, defaults to 'uint16')
#tcp.plc.valuetype=uint16
# For other slave parameters, consult the wiki.
## Example of Modbus Serial slave
# Connection parameters to Modbus Serial server ("slave"), values separated by colon (:)
# - serial port, mandatory. Example: /dev/ttyS0 (linux) or COM3 (windows)
# - baudRate, optional, default 9600
# - dataBits, optional, in milliseconds, default 8
# - parity, optional, default none
# - stopBits, optional, default 1
# - encoding, optional, default rtu
# - interTransactionDelayMillis, optional, in milliseconds, default 35
# - receiveTimeoutMillis, optional, in milliseconds, default 1500
# - flowControlIn, optional, default none
# - flowControlOut, optional, default none
#
# As a general rule, usually one needs to specify serial port, baudRate, dataBits, parity, stopBits, and encoding. Other parameters
# should be overriden only in cases when extreme performance is required, or when there are
# errors with the default parameter values.
#
# See wiki for more details.
#
#
#
# (slave name) (host or IP)
# | | (baud)
# | | | (dataBits)
# | | | | (parity)
# | | | | | (stopBits)
# | | | | | | (encoding)
# | | | | | | | (interTransactionDelayMillis)
# | | | | | | | | (receiveTimeoutMillis)
# | | | | | | | | | (flowControlIn)
# | | | | | | | | | | (flowControlOut)
# | | | | | | | | | | |
# | | | | | | | | | | |
#serial.slave1.connection=/dev/ttyS0:38400:8:none:1:rtu:35:1500:none:none
# The data type, can be "coil" "discrete" "holding" "input". See wiki for more details.
#serial.slave1.type=holding
# The slave id (optional, defaults to '1')
#serial.slave1.id=
# The slave start address (optional, defaults to '0')
#serial.slave1.start=501
# The number of data item to read
# (optional, defaults to '0' - but set it to something meaningful)
#serial.slave1.length=10
# Value type, required for combined registers (details: http://www.simplymodbus.ca/FAQ.htm#Types)
# Can be "bit", "int8", "uint8", "int16", "uint16", "int32", "uint32", "float32"
# (optional, defaults to 'uint16')
#serial.slave1.valuetype=
# For other slave parameters, consult the wiki.
here are the logs:
2018-02-18 11:04:29.530 [WARN ] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (plc): Error getting a new connection for endpoint ModbusTCPSlaveEndpoint@55839e[address=192.168.10.222,port=502]. Error was: Unable to validate object
2018-02-18 11:04:29.532 [WARN ] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (plc) not connected -- aborting read request net.wimpi.modbus.msg.ReadMultipleRegistersRequest@17fe992. Endpoint ModbusTCPSlaveEndpoint@55839e[address=192.168.10.222,port=502]
ten after changing only the poll interval;
2018-02-18 11:04:19.079 [WARN ] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (slave1): Error getting a new connection for endpoint ModbusSerialSlaveEndpoint@14c08ae[portName=192.168.10.222]. Error was: Unable to validate object
2018-02-18 11:04:19.081 [WARN ] [.binding.modbus.internal.ModbusSlave] - ModbusSlave (slave1) not connected -- aborting read request net.wimpi.modbus.msg.ReadMultipleRegistersRequest@132eb0. Endpoint ModbusSerialSlaveEndpoint@14c08ae[portName=192.168.10.222]