Is there any solid reason why you wish to use TCP?
If it is just to send values back and forth, MQTT might be a better solution (no need to handle disconnections etc)
It is very easy to get going with MQTT.
This would help get you started (if you need a leg up)...
1 Like