Authentication required using Modbus TCP Connection?

  • Platform information:
    • Hardware: Raspberry PI
    • OS: openhabian
    • Java Runtime Environment: openjdk version “11.0.11” 2021-04-20 LTS
    • openHAB version: openHAB 3.1.0
  • Issue of the topic: I want to access my SMA Inverter Tripower 8000 using the modbus binding. The log of ModbusSlaveConnectionFactoryImpl tells, that initially a connection was established but on subsequent connects it always reports “connect timed out”. My inverter does not use the default password “0000” for user “User”. Can anybody tell me if an authentication is required that the binding can communicate with the inverter and if so, how can I configure it?
  • Please post configurations (if applicable):
    • Things configuration related to the issue
Bridge modbus:tcp:sma "SMA" @ "Modbus" [ host="192.168.178.29", port=502, id=3, connectMaxTries=3] {

// SMA Inverter Device Type
	Bridge poller DevType              [ start=30053, length=4, refresh=5000, type="input" ] {
	    	Thing data type            [ readStart="30053", readValueType="uint32" ] 
  	 }

// SMA Inverter Status
	Bridge poller SMA_Status           [ start=30201, length=36, refresh=6000, type="input" ] {
               Thing data status           [ readStart="30201", readValueType="int32" ]
               Thing data Grid_Contactor   [ readStart="30217", readValueType="int32" ]

               Thing data Max_Power        [ readStart="30231", readValueType="int32" ]
               Thing data Set_Max_Power    [ readStart="30233", readValueType="int32" ]
  	 }

// SMA Inverter Operation
	Bridge poller SMA_Operation           [ start=33001, length=36, refresh=6000, type="input" ] {
               Thing data Standby           [ readStart="33001", readValueType="uint32" ]
               Thing data Betrieb   [ readStart="33003", readValueType="uint32" ]
  	 }

// SMA Inverter Temperatur
Bridge poller SMA_Temp_Innen          [ start=30953, length=2, refresh=6000, type="input" ] {
			Thing data Temp1    [ readStart="30954", readValueType="int16", readTransform="JS(divide10.js)" ]
 }
Bridge poller SMA_Temp_Kuehl          [ start=34113, length=2, refresh=6000, type="input" ] {
			Thing data Temp2    [ readStart="34114", readValueType="int16", readTransform="JS(divide10.js)" ]
 }
// SMA Inverter Yield
	Bridge poller Yield                [ start=30517, length=16, refresh=5000, type="input" ] {
               Thing data Day_Yield        [ readStart="30517", readValueType="int64", readTransform="JS(divide1000.js)" ]
               Thing data Total_Yield      [ readStart="30529", readValueType="int32", readTransform="JS(divide1000.js)" ]
   	 }

// SMA Inverter Power Section A
	Bridge poller power_a              [ start=30769, length=20, refresh=5000, type="input" ] {
	       Thing data current_input    [ readStart="30769", readValueType="int32", readTransform="JS(smalimit1000.js)" ]
	       Thing data voltage_input    [ readStart="30771", readValueType="uint32", readTransform="JS(smalimit100A.js)" ]
	       Thing data power_west       [ readStart="30773", readValueType="int32", readTransform="JS(smalimit1000.js)"]
	       Thing data active_power     [ readStart="30775", readValueType="int32", readTransform="JS(smalimit1000.js)" ]
		Thing data active_powerWatt     [ readStart="30775", readValueType="int32", readTransform="JS(smalimit.js)" ]
	       Thing data power_L1         [ readStart="30777", readValueType="int32", readTransform="JS(smalimit1000.js)" ]
	       Thing data power_L2         [ readStart="30779", readValueType="int32", readTransform="JS(smalimit1000.js)" ]
	       Thing data power_L3         [ readStart="30781", readValueType="int32", readTransform="JS(smalimit1000.js)" ]
	       Thing data volt_G1          [ readStart="30783", readValueType="uint32", readTransform="JS(smalimit100A.js)" ]
	       Thing data volt_G2          [ readStart="30785", readValueType="uint32", readTransform="JS(smalimit100A.js)" ]
	       Thing data volt_G3          [ readStart="30787", readValueType="uint32", readTransform="JS(smalimit100A.js)"]
  	 }

// SMA Inverter Power B
	Bridge poller power_b              [ start=30957, length=8, refresh=5000, type="input" ] {
    Thing data currentB_input   [ readStart="30957", readValueType="int32", readTransform="JS(smalimit1000.js)" ]
	Thing data voltageB_input   [ readStart="30959", readValueType="int32", readTransform="JS(smalimit100.js)" ]
	Thing data power_east       [ readStart="30961", readValueType="int32", readTransform="JS(smalimit1000.js)" ] 
   	 }


// SMA Inverter Operation
	Bridge poller SMA_Status_Operate   [ start=40029, length=4, refresh=5000, type="holding" ] {
	       Thing data operatestatus    [ readStart="40029", readValueType="uint32" ]
   	 }

Bridge poller SunSpecTest   [ start=40200, length=4, refresh=5000, type="holding" ] {
	       Thing data Amp    [ readStart="40200", readValueType="int16" ]
   	 }


// SMA Inverter Operation
	Bridge poller SMA_Betriebszeit   [ start=30521, length=8, refresh=5000, type="input" ] {

	       Thing data Betriebszeit   [ readStart="30521", readValueType="uint64", readTransform="JS(divide3600.js)" ]
			Thing data Einspeisezeit  [ readStart="30525", readValueType="uint64", readTransform="JS(divide3600.js)" ]
   	 }
}
  • Sitemap configuration related to the issue
  • Rules code related to the issue
  • Services configuration related to the issue
  • If logs where generated please post these here using code fences:
