How do I get all the response values for the AT command?

I connected the Lora module and the Arduino,
I'm using the 'AT command' to check the response to the request.
However, since there are many receiving quantities, they can not receive all.
but they are cut off in the middle.
How can I get it all?

An example of one of the reaction parameters is as follows.
(Since there are many AT command types, the following parameters always change)


D: Device Type: 00000000
D: Serial Number: 00000000
D: Network ID: 00000000
D: ID1: 00000000
D: ID2: 00000000
D: ID3: 00000000
D: ID4: 00000000
D: Spectral Factor: 00000000
D: Output Power: 00000000
D: Report Period= 00000000
D: RS: 00000000
D: Repeater ID = 00000000
D: Mode = 00000000
D: Enable = 00000000
D: Slot Period = 00000000
D: Manually Set Slot Time = 00000000
D: Manually Set Uploading Time as Repeater= 00000000
D: of Repeating Slots = 00000000
D: Enable = 00000000
D: UART1 baud: 9600[baud]
D: Loop back Control: 1
D: Version Number: v.10.0


only I can get about 4 lines

D: Device Type: 00000000
D: Serial Number: 00000000
D: Network ID: 00000000
D: ID1: 00000000


my code is...

bool Flag01 = true;
void setup() {
  Serial.begin(115200);
  Serial2.begin(9600);
}

void loop() {
  if(!Flag01){
    LoRa_Manual_Display("$AT01");
    Serial.println("Flag01");
  }
}

void LoRa_Manual_Display(String str) {
  
  String rc;
  Serial2.println(str);
  while (Serial2.available ()> 0)
  {
     rc = Serial2.readStringUntil('\n');
     Serial.println(rc);
  }
   
  Flag01 = true;
  rc = "";
}
void serialEvent() {
  String rc;

  while (Serial.available() > 0) {
    rc = Serial.readStringUntil('\n');
    Serial.println(rc);
  }
  if(rc == "aa"){
    Flag01 = false;
  }
}

I think the 'Flag01 = true' code seems to be initialized too quickly.

The quickest way to receive the entire response is to just echo characters, something like the following (for GPS units):

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); //(RX, TX) check correct pin assignments.

void setup() {
  mySerial.begin(9600);
  Serial.begin(9600);
  Serial.println("GPS start");
}

void loop() {
  while (mySerial.available()) {
    Serial.print(mySerial.read());
  }
}

Avoid using Strings on Arduino. Strings cause memory problems and program crashes.