ATmega32U4 and MOD-WIFI-ESP8266

Is there a example(soource code and connections) of using ATmega32U4 and MOD-WIFI-ESP8266?
I am new and I don`t know a lot about Atmega.

Are you using an ATmega31u4-based Arduino (like Leonardo or Micro)?

Yes I do.

Then any of the many examples of using an ESP8266 with an Arduino should work. Google should be able to find some tutorials and examples for you to read.

What is the baud rate in some places it says that is 115200 other 57600 and 9600.On 9600 when i sent AT i get -1 what this means?

43r3:
What is the baud rate in some places it says that is 115200 other 57600 and 9600.On 9600 when i sent AT i get -1 what this means?

A ESP8266.read() returning -1 means you have not received any characters yet.
Here is a simple tutorial.

Since the Leonardo has Serial for USB and Serial1 for pins 0 and 1 you can use the sketch without SoftwareSerial and the external USB adapter:

#define SSID "xxxxxxxx"
#define PASS "xxxxxxxx"
#define DST_IP "220.181.111.85" //baidu.com
void setup() {
  // Open serial communications and wait for port to open:
  Serial1.begin(57600);
  Serial1.setTimeout(5000);
  Serial.begin(9600); //can't be faster than 19200 for softserial
  Serial.println("ESP8266 Demo");
  //test if the module is ready
  Serial1.println("AT+RST");
  delay(1000);
  if (Serial1.find("ready")) {
    Serial.println("Module is ready");
  }
  else {
    Serial.println("Module gave no response.");
    while (1);
  }
  delay(1000);
  //connect to the wifi
  boolean connected = false;
  for (int i = 0; i < 5; i++) {
    if (connectWiFi()) {
      connected = true;
      break;
    }
  }
  if (!connected) {
    while (1);
  }
  delay(5000);
  //print the ip addr
  /*Serial1.println("AT+CIFSR");
  Serial.println("ip address:");
  while (Serial.available())
  Serial.write(Serial.read());*/
  //set the single connection mode
  Serial1.println("AT+CIPMUX=0");
}
void loop() {
  String cmd = "AT+CIPSTART=\"TCP\",\"";
  cmd += DST_IP;
  cmd += "\",80";
  Serial1.println(cmd);
  Serial.println(cmd);
  if (Serial1.find("Error")) return;
  cmd = "GET / HTTP/1.0\r\n\r\n";
  Serial1.print("AT+CIPSEND=");
  Serial1.println(cmd.length());
  if (Serial1.find(">"))
  {
    Serial.print(">");
  } else
  {
    Serial1.println("AT+CIPCLOSE");
    Serial.println("connect timeout");
    delay(1000);
    return;
  }
  Serial1.print(cmd);
  delay(2000);
  //Serial.find("+IPD");
  while (Serial1.available()) {
    char c = Serial.read();
    Serial.write(c);
    if (c == '\r') Serial.print('\n');
  }
  Serial.println("====");
  delay(1000);
}
boolean connectWiFi() {
  Serial1.println("AT+CWMODE=1");
  String cmd = "AT+CWJAP=\"";
  cmd += SSID;
  cmd += "\",\"";
  cmd += PASS;
  cmd += "\"";
  Serial.println(cmd);
  Serial1.println(cmd);
  delay(2000);
  if (Serial1.find("OK")) {
    Serial.println("OK, Connected to WiFi.");
    return true;
  } else {
    Serial.println("Can not connect to the WiFi.");
    return false;
  }
}

Nope.I got "Module gave no response.".I use this OLIMEXINO-NANO - Open Source Hardware Board and this :https://www.olimex.com/Products/IoT/MOD-WIFI-ESP8266-DEV/open-source-hardware.But I can ping the device.

Did you follow the instructions that Olimex provides for setting the I/O mode to UART?
How to change the modes (FLASH, UART, SDIO)

I wish I could be of more help but I can't find RX and TX pins on the images they provide. :frowning:

Nope this time I can`t even ping the device.I recive data on rxd but it is something like that 237 125 87 etc.

You need to follow Olimex' instructions on how to use the module; it's a custom module with their UEXT connector layout and instructions for generic ESP8266 modules aren't going to be the same.

Per Olimex' examples the baud rate is 115200.