2021-07-22 14:35:10.836 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - bundle org.openhab.core.io.transport.modbus:3.1.0 (302)[org.openhab.core.io.transport.modbus.internal.ModbusManagerImpl] : BundleComponentActivator : ComponentHolder created.

2021-07-22 14:35:10.852 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - bundle org.openhab.core.io.transport.modbus:3.1.0 (302)[org.openhab.core.io.transport.modbus.internal.ModbusManagerImpl] : Component created: DS=DS13, implementation=org.openhab.core.io.transport.modbus.internal.ModbusManagerImpl, immediate=false, default-enabled=true, factory=null, configuration-policy=optional, activate=activate, deactivate=deactivate, modified=null configuration-pid=[transport.modbus]

...

2021-07-22 14:35:11.201 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - bundle org.openhab.core.io.transport.modbus:3.1.0 (302)[org.openhab.core.io.transport.modbus.internal.ModbusManagerImpl(351)] : Changed state from satisfied to active

2021-07-22 14:35:11.214 [TRACE] [ternal.ModbusManagerImpl.PollMonitor] - POLL MONITOR: scheduledThreadPoolExecutor queue size: 0, remaining space 2147483647. Active threads 1

2021-07-22 14:35:11.217 [TRACE] [ternal.ModbusManagerImpl.PollMonitor] - </POLL MONITOR>

2021-07-22 14:35:12.032 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registering poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30053, length=4, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@acdde7, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@acdde7] with period 5000 using initial delay 0

2021-07-22 14:35:12.046 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - Executing scheduled (5000ms) poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30053, length=4, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@acdde7, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@acdde7]. Current millis: 1626957312046

2021-07-22 14:35:12.056 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Starting new operation with task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30053, length=4, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@acdde7, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@acdde7]. Trying to get connection [operation ID c545bda6-b5e4-4b12-b76f-169f91c87cb4]

2021-07-22 14:35:12.060 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Executing task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30053, length=4, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@acdde7, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@acdde7] (oneOff=false)! Waiting for connection. Idle connections for this endpoint: 0, and active 0 [operation ID c545bda6-b5e4-4b12-b76f-169f91c87cb4]

2021-07-22 14:35:12.063 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registered poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30053, length=4, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@acdde7, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@acdde7] with period 5000 using initial delay 0

