I'm trying to send a String from the ESP8266 TO an Arduino. The string is collected with a GET request and this works. BUT whenever I try to send this String to an Arduino over Serial, I get a blank screen.
yes, i use the same functions to communicate from the arduino to the esp. That does work. But the other way around doesn't. No data at all in the Serial monitor
while (ArduinoUno.available() > 0 && newData == false) {
rc = ArduinoUno.read();
Serial.print(rc); // add this to see what, if anything, is coming into the port
if (recvInProgress == true) {
What is printed in the Uno serial monitor? Anything?
What do you get, from the ESP8266 code, when you print the payload that the GET request returns?
String payload = http.getString(); //Get the request response payload
Serial.println(payload): // add a print to see what gets sent to the Uno ***************
NodeMCU.print("<");
groundFungus:
What do you get, from the ESP8266 code, when you print the payload that the GET request returns?
String payload = http.getString(); //Get the request response payload
Serial.println(payload): // add a print to see what gets sent to the Uno ***************
NodeMCU.print("<");
This gives me a (json) String in the serial monitor, which is the data I want te send to the Arduino. Somehow it won't transfer this data to my Arduino serial
Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.
The technique in the 3rd example will be the most reliable. It is what I use for Arduino to Arduino and Arduino to PC communication.
You can send data in a compatible format with code like this (or the equivalent in any other programming language)
Robin2:
Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.
The technique in the 3rd example will be the most reliable. It is what I use for Arduino to Arduino and Arduino to PC communication.
You can send data in a compatible format with code like this (or the equivalent in any other programming language)
Serial.print('<'); // start marker
Serial.print(value1);
Serial.print(','); // comma separator
Serial.print(value2);
Serial.println('>'); // end marker
...R
Thank you but I have already made a project where I send data FROM my Arduino TO my ESP using seperators.
However in this project I try to send data the other way around (from ESP to Arduino). This does not work, even such a simple example. (The link that you sent doesn't cover this)