Cannot retrieve data using client.readStringUntil('\a');

hello, I am having problems retrieving data from another esp8266 to an esp8266 that contains temp data from a dht22 sensor. Here is what I am trying to do more specifically: I have an esp8266 that has a nextion lcd hooked up to it that will retrieve data from 2 dht22 temperature sensors. The esp8266 will also send commands to turn on/off digital pins on the esp8266. Basicly, one of the esp8266's only has the nextion display hooked up to it(this esp is configured as the acces point) and the other esp has all the electronics(dht22 sensors and the relays that I will put on there).
I am able to send commands to turn on/off digital pins but I am having problems sending the data to the other esp in order to write that data to the nextion lcd. Below is the code for the Accespoint(the one retrieving the sensor data and sending the comamnds for the digital pins):
code for accespoint: //this is the acces point#include <doxygen.h>#include <NexButton.h>#includ - Pastebin.com

And below is the code for the other esp(The station point which has the dht22 sensors hooked up to it):
code for stationpoint: #include <DHT.h>#include <DHT_U.h>#include <ESP8266WiFi.h>#define DHTPIN - Pastebin.com

Cannot retrieve data using client.readStringUntil('\a');

What terminator character is '\a'?

It looks like two characters to me: a backslash and a lower case a.

Oops, changed it to '\r' but it still is not working.
This is where I send the data from the DHT22 to the other ESP:

client.println(Serial.println(String(t)+'\\r'));

And here is the line that retrieves the data from the esp that sended the dht22 data to it.

String tempOutside=client.readStringUntil('\r');

Not an ESP user :wink:

What does Serial.println() return? On an Arduino, the number of bytes transmitted so that is what you're sending with client.println().

Please note that println() adds an additional "\r\n" (at least, on Arduinos, not sure about ESP).

Let's say the data from the temperature from the snesor reads 29 degrees. It first prints the temperature then prints what is sent to the AccesPoint, so in this case where the temperature is 29, it will send 29\r
Edit: Also even if "\n" is added at the end it should not matter since the es should stop reading the data when "\r" appears.

this will send out to the client whatever the Serial.print() function returns (the number of bytes written)

client.println(Serial.println(String(t)+'\\r'));

that's probably NOT what you want to do...

try client.println(String(t)+'\r')); not a double anti-slash and no Serial Print in the client print !!

and it's not really needed as println with also add \r\n so you endup sending the string t followed by \r\n\r

I did as J_M_L said but nothing still won't show up on the serial monitor of the Acces Point. This is the code that should read the data and print it, is there something wrong with it?

  String tempOutside=client.readStringUntil('\r');
  Serial.println("tempOutside: ");
  Serial.println(tempOutside);

Don't post snippets (Snippets R Us!)

My bad but this is the same code(with the modifications you suggested) as in the main question, below are the links to PasteBin(it is too long to just paste in here)
Code to acces point: //this is the acces point#include <doxygen.h>#include <NexButton.h>#includ - Pastebin.com
Code to station point: https://pastebin.com/9U57ZSdj

My bad and sorry for that!