2021-07-22 14:35:12.100 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registering poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30201, length=36, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@16e3a07, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@16e3a07] with period 6000 using initial delay 0

2021-07-22 14:35:12.103 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - Executing scheduled (6000ms) poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30201, length=36, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@16e3a07, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@16e3a07]. Current millis: 1626957312103

2021-07-22 14:35:12.104 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registered poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30201, length=36, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@16e3a07, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@16e3a07] with period 6000 using initial delay 0

2021-07-22 14:35:12.109 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Starting new operation with task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30201, length=36, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@16e3a07, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@16e3a07]. Trying to get connection [operation ID 6622532d-67ed-4cbe-8351-88497256bec6]

2021-07-22 14:35:12.113 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Executing task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30201, length=36, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@16e3a07, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@16e3a07] (oneOff=false)! Waiting for connection. Idle connections for this endpoint: 0, and active 0 [operation ID 6622532d-67ed-4cbe-8351-88497256bec6]

2021-07-22 14:35:12.127 [TRACE] [ing.ModbusSlaveConnectionFactoryImpl] - Created connection TCPMasterConnection [m_Socket=null, m_Timeout=3000, m_Connected=false, m_Address=/192.168.178.29, m_Port=502, m_ModbusTransport=null, m_ConnectTimeoutMillis=10000, rtuEncoded=false] for endpoint ModbusIPSlaveEndpoint [address=192.168.178.29, port=502]

2021-07-22 14:35:12.145 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registering poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=33001, length=36, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@1cf1481, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@1cf1481] with period 6000 using initial delay 0

2021-07-22 14:35:12.148 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - Executing scheduled (6000ms) poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=33001, length=36, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@1cf1481, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@1cf1481]. Current millis: 1626957312148

2021-07-22 14:35:12.152 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Starting new operation with task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=33001, length=36, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@1cf1481, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@1cf1481]. Trying to get connection [operation ID c66f0e6b-93a8-41df-8b08-a7579648e315]

2021-07-22 14:35:12.156 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Executing task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=33001, length=36, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@1cf1481, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@1cf1481] (oneOff=false)! Waiting for connection. Idle connections for this endpoint: 0, and active 1 [operation ID c66f0e6b-93a8-41df-8b08-a7579648e315]

2021-07-22 14:35:12.161 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registered poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=33001, length=36, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@1cf1481, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@1cf1481] with period 6000 using initial delay 0

2021-07-22 14:35:12.193 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registering poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30953, length=2, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@70cefd, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@70cefd] with period 6000 using initial delay 0

2021-07-22 14:35:12.195 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registered poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30953, length=2, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@70cefd, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@70cefd] with period 6000 using initial delay 0

2021-07-22 14:35:12.196 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - Executing scheduled (6000ms) poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30953, length=2, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@70cefd, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@70cefd]. Current millis: 1626957312195

2021-07-22 14:35:12.200 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Starting new operation with task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30953, length=2, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@70cefd, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@70cefd]. Trying to get connection [operation ID 8d653481-795b-4877-9cc6-320a95386542]

2021-07-22 14:35:12.205 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Executing task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30953, length=2, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@70cefd, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@70cefd] (oneOff=false)! Waiting for connection. Idle connections for this endpoint: 0, and active 1 [operation ID 8d653481-795b-4877-9cc6-320a95386542]

2021-07-22 14:35:12.239 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registering poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=34113, length=2, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@670c3c, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@670c3c] with period 6000 using initial delay 0

2021-07-22 14:35:12.241 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - Executing scheduled (6000ms) poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=34113, length=2, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@670c3c, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@670c3c]. Current millis: 1626957312241

2021-07-22 14:35:12.244 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Starting new operation with task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=34113, length=2, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@670c3c, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@670c3c]. Trying to get connection [operation ID 00bb2c28-908b-4c9a-a1ee-aa53cd1f6359]

2021-07-22 14:35:12.246 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registered poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=34113, length=2, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@670c3c, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@670c3c] with period 6000 using initial delay 0

