title: Broadcasting messages via UDP over esp8266
body: <p>I am connecting 4 nodemcu (esp8266). 1 esp8266 is used as access point and others are connected to it. </p>
  
  <p>When I send UDP packets as a broadcast message to all the esp8266 via with esp8266 as access point it is not recieved by the others however when I use a home router or even by mobile hotspot as access point, the broadcast messages are received by the other esp8266.
  <strong>Also, I have posted here a part of my code that is used for UDP so there may be some variables that you will see as undeclared but they are originally declared and the code is working when I connect it with Access Point that is not esp8266</strong></p>
  
  <p>Code For Access Point:
      #include </p>
  
  <pre><code>void setup()
  {
  Serial.begin(115200);
  Serial.println();
  
  Serial.print("Setting soft-AP ... ");
  boolean result = WiFi.softAP("ssid", "password123456");
  if(result == true)
  {
  Serial.println("Ready");
  }
  else
  {
  Serial.println("Failed!");
  }
  }
  
  void loop()
  {
  Serial.printf("Stations connected = %d\n", 
  WiFi.softAPgetStationNum());
  delay(3000);
  }
  </code></pre>
  
  <p>Code for sending UPD packet as broadcast:</p>
  
  <pre><code>unsigned int localPort = 2000;
  IPAddress SendIP(192,168,43,255);
  setup()
  {
  udp.begin(localPort);
  Serial.print("Local port: ");
  Serial.println(udp.localPort());
  }
  loop()
  {
  udp.beginPacket(SendIP, 2000); 
  
  udp.write("p"); 
  udp.endPacket();
  }
  </code></pre>
  
  <p>Code for Recieving UDP packets:</p>
  
  <pre><code>void loop()
  {
  
  
  int packetSize = udp.parsePacket();
  if(packetSize)
  {
  udp.read(packetBuffer,UDP_TX_PACKET_MAX_SIZE);
  p = packetBuffer[0];
  Serial.println(p);
  function();
  
  
  }
  </code></pre>
  
  <p>Please tell me whats the problem with using esp8266 as access point to send UDP packets.
  And if esp8266 can not be used please tell me any other chip that can do the work, I want to make a portable system so I cannot use the router.</p>