-->
Page 3 of 4

Re: Finding an ESP8266 on a network

PostPosted: Thu Oct 01, 2015 5:53 am
by DNITKE
Quick question: Can the ESP have a concurrent UDP listener on one port (listening for those broadcast packets) and a TCP talker (web server) on another?

Re: Finding an ESP8266 on a network

PostPosted: Mon Oct 05, 2015 3:37 am
by Chris Carter
I was unable to have two simultaneous UDP listeners, but I haven't tried what you're describing

Re: Finding an ESP8266 on a network

PostPosted: Thu Sep 01, 2016 6:34 am
by ShantanuJ
Is there a way that I can compare the data in (packetBuffer) to perform end device actions?

for eg:
Code: Select allif (packetBuffer == "turnON"){
digitalWrite(Led,HIGH);
}

Re: Finding an ESP8266 on a network

PostPosted: Thu Sep 01, 2016 8:28 am
by martinayotte
ShantanuJ wrote:Is there a way that I can compare the data in (packetBuffer) to perform end device actions?

for eg:
Code: Select allif (packetBuffer == "turnON"){
digitalWrite(Led,HIGH);
}

You need to learn a bit more about C/C++ syntax ... :ugeek:
If packetBuffer is defined as "char packetBuffer[128];" for example, your code will never work because it is comparing pointer, not the actual data.
If packetBuffer is a String, the code will succeed only when that data is a perfect match, but since other characters can be present at the end, such CR+LF, it will also fail.
You need to do a " if (packetBuffer.startWith("turnON") ", again, assuming that packetBuffer is a String.