2021-07-22 14:35:12.248 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Executing task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=34113, length=2, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@670c3c, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@670c3c] (oneOff=false)! Waiting for connection. Idle connections for this endpoint: 0, and active 1 [operation ID 00bb2c28-908b-4c9a-a1ee-aa53cd1f6359]

2021-07-22 14:35:11.930 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:tcp:sma' changed from UNINITIALIZED to INITIALIZING

2021-07-22 14:35:11.975 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:tcp:sma' changed from INITIALIZING to ONLINE

2021-07-22 14:35:11.996 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:poller:sma:DevType' changed from UNINITIALIZED to INITIALIZING

2021-07-22 14:35:12.070 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:poller:sma:DevType' changed from INITIALIZING to ONLINE

2021-07-22 14:35:12.078 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:poller:sma:SMA_Status' changed from UNINITIALIZED to INITIALIZING

2021-07-22 14:35:12.113 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:poller:sma:SMA_Status' changed from INITIALIZING to ONLINE

2021-07-22 14:35:12.121 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:poller:sma:SMA_Operation' changed from UNINITIALIZED to INITIALIZING

2021-07-22 14:35:12.166 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:poller:sma:SMA_Operation' changed from INITIALIZING to ONLINE

2021-07-22 14:35:12.171 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:poller:sma:SMA_Temp_Innen' changed from UNINITIALIZED to INITIALIZING

2021-07-22 14:35:12.201 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:poller:sma:SMA_Temp_Innen' changed from INITIALIZING to ONLINE

2021-07-22 14:35:12.216 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:poller:sma:SMA_Temp_Kuehl' changed from UNINITIALIZED to INITIALIZING

2021-07-22 14:35:12.418 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:poller:sma:SMA_Temp_Kuehl' changed from INITIALIZING to ONLINE

2021-07-22 14:35:12.497 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registering poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30517, length=16, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@15761ed, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@15761ed] with period 5000 using initial delay 0

2021-07-22 14:35:12.500 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registered poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30517, length=16, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@15761ed, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@15761ed] with period 5000 using initial delay 0

2021-07-22 14:35:12.571 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registering poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30769, length=20, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@8dd130, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@8dd130] with period 5000 using initial delay 0

2021-07-22 14:35:12.582 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registered poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30769, length=20, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@8dd130, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@8dd130] with period 5000 using initial delay 0

2021-07-22 14:35:12.627 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registering poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30957, length=8, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@ecedba, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@ecedba] with period 5000 using initial delay 0

2021-07-22 14:35:12.630 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registered poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30957, length=8, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@ecedba, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@ecedba] with period 5000 using initial delay 0

2021-07-22 14:35:12.668 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registering poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_MULTIPLE_REGISTERS, start=40029, length=4, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@16f7, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@16f7] with period 5000 using initial delay 0

2021-07-22 14:35:12.672 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registered poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_MULTIPLE_REGISTERS, start=40029, length=4, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@16f7, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@16f7] with period 5000 using initial delay 0

2021-07-22 14:35:12.715 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registering poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_MULTIPLE_REGISTERS, start=40200, length=4, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@ea143f, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@ea143f] with period 5000 using initial delay 0

2021-07-22 14:35:12.719 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registered poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_MULTIPLE_REGISTERS, start=40200, length=4, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@ea143f, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@ea143f] with period 5000 using initial delay 0

2021-07-22 14:35:12.759 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registering poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30521, length=8, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@180b2a5, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@180b2a5] with period 5000 using initial delay 0

2021-07-22 14:35:12.762 [TRACE] [rt.modbus.internal.ModbusManagerImpl] - Registered poll task BasicPollTask [getEndpoint=ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], request=ModbusReadRequestBlueprint [slaveId=3, functionCode=READ_INPUT_REGISTERS, start=30521, length=8, maxTries=3], getResultCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@180b2a5, getFailureCallback()=org.openhab.binding.modbus.handler.ModbusPollerThingHandler$ReadCallbackDelegator@180b2a5] with period 5000 using initial delay 0

2021-07-22 14:35:12.437 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:poller:sma:Yield' changed from UNINITIALIZED to INITIALIZING

