TCP binding: unable to get any output

Hi all,

I’m currently running OpenHab 2.2 in Docker and I’m having some trouble to get the TCP binding to work.

Observations:

  • My ubuntu VM which runs Docker is able to send TCP packets to the destination device (verified using WireShark on the host machine) so I’m excluding firewall as a possible root cause.

  • OpenHAB doesn’t log any error on the item or binding configuration

  • the input for the item is read using Modbus and this works fine (item state is updated on change)

  • I have the eventbus extented using MQTT and can see that the command for the item comes through

  • No TCP traffic is generated by the OpenHAB binding (verified with WireShark)

Configuration:

  • item (V1)

Switch DO_01_1 “Kitchenlight”
{ modbus="<[Wago750_DO:0]",
WagoTCP=">[ON:192.168.1.16:2000:‘ABC’], >[OFF:192.168.1.16:2000:‘DEF’]", autoupdate=“false”}

  • item (V2)

Switch DO_01_1 “Kitchenlight”
{ modbus="<[Wago750_DO:0]",
WagoTCP=">[ON:192.168.1.16:2000:‘MAP(wagomap.map)’], >[OFF:192.168.1.16:2000:‘MAP(wagomap.map)’]", autoupdate=“false”}

  • map for item V2 (wagomap.map)

ON=\u0024
OFF=\u0023

  • tcp binding config

# all parameters can be applied to both the TCP and UDP binding unless
# specified otherwise
# Port to listen for incoming connections
WagoTcp.port=2000
# Cron-like string to reconnect remote ends, e.g for unstable connection or remote ends
# WagoTcp.reconnectcron=0 0 0 * * ?
# Interval between reconnection attempts when recovering from a communication error,
# in seconds
WagoTcp.retryinterval=5
# Queue data whilst recovering from a connection problem (TCP only)
WagoTcp.queue=true
# Maximum buffer size whilst reading incoming data
WagoTcp.buffersize=1024
# Share connections within the Item binding configurations
WagoTcp.itemsharedconnections=true
# Share connections between Item binding configurations
WagoTcp.bindingsharedconnections=true
# Share connections between inbound and outbound connections
WagoTcp.directionssharedconnections=true
# Allow masks in ip:port addressing, e.g. 192.168.0.1:* etc
WagoTcp.addressmask=true
# Pre-amble that will be put in front of data being sent
WagoTcp.preamble=X
# Post-amble that will be appended to data being sent
WagoTcp.postamble=Y
# Perform all write/read (send/receive) operations in a blocking mode, e.g. the binding
# will wait for a reply from the remote end after data has been sent
WagoTcp.blocking=false
# timeout, in milliseconds, to wait for a reply when initiating a blocking write/read
# operation
WagoTcp.timeout=3000
# Update the status of Items using the response received from the remote end (if the
# remote end sends replies to commands)
WagoTcp.updatewithresponse=false
# Timeout - or 'refresh interval', in milliseconds, of the worker thread
WagoTcp.refreshinterval=250
# Timeout, in milliseconds, to wait when "Selecting" IO channels ready for communication
WagoTcp.selecttimeout=1000
# Used character set
WagoTcp.charset=ASCII

Would anyone have any idea why this is occuring or how to troubleshoot this further? I’m stuck here :slight_smile:

Note: in the docker-compose file there’s an gap configured for port 2000, yet this shouldn’t be necessary in the first place as it’s an outbound connection out of the container.

Any assistance is much appreciated!

looks like I was overthinking this, commenting everything in my tcp.cfg file and using ‘tcp’ in my item configuration got things working.