Go Down

Topic: Node MCU 8266 Client server, how to compare received msg (Read 837 times) previous topic - next topic

rahulkp1986

Hello all
im trying to switch cases with received text from client

Code: [Select]
while(1)
      {

     
       
        if(TKDClient.available())
        {
          // Here We Read The Message
          String Message = TKDClient.readStringUntil('\r');
          // Here We Print The Message On The Screen
          Serial.println(Message);
  if(Message == ALRM1)
  {
Serial.println(" Alarm from client-1") 
  }
 
         
          TKDClient.print("\nWe Got Your Message");
          TKDClient.flush();
        }
       


Above is my core, im trying to compare received message
but its not working
can anyone help

Juraj

You can't write an Arduino sketch if you didn't learn programming. Not the language, but the concepts of programming - algorithms and data types.

rahulkp1986

ALRM1? is the string that im sending from client

PaulS

ALRM1? is the string that im sending from client
No, it isn't. The String from the client is Message.
The art of getting good answers lies in asking good questions.

Go Up