2021-07-22 14:35:12.517 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:poller:sma:Yield' changed from INITIALIZING to ONLINE

2021-07-22 14:35:12.532 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:poller:sma:power_a' changed from UNINITIALIZED to INITIALIZING

2021-07-22 14:35:12.588 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:poller:sma:power_a' changed from INITIALIZING to ONLINE

...

2021-07-22 14:35:13.826 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:data:sma:SMA_Betriebszeit:Betriebszeit' changed from INITIALIZING to ONLINE

2021-07-22 14:35:13.831 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:data:sma:SMA_Betriebszeit:Einspeisezeit' changed from UNINITIALIZED to INITIALIZING

2021-07-22 14:35:13.849 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:data:sma:SMA_Betriebszeit:Einspeisezeit' changed from INITIALIZING to ONLINE

2021-07-22 14:35:22.152 [WARN ] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 1/3 error: connect timed out. Connection TCPMasterConnection [m_Socket=Socket[unconnected], m_Timeout=3000, m_Connected=false, m_Address=/192.168.178.29, m_Port=502, m_ModbusTransport=null, m_ConnectTimeoutMillis=10000, rtuEncoded=false]. Endpoint ModbusIPSlaveEndpoint [address=192.168.178.29, port=502]

2021-07-22 14:35:22.215 [TRACE] [ing.ModbusSlaveConnectionFactoryImpl] - Waited 60ms (interConnectDelayMillis 0ms, interTransactionDelayMillis 60ms) before connecting disconnected connection TCPMasterConnection [m_Socket=Socket[unconnected], m_Timeout=3000, m_Connected=false, m_Address=/192.168.178.29, m_Port=502, m_ModbusTransport=null, m_ConnectTimeoutMillis=10000, rtuEncoded=false] for endpoint ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], to allow delay between connections re-connects

2021-07-22 14:35:32.222 [WARN ] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 2/3 error: connect timed out. Connection TCPMasterConnection [m_Socket=Socket[unconnected], m_Timeout=3000, m_Connected=false, m_Address=/192.168.178.29, m_Port=502, m_ModbusTransport=null, m_ConnectTimeoutMillis=10000, rtuEncoded=false]. Endpoint ModbusIPSlaveEndpoint [address=192.168.178.29, port=502]

2021-07-22 14:35:32.286 [TRACE] [ing.ModbusSlaveConnectionFactoryImpl] - Waited 60ms (interConnectDelayMillis 0ms, interTransactionDelayMillis 60ms) before connecting disconnected connection TCPMasterConnection [m_Socket=Socket[unconnected], m_Timeout=3000, m_Connected=false, m_Address=/192.168.178.29, m_Port=502, m_ModbusTransport=null, m_ConnectTimeoutMillis=10000, rtuEncoded=false] for endpoint ModbusIPSlaveEndpoint [address=192.168.178.29, port=502], to allow delay between connections re-connects

2021-07-22 14:35:42.303 [WARN ] [ing.ModbusSlaveConnectionFactoryImpl] - connect try 3/3 error: connect timed out. Connection TCPMasterConnection [m_Socket=Socket[unconnected], m_Timeout=3000, m_Connected=false, m_Address=/192.168.178.29, m_Port=502, m_ModbusTransport=null, m_ConnectTimeoutMillis=10000, rtuEncoded=false]. Endpoint ModbusIPSlaveEndpoint [address=192.168.178.29, port=502]

2021-07-22 14:35:42.312 [ERROR] [ing.ModbusSlaveConnectionFactoryImpl] - re-connect reached max tries 3, throwing last error: connect timed out. Connection TCPMasterConnection [m_Socket=Socket[unconnected], m_Timeout=3000, m_Connected=false, m_Address=/192.168.178.29, m_Port=502, m_ModbusTransport=null, m_ConnectTimeoutMillis=10000, rtuEncoded=false]. Endpoint ModbusIPSlaveEndpoint [address=192.168.178.29, port=502]


There is no means to authenticate within Modbus-TCP protocol.

