Incoming tcp binding not working

I am rather new to openHAB, so please bear with me if I have overlooked something obvious.

At any rate, I am having trouble setting up an incoming tcp connection. I have an OpenHAB 2 Openhabian Raspberry pi connected by hardwire ethernet. The openhab logs seem to indicate that the incoming data is being heard by the pi, but for some reason, the data is being dumped or otherwise not passed. Here is a copy of my relevant files:


sitemap default label="My home automation" {
    Frame label="Default" {
        Switch item=Lights icon="light"
        Switch item=Lights2 icon="light" label="Lights2" mappings=[0="P/R", 1="P/H", 2="Rel"]
        Switch item=test_switch_1 icon="light"
        Text item=LT_receive label="LT_Receive [%s]"


rule "LT Send Rule"
    // only process on a switch on state
    Item test_switch_1 changed to ON
        var String mymessage
        mymessage = "R,CTGSW,0122\r"
        logInfo("openhab", "test message sent:" + mymessage)
        logInfo("openhab", "test message received:[{}]", LT_receive)

rule "LT Receive Rule"
    // only process on a switch on state
    Item LT_receive received update
        logInfo("openhab", "test message received:[{}]" + LT_receive)


//Switch Lights "Test Light" { tcp=">[ON:'MAP('],  >[OFF:'MAP(']" }
//Number Lights2 "Test Light2 [%d]" { tcp=">['MAP(']" }

Switch test_switch_1 "Test Switch 1"

String LT_send "[%s]" { tcp=">['REGEX((.*))']" }
String LT_receive "[%s]" { tcp="<[*:'REGEX((.*))']" }


# all parameters can be applied to both the TCP and UDP binding unless
# specified otherwise

# Port to listen for incoming connections

# Cron-like string to reconnect remote ends, e.g for unstable connection or remote ends
#reconnectcron=0 0 0 * * ?

# Interval between reconnection attempts when recovering from a communication error,
# in seconds

# Queue data whilst recovering from a connection problem (TCP only)

# Maximum buffer size whilst reading incoming data

# Share connections within the Item binding configurations

# Share connections between Item binding configurations

# Share connections between inbound and outbound connections

# Allow masks in ip:port addressing, e.g.* etc

# Pre-amble that will be put in front of data being sent

# Post-amble that will be appended to data being sent

# 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

# timeout, in milliseconds, to wait for a reply when initiating a blocking write/read
#  operation

# Update the status of Items using the response received from the remote end (if the
# remote end sends replies to commands)

# Timeout - or 'refresh interval', in milliseconds, of the worker thread

# Timeout, in milliseconds, to wait when "Selecting" IO channels ready for communication

# Used character set

Relevant openhab.log

2017-10-26 22:32:54.577 [INFO ] [lipse.smarthome.model.script.openhab] - test message sent:R,CTGSW,0122
2017-10-26 22:32:54.587 [INFO ] [lipse.smarthome.model.script.openhab] - test message received:[LT_receive (Type=StringItem, State=NULL, Label=, Category=null)]
2017-10-26 22:32:54.979 [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread TCP Refresh Service
	at org.openhab.binding.tcp.protocol.internal.TCPBinding.parseBuffer([182:org.openhab.binding.tcp:1.10.0]
	at org.openhab.binding.tcp.AbstractSocketChannelBinding.parseChanneledBuffer([182:org.openhab.binding.tcp:1.10.0]
	at org.openhab.binding.tcp.AbstractSocketChannelBinding.execute([182:org.openhab.binding.tcp:1.10.0]
	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute([183:org.openhab.core.compat1x:2.1.0]
	at org.openhab.core.service.AbstractActiveService$[183:org.openhab.core.compat1x:2.1.0]

I am not sure why the data is not being passed to the script variable. Interestingly, when I comment out the first 2 items in the .items file and use .map files, tcp seems to update the incoming string variable, but due to limitations of my system, I cannot pass data using map files.

TCP is a really low-level binding that is sensitive to so many variables that it is unlikely I’ll be able to help.

However, if you use Design Pattern: Proxy Item and do the mapping or any other transformations in a Rule that might meet your needs.