user40000: I'm using 3 ESP8266 for my project: one ESP8266 is a server and controls any action.
I want to be able to connect to any ESP8266 with a phone and if that ESP8266 is a client, send data to the server.
I'm using TCP/IP for communication between ESP8266 models and ESP8266 with PC or phone.
My problem is with the number of clients. In ESP8266, a maximum of 5 TCP clients can connect to a server, and my master ESP8266 is using 2 (to connect to the other ESP8266), so that just leaves 3 clients (PC or phone) that can connect to the master ESP8266.
Is there any way to increase the number of clients?
Is there any alternative for communicating between ESP8266 models other than TCP/IP and leave 5 clients in ESP8266 for the user to connect?

user10394: If I understand correctly the problem is only 5 clients can connect to an ESP8266 at any one time.  This is an early morning solution to the problem and to be honest I haven't though it through that much, but hopefully its a starting point.
Rather than having all the clients in the mesh connect to the Master node, run an aggregation service on the slaves.  One slave will accept connections fro up to 4 other slaves and it will forward the data to the master.  If you ever wanted more than 5 slave nodes you would need to have the aggregator nodes feeding into another aggregator (like a tree structure). Its quite easy to do statically, but could be tricky if you wanted to do it dynamically.  These aggregators might need to be dedicated nodes, it depends on traffic.
That leaves the master 4 connections for clients.  If that isn't enough then you could send the data from the master to additional ESP8266s acting as dedicated webservers and get the clients to connect to them instead.  There may even be a method of sharing the load between these two web servers in the same way as proper servers do.

40000: <p>I'm using 3 ESP8266 for my project: one ESP8266 is a server and controls any action.</p>

<p>I want to be able to connect to any ESP8266 with a phone and if that ESP8266 is a client, send data to the server.</p>

<p>I'm using TCP/IP for communication between ESP8266 models and ESP8266 with PC or phone.</p>

<p>My problem is with the number of clients. In ESP8266, a maximum of 5 TCP clients can connect to a server, and my master ESP8266 is using 2 (to connect to the other ESP8266), so that just leaves 3 clients (PC or phone) that can connect to the master ESP8266.</p>

<p>Is there any way to increase the number of clients?</p>

<p>Is there any alternative for communicating between ESP8266 models other than TCP/IP and leave 5 clients in ESP8266 for the user to connect?</p>
 10394: <p>If I understand correctly the problem is only 5 clients can connect to an ESP8266 at any one time.  This is an early morning solution to the problem and to be honest I haven't though it through that much, but hopefully its a starting point.</p>

<p>Rather than having all the clients in the mesh connect to the Master node, run an aggregation service on the slaves.  One slave will accept connections fro up to 4 other slaves and it will forward the data to the master.  If you ever wanted more than 5 slave nodes you would need to have the aggregator nodes feeding into another aggregator (like a tree structure). Its quite easy to do statically, but could be tricky if you wanted to do it dynamically.  These aggregators might need to be dedicated nodes, it depends on traffic.</p>

<p>That leaves the master 4 connections for clients.  If that isn't enough then you could send the data from the master to additional ESP8266s acting as dedicated webservers and get the clients to connect to them instead.  There may even be a method of sharing the load between these two web servers in the same way as proper servers do.</p>