I don’t see any “connection established”. Are you trying to talk between different IP subnets?

Here’s the log entry:

2021-07-22 14:35:12.127 [TRACE] [ing.ModbusSlaveConnectionFactoryImpl] - Created connection TCPMasterConnection [m_Socket=null, m_Timeout=3000, m_Connected=false, m_Address=/192.168.178.29, m_Port=502, m_ModbusTransport=null, m_ConnectTimeoutMillis=10000, rtuEncoded=false] for endpoint ModbusIPSlaveEndpoint [address=192.168.178.29, port=502]

I don’t use subnets.

Creating a TCP connection is like buying a ticket, not making a journey. I don’t see any “connection established”. OpenHAB isn’t going to do anything with that until it attempts a real data transfer - your first poll. Which seems to fail and never work.

The target device is on subnet 178. What’s your OH host on?

192.168.178.36

Okay, looks good.
Try connecting with other means (openHAB makes a poor Modbus tester).
Try a ping from your host.
Try a tool like Modbus poll from your host.

ping from my raspberry pi works.
Communication from the SMA client “Sunny Explorer” (at my Windows10 PC) to the inverter also works.

Works in what way? I.e. what are the details of what you did?

You’ll have seen the various threads about SMA and modbus here, so you know it works for other people and most likely your problem is so.e small detail.

Hello rossko57,
I totally believe that the modbus binding works. Nevertheless, I cannot get it working.

Here is what I did on my openhab machine:

openhabian@openHABianDevice:~ $ ping 192.168.178.29
PING 192.168.178.29 (192.168.178.29) 56(84) bytes of data.
64 bytes from 192.168.178.29: icmp_seq=1 ttl=64 time=3.92 ms
64 bytes from 192.168.178.29: icmp_seq=2 ttl=64 time=8.50 ms
64 bytes from 192.168.178.29: icmp_seq=3 ttl=64 time=7.23 ms
64 bytes from 192.168.178.29: icmp_seq=4 ttl=64 time=6.10 ms
64 bytes from 192.168.178.29: icmp_seq=5 ttl=64 time=5.20 ms
64 bytes from 192.168.178.29: icmp_seq=6 ttl=64 time=3.71 ms
64 bytes from 192.168.178.29: icmp_seq=7 ttl=64 time=7.73 ms
64 bytes from 192.168.178.29: icmp_seq=8 ttl=64 time=6.37 ms
64 bytes from 192.168.178.29: icmp_seq=9 ttl=64 time=5.24 ms
64 bytes from 192.168.178.29: icmp_seq=10 ttl=64 time=4.21 ms
64 bytes from 192.168.178.29: icmp_seq=11 ttl=64 time=2.82 ms
^C
--- 192.168.178.29 ping statistics ---
11 packets transmitted, 11 received, 0% packet loss, time 21ms
rtt min/avg/max/mdev = 2.823/5.547/8.502/1.728 ms

The Sunny Explorer is a GUI tool from SMA to monitor the inverter. It works perfectly. I receive all data available on the inverter.

In my mind something in my things configuration is wrong. Host, port and id are correct, they are exactly the same as the values reported by the Sunny Explorer.

But not using Modbus.

To repeat, it will be easier to verify Modbus oiperation using some other tool…

You understand that Modbus is disabled on every SMA as delivered, and needs to be enabled?

That’s not the problem. I also use a self written java server which talks to the inverter using modbus. It writes the data to a database and works since more than 2 years without any problem.

Alright, if you won’t use some modbus master tool from your pi, then use wireshark to satisfy yourself what openHAB sends over your network, and what response it gets.

There is not much to go wrong in your config; IP/port/ID , poller start/type.

Note that some devices only permit one TCP connection at a time. Are you competing with your self-written service?

I double checked the inverter configuration (using Sunny Explorer). It seems that the library I use communicates using Webconnect, not the TCP server. The TCP server is disabled. Now I understand why the connect fails.

For enabling of the TCP server I need an installer password. I hope that I can get it from my installer.

Thanks a lot for your help.

1 Like