Wireless weather station - Mega2560 DHT11 and a

Hey guys can u please help me with wire and code wifi weather station with Arduino Mega 2560 DHT11 and wifi ESP8266 esp01 i found a lot of tutorials online but nothing works. When i wire the wifi shield i can see it in my iphone with name "Esp8266" but i can't broadcast nothing to server or even read the data from dht11. When i test dht11 with cable all good but with esp8266 not working. I think was connection timeout or something like that

Please post the code that does not do what you expect.
tell what you expect
tel what it did

post the schematic how everything is connected

what IDE do you use
what OS do you use

....

ok i got no idea how is the right way to wire everything , so i start from scratch.

So here it is the connection betwen ESP8266 and Mega R3:

RX TO TX3 14,
VCC TO 3.3v,
GND TO GND,
TX TO RX3 15,
CH_PD TO 53

Here is the code witch i been try do do also with my password and name

/* ====== ESP8266 Demo ======
 *   Print out analog values
 * ==========================
 *
 * Change SSID and PASS to match your WiFi settings.
 * The IP address is displayed to soft serial upon successful connection.
 *
 * Ray Wang @ Rayshobby LLC
 * http://rayshobby.net/?p=9734
 

 */

// comment this part out if not using LCD debug
#include <SoftwareSerial.h>
#include "DHT.h"
SoftwareSerial dbg(10, 11); // using pin 7, 8 for software serial

enum {WIFI_ERROR_NONE=0, WIFI_ERROR_AT, WIFI_ERROR_RST, WIFI_ERROR_SSIDPWD, WIFI_ERROR_SERVER, WIFI_ERROR_UNKNOWN};

#define BUFFER_SIZE 128

#define SSID "MidPointeLibWC-Public"
#define PASS ""
#define PORT  "8080"      // using port 8080 by default
#define _dhtpin     8
#define _dhttype    DHT11

DHT dht11( _dhtpin, _dhttype );
uint8_t dhtbuf[2];

char buffer[BUFFER_SIZE];

void setup() {

  Serial.begin(9600);
  Serial.setTimeout(5000);
  dht11.begin();
    
  dbg.begin(9600);
  dbg.println("begin.");
    
  byte err = setupWiFi();
  if (err) {
    // error, print error code
    dbg.print("setup error:");
    dbg.println((int)err);
  } else {
    // success, print IP
    dbg.print("ip addr:");
    char *ip = getIP();
    if (ip) {
      dbg.println(ip);
    }
    else {
      dbg.println("none");
    }
    maxTimeout();
  }
}

bool maxTimeout() {
  // send AT command
  Serial.println("AT+CIPSTO=0");
  if(Serial.find("OK")) {
    return true;
  } else {
    return false;
  }
}

char* getIP() {
  // send AT command
  Serial.println("AT+CIFSR");

  // the response from the module is:
  // AT+CIFSR\n\n
  // 192.168.x.x\n 
  // so read util \n three times
  Serial.readBytesUntil('\n', buffer, BUFFER_SIZE);  
  Serial.readBytesUntil('\n', buffer, BUFFER_SIZE);  
  Serial.readBytesUntil('\n', buffer, BUFFER_SIZE);  
  buffer[strlen(buffer)-1]=0;
  return buffer;
}

void loop() {
  int ch_id, packet_len;
  char *pb;  
  Serial.readBytesUntil('\n', buffer, BUFFER_SIZE);
  if(strncmp(buffer, "+IPD,", 5)==0) {
    // request: +IPD,ch,len:data
    sscanf(buffer+5, "%d,%d", &ch_id, &packet_len);
    if (packet_len > 0) {
      // read serial until packet_len character received
      // start from :
      pb = buffer+5;
      while(*pb!=':') pb++;
      pb++;
      if (strncmp(pb, "GET /", 5) == 0) {
        serve_homepage(ch_id);
      }
    }
  }
}

void serve_homepage(int ch_id) {
  String header = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nConnection: close\r\nRefresh: 5\r\n";

  String content="";
  dhtbuf[0] = dht11.readHumidity();
    dhtbuf[1] = dht11.readTemperature();
 if( isnan(dhtbuf[0]) || isnan(dhtbuf[1]) )
    {
        dbg.println( "Failed to read form DHT11" );
    }
    else
    {
        char buf[3];
        String HH, TT;
        buf[0] = 0x30 + dhtbuf[1] / 10;
        buf[1] = 0x30 + dhtbuf[1] % 10;
        TT = (String(buf)).substring( 0, 2 );
        buf[0] = 0x30 + dhtbuf[0] / 10;
        buf[1] = 0x30 + dhtbuf[0] % 10;
        HH = (String(buf)).substring( 0, 2 );

        content += "Humidity: ";
        content += HH;
        content += "%\t";
        content += "\nTemperature: ";
        content += TT;
        content += "*C\t";
        
        #ifdef DEBUG
            debug.print("Humidity: "); 
            debug.print( HH );
            debug.print(" %\t");
            debug.print("Temperature: "); 
            debug.print( TT );
            debug.println(" *C\t");
        #endif
        
    }

  header += "Content-Length:";
  header += (int)(content.length());
  header += "\r\n\r\n";
  Serial.print("AT+CIPSEND=");
  Serial.print(ch_id);
  Serial.print(",");
  Serial.println(header.length()+content.length());
  if (Serial.find(">")) {
    Serial.print(header);
    Serial.print(content);
    delay(20);
  }
  /*Serial.print("AT+CIPCLOSE=");
  Serial.println(ch_id);*/
}

byte setupWiFi() {
  Serial.println("AT");
  if(!Serial.find("OK")) {
    return WIFI_ERROR_AT;
  }
  delay(500); 

  // reset WiFi module
  Serial.println("AT+RST");
  if(!Serial.find("ready")) {
    return WIFI_ERROR_RST;
  }
  delay(500);
 
  // set mode 3
  Serial.print("AT+CWJAP=\"");
  Serial.print(SSID);
  Serial.print("\",\"");
  Serial.print(PASS);
  Serial.println("\"");
  delay(2000);
  if(!Serial.find("OK")) {
    return WIFI_ERROR_SSIDPWD;
  }
  delay(500);
  
  // start server
  Serial.println("AT+CIPMUX=1");
  if(!Serial.find("OK")){
    return WIFI_ERROR_SERVER;
  }
  delay(500);
  
  Serial.print("AT+CIPSERVER=1,"); // turn on TCP service
  Serial.println(PORT);
  if(!Serial.find("OK")){
    return WIFI_ERROR_SERVER;
  }
  delay(500);
  
  return WIFI_ERROR_NONE;
}

Anyone please just tell me how to bloody wire them and what f@$*% code to upload without any errors and timeout xxxx just get rid off every single wire

Picture of what i got ...