if ( String(IDES) == " 13 75 6C ED" ) {
Name = "First Student " ;
Number = "1" ;
}
You are reading one byte at a time (storing it in int IDES) then you expect that 4 hexvalues are stored in IDES and start comparing it, what makes you think it would work ?
2 issues, first if " 13 75 6C ED" is the string that shows up in the Serial monitor and you want to compare that then
if (Serial2.available()) // something has been received
{
String ID="";
while (Serial2.available()) { // while there is something in the buffer
char c = Serial2.read();
Serial.write(c); // echo
ID += c; // add to the String
if (!Serial2.available()) { // if the buffer is empty wait for at least 1 more byte
delayMicroseconds(1200); // for BAUD 9600
yield();
}
}
if ( String(ID) == " 13 75 6C ED" ) { // and now start to compare
Name = "First Student " ;
Number = "1" ;
}
}
at least reads all characters that are and may become available to the buffer (issue 1) and store all of them in a String which can be compared (issue 2) '
Using readString() would read you a whole String in one go but then you should wait for a complete string to have arrived. Of course this code is a blocking form of Serial reception. But can work as proof of concept comparing " 13 75 6C ED" also compares the presence of the spaces. (is this the exact String ?)
So eh the wire connection between the 2 nodeMCU's works ? great ! this seems like a completely different issue. You should start a new topic. And when you do, please don't this
if (Serial2.available()) // something has been received
{ Serial.write (Serial2.read());
CardID = Serial2.read();
a curly brace should not have code behind it on the same line.
http.end(); //Close connection
}}
do not put more than 1 curly brace on a line and have them on a line by them self. It is difficult enough reading someone else 's code without these sort of things.
Deva_Rishi:
So eh the wire connection between the 2 nodeMCU's works ? great ! this seems like a completely different issue. You should start a new topic. And when you do, please don't this
if (Serial2.available()) // something has been received
a curly brace should not have code behind it on the same line.
http.end(); //Close connection
}}
do not put more than 1 curly brace on a line and have them on a line by them self. It is difficult enough reading someone else 's code without these sort of things.