How to send and receive AT commands from arduino in programming

Hello All,

Now I am working on to interface ESP8266(total 8 pin 2 gpio) with my UNO.

I had three questions.

1st
How to send and receive AT commands ?. using software serial. Automatically in Arduino sketch ?

2nd
can I use this software serial baud rate is 115200 ?. not recommend then How to change the esp baud rate permanently ?.
I tried this IPR=9600. it is working. but next time I got garbage value.(after power off and on or reset)
And I tried AT+CIOBAUD=9600. But I got error.

I am using update the esp module firmware using esp8266_flasher.exe and firmware is v0.9.5.2AT Firmware.bin

I am connected first with my CP2102 USB to TTL
And manually feed the AT commands I got response (I have attached the response screen shot)
like this

AT+GMR
AT version:0.21.0.0
SDK version:0.9.5

3rd
I got my esp module hot some times.
(on that time the red led glow very dim. that time the module very hot)

I read some web sites. make 5volt logic level to 3.3volt logic level So I used two resistor in (voltage divider) in arduino tx pin. Still I got my chip very hot. That time I noticed the power red led glow very fading.
I changed the power supply.

Noticed
in CP2102 I did not used voltage divider but I got module response. Some times I got module heat.
I am using 3.3volt regulator and 2amp power adapter for module supply.
I read some sites old version did not set the baud rate permanently but the new firmware support permanent baud rate. That is why I trying to change the baud rate.

I have attached 2 files.
1.The response screen shot.
2.Connections

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2,3); //RX,TX

void setup(){
  Serial.begin(115200);
  mySerial.begin(115200);
  delay(1000);
  mySerial.println("AT");
  delay(100);
  mySerial.println("AT");
  long b=mySerial.read();
  Serial.write(b);
  delay(100);
  b="";
  mySerial.println("AT+CIPMUX=1");
  b=mySerial.read();
  Serial.write(b);
  delay(100);
  b="";
  mySerial.println("AT+CIPSERVER=1,80");
  b=mySerial.read();
  Serial.write(b);
  delay(100);
  b="";
  mySerial.println("AT+CIFSR");
  b=mySerial.read();
  Serial.write(b);
  delay(100);
  b="";
}

void loop(){
  if(Serial.available()>0){
    byte b=Serial.read();
    mySerial.write(b);
  }
  if(mySerial.available()>0){
    byte b=mySerial.read();
    Serial.write(b);
  }
}

Surprise. I did not get any reply. !!!!!!!???!!!

Software Serial read function returns a char. I think ESP's AT command response contains more than 1 char. Check whether you can use readString() in SoftwareSerial, which returns a String.

Check the voltage to ESP using a multi meter.

I used to get wdt reset error. For me it caused by a USB to TTL adapter, I had couple of USB adapter and changing the USB adapter resolved this issue.

ok. Thank you and update again