I'm trying to send data from my esp to my arduino using serial using the following codes :
esp :
server.on("/drive",HTTP_GET, handleDrive);
void handleDrive()
{
server.send(200,"text/html", "Drive!");
String sendToArduino = "";
for (int i=0;i<server.args();i++)
{
sendToArduino = sendToArduino+server.argName(i)+"="+sendToArduino.arg(i)+"&";
}
Serial.println(sendToArduino);
}
and on arduino :
Serial.begin(9600);
esp8266.begin(115200);
if (esp8266.available())
{
String readString="";
while (esp8266.available())
{
delay(2);
char c = esp8266.read();
readString += c;
}
}
but when i send data from esp to arduino i get it with "noise"
Ex : "variable1=1234" i recive it on arduino "variab@e=12"
What can i make to make sure that what i send is same in arduino ?