Need a method to connect a lot of esp8266 together

i have about 25 modules that use esp8266 and currently i am using the softap on an esp8266 to handle linking up 8 of the devices. but the esp8266 cannot handle more than 8 active clients at 1 time. what can i do about this?

here i asked a similar question

I have 4 ESP32's at various locations in my house that send and receive data from a RPi4. The RPi4 running MQTT Broker and a Python script, running on the RPi4, to handle the message routing.

Use a standard router to handle the network and as Idahowalker suggests a Raspberry Pi as MQTT broker.

MQTT is a scaleable publish/subscribe protocol and has awesome support for all kinds of platforms from Arduino, PC, MAC, Raspberry Pi to cloud solutions. There is support in multiple programming languages as well.

https://mqtt.org/

This seems like a good overview for your case:

how often do you need to communicate with the clients?
could you simply open a TCP connection to each client in turn, receive the data and then close the connection?
is the communication two way? if not could the clients transmit UDP datagrams?

the problem im having is that the esp8266 can only have 8 active connections at 1 time. for me this means only 8 nodes. Its look more and more like nrf24 but i just hate the idea of the nrf24

do you need them all active all the time? could you cycle thru the 25 stations in a loop opening, communicating then closing the TCP connection? or use UDP datagrams?

horace:
do you need them all active all the time? could you cycle thru the 25 stations in a loop opening, communicating then closing the TCP connection? or use UDP datagrams?

i already use UDP for my communication. yes i would like to receive data from every module once a second.

how could i get the master esp8266 to discover modules over a local network

notsolowki:
i already use UDP for my communication. yes i would like to receive data from every module once a second.

one UDP server can receive data from multiple clients

notsolowki:
how could i get the master esp8266 to discover modules over a local network

could do a scan pinging each IP address in turn?

notsolowki:
how could i get the master esp8266 to discover modules over a local network

Have a look at MQTT. Every node just sends information to the MQTT broker and/or subscribes to topics. The MQTT brokers collects the information and distributes it for you. You can easily add new nodes, replace one that is broken or remove some that are no longer necessary.

I guess you missed this advice:

Use a standard router to handle the network

based on your description your issue is the limitation of the softAP ... not the parallel acceptance of UDP clients when they are already connected to the same wifi

notsolowki:
how could i get the master esp8266 to discover modules over a local network

you could get the master to poll each client in turn
e.g. this program sends a UDP datagram to a sequence of IP addresses

// udpSendSequence - send UDP datagram to a range of IP addresses 
#include <SPI.h>         // needed for Arduino versions later than 0018
#include <Ethernet.h>
#include <EthernetUdp.h>         // UDP library from: bjoern@cs.stanford.edu 12/30/2008

// Enter a MAC address and IP address for your controller below.
byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(192, 168, 1, 177);

unsigned int localPort = 8888;      // local port to listen on

char packet[]="hello client";;

void setup() {  
    Ethernet.begin(mac, ip);    // start the Ethernet 
    Serial.begin(115200);
    Serial.println("send UDP datagram to a range of IP addresses ");
    EthernetUDP Udp; 
    // send a datagram to a range of clients
    for(int ip=90; ip<100;ip++) {
      // send a datagram to the IP address and port 
      IPAddress ipRemote(192, 168, 1,  ip);
      Serial.print("udpSendStruct - send a structure to remote UDP IP = ");
      Serial.println(ipRemote);
      Udp.begin(localPort);                 // start UDP
      Udp.beginPacket(ipRemote, 999);       // send datagram
      Udp.write((byte *)&packet, sizeof(packet));
      Udp.endPacket();
      Udp.stop();
    }
}

void loop() {}

a run gives

send UDP datagram to a range of IP addresses 
udpSendStruct - send a structure to remote UDP IP = 192.168.1.90
udpSendStruct - send a structure to remote UDP IP = 192.168.1.91
udpSendStruct - send a structure to remote UDP IP = 192.168.1.92
udpSendStruct - send a structure to remote UDP IP = 192.168.1.93
udpSendStruct - send a structure to remote UDP IP = 192.168.1.94
udpSendStruct - send a structure to remote UDP IP = 192.168.1.95
udpSendStruct - send a structure to remote UDP IP = 192.168.1.96
udpSendStruct - send a structure to remote UDP IP = 192.168.1.97
udpSendStruct - send a structure to remote UDP IP = 192.168.1.98
udpSendStruct - send a structure to remote UDP IP = 192.168.1.99

and a PC (IP 192.168.1.96) on the network displays

UDP datagram length 13  from IP /192.168.1.177 received: hello client

on receipt of a datagram the clients could reply

in a similar application some years back we had a factory with 100+ machines
the operators would enter data on a keypad indicating job number etc and the machine could report broken tools etc - this information would be sent using UDP datagrams to a central server/database
each machine had a number set up using a DIL switch reflected in its MAC address and IP, e.g.
machine 1 MAC { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 1}; IPAddress ip(192, 168, 1, 1);
machine 2 MAC { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 2}; IPAddress ip(192, 168, 1, 2);
etc
if nothing was heard from a machine for some time an alert would be generated

horace:
you could get the master to poll each client in turn

This would require you to program the master with knowledge of the slaves existence. So, every time you add a new node you would need to change something in the master. It is much easier to tell the slaves to report to the master. The master can then build a list of all the slaves.

in an similar application of a master receiving data from multiple slaves (100+) using UDP a central database was updated when a slave was added - therefore if the slave failed to communicate within a specified period an alert was enabled