I am using the TCP nodes to solve something that would be super easy in MQTT. Why? Because the "server" side hardware does not support MQTT and there is nothing I can do about that fact.
Case: An IOT device is hosing a server on a fixed IP and PORT, there is only one connection active in the device so I do not need to figure out the end client. Communication can be initiated either by the IOT or Nodered. Nodered is connected to several similar IOT devices but using different IP to each but same PORT on the IOT.
Problem: If I use TCPin and TCPout nodes I can connect to IOT, receive a message from an IOT. When replying I face the _session problem so messages get sent to more or less everywhere.
So I use the TCPrequest node. This works really well, all communication is separated but it does not auto connect to the remote server. This node does Connect and Send in sequence. Because the IOT device is a bit slow I loose the first package and if "Never close" option is selected the next package gets delivered because the socket is already open.
So my questions are how do I get around this? Is there any way to make the TCPrequest node auto connect in a similar way as the TCPin node? Or how do I lock an connected TCPin node to a corresponding TCPout node before I have received any data in the TCPin node? Because as I understand there is no message sent when the TCPin node makes connect?
Help??
Other than this, no problem.....