Let me simplify a little just to explain things easier. The "machine" is a lamp controlled by an embedded MCU via a transfer layer consisting of a ESP8266. The start command will turn on the machine. The Stop command obviously turns off the light. Today this can be done with 100% reliability via 2 Inject nodes. It is confirmed both by the light following the command states and by me using a serial logger on the ESP tx output pin watching the data to the MCU.
The ESP has an internal TCP server and I use TCP IN node "name=f2 connect to IP,port" this server. (verified working by both displaying connected and actual machine on/off)
Injection of commands is done by Injection node "a-z A,1,B,2" ----> TCP OUT node "Reply to TCP name f2" ( same name as the server connection)
This part works great!
The barcode reader is on a TCP IN listen to port and I can see the barcode data arriving too.
I just do a simple Change on the message and send it to the same TCP Out as used by the Injection, here is where things stop to work.
But probably there is something basic I am missing.
Try to load this flow just for testing, it does not really show the problem that I have but I feel it may be related probably because I am not getting this:
[{"id":"dd89fd24.9eb4","type":"tcp out","z":"9b347dac.64153","host":"localhost","port":"7000","beserver":"server","base64":false,"end":false,"name":"server","x":830,"y":540,"wires":[]},{"id":"fb629f19.088f","type":"tcp in","z":"9b347dac.64153","name":"1","server":"client","host":"localhost","port":"7000","datamode":"stream","datatype":"buffer","newline":"","topic":"","base64":false,"x":630,"y":660,"wires":[["f32de17.376cb2"]]},{"id":"dc1924fa.c2f7f8","type":"inject","z":"9b347dac.64153","name":"MSG1","topic":"","payload":"This is message 1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":650,"y":540,"wires":[["dd89fd24.9eb4"]]},{"id":"f32de17.376cb2","type":"debug","z":"9b347dac.64153","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":850,"y":660,"wires":[]},{"id":"b8599052.34d2f","type":"tcp out","z":"9b347dac.64153","host":"localhost","port":"7000","beserver":"client","base64":false,"end":false,"name":"2","x":830,"y":600,"wires":[]},{"id":"b18227d1.341bc8","type":"inject","z":"9b347dac.64153","name":"MSG2","topic":"","payload":"This is message 2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":650,"y":600,"wires":[["b8599052.34d2f"]]},{"id":"9d448680.b73438","type":"tcp in","z":"9b347dac.64153","name":"3","server":"client","host":"localhost","port":"7000","datamode":"stream","datatype":"utf8","newline":"","topic":"","base64":false,"x":630,"y":720,"wires":[["3609bc3b.0ff724"]]},{"id":"3609bc3b.0ff724","type":"debug","z":"9b347dac.64153","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":850,"y":720,"wires":[]}]
Injection MSG1 to "server"---> Debug windows belonging to TCP IN (1) and TCP IN(3) will display correct string. One as string and one as bytes formats. EXPECTED RESULT
Injection MSG2 to TCP OUT(2) should in my opinion also show up in the debug windows belonging to each TCP IN. But for some reason this does not happen.
I feel like I really do not understand even the basics of TCP here.
So thank you for any ideas and even bigger thank you for your patience.