Klaus is correct (as always
) but the point I made earlier is valid.
Sending a command to the GSM module to tell it what speed to communicate at is pointless, it won't see the command if the speed doesn't match the ESP32 UART baud rate already.
Code:
mySerial.begin(115200); // Setting the baud rate of GSM Module
Serial.begin(115200); // Setting the baud rate of Serial Monitor (Arduino)
As Klaus states, it depends on which UART you are connecting to but I suggest setting the Arduino baud rate before the GSM one. Are you using an ESP32 or a development board with USB interface, if the latter you might have a clash of serial ports with the on-board USB IC.
Brian.