Chat freely about anything...

User avatar
By danbicks
#50596 Guys,

After reading lots on ESP and trailing through the data sheet it is apparent by default ESP only broadcasts UDP messages through the SoftAp interface. This can be changed by calling a function in the user_interface called: wifi_set_broadcast_if

It seems that what should be able to be set always returns false.

Is this an SDK issue or instancing through the IDE? Version SDK 1.5.4 IDE 1.6.8 Stageing build : 2.2.0-rc1

Example code to set interface:


Code: Select allvoid Start_UDP()
{
 
  bool IntSet = false;
  Udp.begin(localPort); // START UDP SERVER
  IntSet = wifi_set_broadcast_if (3);    //1:station; 2:soft-AP, 3:station+soft-AP
  delay(1000);

  if (IntSet)
  {
    Serial.println("Interface Set....");
  }
  else
  {
    Serial.println("Could not Set Interface....");
  }
  Serial.println("UDP 1 Server Started..");
}
User avatar
By danbicks
#53878 Guys,

Any updates on the previous thread? This is unlike Ray's Tardis, the mode of operation is not AP and communicates in station mode to other nodes on the network. It seems that UDP broadcast only works on the AP adapter and not the station.

Even after setting the wifi_set_broadcast_if function the interface does not change. Any ideas on this, would be brilliant for nodes to communicate with each other over a normal network router configuration.

Station mode does allow receipt of incoming UDP but not to re broadcast to a specific ip and port from a node.

Cheers

Dans