#include <SoftwareSerial.h>
SoftwareSerial mySerial(2,3);
// When a command is entered in to the serial monitor on the computer
// the Arduino will relay it to the ESP8266
int LEDPIN = 13;
void setup()
{
pinMode(LEDPIN, OUTPUT);
Serial.begin(9600); // communication with the host computer
//while (!Serial) { ; }
// Start the software serial for communication with the ESP8266
mySerial.begin(115200);
Serial.println("");
Serial.println("Remember to to set Both NL & CR in the serial monitor.");
Serial.println("Ready");
Serial.println("");
}
void loop()
{
// listen for communication from the ESP8266 and then write it to the serial monitor
if ( mySerial.available() ) { Serial.write( mySerial.read() ); }
// listen for user input and send it to the ESP8266
if ( Serial.available() ) { mySerial.write( Serial.read() ); }
}

Ah that same mistake again from yesterday.. sorry. I have got a switch between the reset and GND. It is nnot permamently in reset mode.If I’m reading the datasheet correctly, by connecting the ESP8266 reset to ground through a resistor, the device is permanently in reset mode. Pulling that pin down is how to reset the device. It should go to Vcc instead.
#include <SoftwareSerial.h> //Including the software serial library
#define DEBUG true
SoftwareSerial esp8266(2,3); // This will make the Arduino pin 2 as the RX pin and Arduino pin 3 as the TX. Software UART
/* So you have to connect the TX of the esp8266 to the pin 2 of the Arduino and the TX of the esp8266 to the pin 3 of the Arduino. This means that you need to connect the TX line from the esp to the Arduino's pin 2 */
void setup()
{
Serial.begin(9600); // Setting the baudrate to 9600
esp8266.begin(9600); // Set it according to your esp’s baudrate. Different esp’s have different baud rates.
pinMode(11,OUTPUT); // Setting the pin 11 as the output pin.
digitalWrite(11,LOW); // Making it low.
pinMode(12,OUTPUT); // Setting the pin 12 as the output pin..
digitalWrite(12,LOW); // Making pin 12 low.
pinMode(13,OUTPUT); // Setting the pin 13 as the output pin.
digitalWrite(13,LOW); // Making pin 13 low.
sendData("AT+RST\r\n",2000,DEBUG); //This command will reset module to default
sendData("AT+CWMODE=2\r\n",1000,DEBUG); // This will configure the mode as access point
sendData("AT+CIFSR\r\n",1000,DEBUG); // This will get ip address and will show it
sendData("AT+CIPMUX=1\r\n",1000,DEBUG); // This will configure the ESP8266 for multiple connections
sendData("AT+CIPSERVER=1,80\r\n",1000,DEBUG); // This will set the server on port 80
}
void loop()
{
if(esp8266.available()) // Checking that whether the esp8266 is sending a message or not (Software UART Data)
{
if(esp8266.find("+IPD,"))
{
delay(1000); // Waiting for 1 sec
int connectionId = esp8266.read()-48; // Subtracting 48 from the character to get the number.
esp8266.find("pin="); // Advancing the cursor to the "pin="
int pinNumber = (esp8266.read()-48)*10; // Getting the first number which is pin 13
pinNumber += (esp8266.read()-48); // This will get the second number. For example, if the pin number is 13 then the 2nd number will be 3 and then add it to the first number
digitalWrite(pinNumber, !digitalRead(pinNumber)); // This will toggle the pin
// The following commands will close the connection
String closeCommand = "AT+CIPCLOSE=";
closeCommand+=connectionId;
closeCommand+="\r\n";
sendData(closeCommand,1000,DEBUG); // Sending the data to the ESP8266 to close the command
}
}
}
String sendData(String command, const int timeout, boolean debug) // Function to send the data to the esp8266
{
String response = "";
esp8266.print(command); // Send the command to the ESP8266
long int time = millis();
while( (time+timeout) > millis()) // ESP8266 will wait for some time for the data to receive
{
while(esp8266.available()) // Checking whether ESP8266 has received the data or not
{
char c = esp8266.read(); // Read the next character.
response+=c; // Storing the response from the ESP8266
}
}
if(debug)
{
Serial.print(response); // Printing the response of the ESP8266 on the serial monitor.
}
return response;
}

/*
Arduino Webserver using ESP8266
Displays temperature in a webpage
Arduino Mega has three Serial communication ports,this code works well with
Arduino Mega.For UNO users,use Softserial library to connect ESP8266 with
Arduino UNO
If you're unsure about your Arduino model or its pin cofigurations,please check
the documentation at [URL]http://www.arduino.cc[/URL]
modified August 2016
By Joyson Chinta and Gladson Kujur
*/
#define DEBUG true
#include<SoftwareSerial.h>
#define DEBUG true
SoftwareSerial esp8266(2,3);
void setup()
{
Serial.begin(9600); ///////For Serial monitor
esp8266.begin(115200); ///////ESP Baud rate
pinMode(11,OUTPUT); /////used if connecting a LED to pin 11
digitalWrite(11,LOW);
sendData("AT+RST\r\n",2000,DEBUG); // reset module
sendData("AT+CWMODE=2\r\n",1000,DEBUG); // configure as access point
sendData("AT+CIFSR\r\n",1000,DEBUG); // get ip address
sendData("AT+CIPMUX=1\r\n",1000,DEBUG); // configure for multiple connections
sendData("AT+CIPSERVER=1,80\r\n",1000,DEBUG); // turn on server on port 80
}
float sensetemp() ///////function to sense temperature.
{
int val = analogRead(A0);
float mv = ( val/1024.0)*5000;
float celcius = mv/10;
return(celcius);
}
int connectionId;
void loop()
{
if(esp8266.available())
{
/////////////////////Recieving from web browser to toggle led
if(esp8266.find("+IPD,"))
{
delay(300);
connectionId = esp8266.read()-48;
if(esp8266.find("pin="))
{
Serial.println("recieving data from web browser");
int pinNumber = (esp8266.read()-48)*10;
pinNumber += (esp8266.read()-48);
digitalWrite(pinNumber, !digitalRead(pinNumber));
}
/////////////////////Sending data to browser
else
{
String webpage = "<h1>Hello World</h1>";
espsend(webpage);
}
if(sensetemp() != 0)
{
String add1="<h4>Temperature=</h4>";
String two = String(sensetemp(), 3);
add1+= two;
add1+="℃"; //////////Hex code for degree celcius
espsend(add1);
}
else
{
String c="sensor is not conneted";
espsend(c);
}
String closeCommand = "AT+CIPCLOSE="; ////////////////close the socket connection////esp command
closeCommand+=connectionId; // append connection id
closeCommand+="\r\n";
sendData(closeCommand,3000,DEBUG);
}
}
}
//////////////////////////////sends data from ESP to webpage///////////////////////////
void espsend(String d)
{
String cipSend = " AT+CIPSEND=";
cipSend += connectionId;
cipSend += ",";
cipSend +=d.length();
cipSend +="\r\n";
sendData(cipSend,1000,DEBUG);
sendData(d,1000,DEBUG);
}
//////////////gets the data from esp and displays in serial monitor///////////////////////
String sendData(String command, const int timeout, boolean debug)
{
String response = "";
esp8266.print(command);
long int time = millis();
while( (time+timeout) > millis())
{
while(esp8266.available())
{
char c = esp8266.read(); // read the next character.
response+=c;
}
}
if(debug)
{
Serial.print(response); //displays the esp response messages in arduino Serial monitor
}
return response;
}

Therein lies an example of why you have been working on this for soooooo long, as you say.Ah that same mistake again from yesterday.. sorry. I have got a switch between the reset and GND. It is nnot permamently in reset mode.

I am glad that you are making some progress, but , whether you believe me or not: You need to start paying attention to these details or the chances of you getting help will go down.But, I think that the next step is for you to figure out why there is a switch on the reset line and why there are other resistors. That will help you understand the chip and make it easier.
#include <SoftwareSerial.h>
SoftwareSerial esp8266(2,3); //Pin 2 & 3 of Arduino as RX and TX. Connect TX and RX of ESP8266 respectively.
#define DEBUG true
#define led_pin 11 //LED is connected to Pin 11 of Arduino
void setup()
{
pinMode(led_pin, OUTPUT);
digitalWrite(led_pin, LOW);
Serial.begin(9600);
esp8266.begin(115200); //Baud rate for communicating with ESP8266. Your's might be different.
esp8266Serial("AT+RST\r\n", 5000, DEBUG); // Reset the ESP8266
esp8266Serial("AT+CWMODE=1\r\n", 5000, DEBUG); //Set station mode Operation
esp8266Serial("AT+CWJAP=\"SSID\",\"Password\"\r\n", 5000, DEBUG);//Enter your WiFi network's SSID and Password.
while(!esp8266.find("OK"))
{
}
esp8266Serial("AT+CIFSR\r\n", 5000, DEBUG);//You will get the IP Address of the ESP8266 from this command.
esp8266Serial("AT+CIPMUX=1\r\n", 5000, DEBUG);
esp8266Serial("AT+CIPSERVER=1,80\r\n", 5000, DEBUG);
}
void loop()
{
if (esp8266.available())
{
if (esp8266.find("+IPD,"))
{
String msg;
esp8266.find("?");
msg = esp8266.readStringUntil(' ');
String command1 = msg.substring(0, 3);
String command2 = msg.substring(4);
if (DEBUG)
{
Serial.println(command1);//Must print "led"
Serial.println(command2);//Must print "ON" or "OFF"
}
delay(100);
if (command2 == "ON")
{
digitalWrite(led_pin, HIGH);
}
else
{
digitalWrite(led_pin, LOW);
}
}
}
}
String esp8266Serial(String command, const int timeout, boolean debug)
{
String response = "";
esp8266.print(command);
long int time = millis();
while ( (time + timeout) > millis())
{
while (esp8266.available())
{
char c = esp8266.read();
response += c;
}
}
if (debug)
{
Serial.print(response);
}
return response;
}


#include <SoftwareSerial.h>
SoftwareSerial mySerial(2,3);
// When a command is entered in to the serial monitor on the computer
// the Arduino will relay it to the ESP8266
//ARDUINO TX - RX, RX-TX
//
int LEDPIN = 13;
void setup()
{
pinMode(LEDPIN, OUTPUT);
Serial.begin(9600); // communication with the host computer
//while (!Serial) { ; }
// Start the software serial for communication with the ESP8266
mySerial.begin(115200);
Serial.println("");
Serial.println("Remember to to set Both NL & CR in the serial monitor.");
Serial.println("Ready");
Serial.println("");
}
void loop()
{
// listen for communication from the ESP8266 and then write it to the serial monitor
if ( mySerial.available() ) { Serial.write( mySerial.read() ); }
//listen for user input and send it to the ESP8266
if ( Serial.available() ) { mySerial.write( Serial.read() ); }
}

if (!understanding()){
read(more);
}
I suggest that you stop running programs when you do not know what they do and then start asking questions about why they are not doing what you want them to do. It is not likely that you will stumble into a finished project.
1. Please look at post #21. What difference do you see between your schematic and the diagram illustrated in post #21?
2. Please learn how to use code tags when you include code in your posts. Read through this thread https://forum.allaboutcircuits.com/threads/small-improvement-to-code-tag.113254/page-2
if you use [ code=c ] at the beginning and then paste the code and at the ending use [ / code ] it will suffice. Note that I have inserted spaces between the brackets so that you can see it. When you don't use those spaces, something like
if (!understanding()){
read(more);
}
will look like this:
C:if (!understanding()){ read(more); }
Thank you for your answer. The difference is 10k resistor from ch_en to vcc. I have done that just now - same results.
Perhaps I should.On my schematic ESP TX goes to the 2nd pin of Arduino ( which is software serial RX) - this is exactly the same as the post 21.
Perhaps you should have a closer look into my schematic?
No problem. I have connected my old ESP8266 to the circuit to test them. The RED light of ESP is always ON on both of them, when I press the reset button, nothing happens, but when buttons is released Blue led flashes. Do not seem to be able get any AT commands from my 2 old ESP's. I've got nodemcu develpment board, perhaps I would find it easier to work with and setup? Have you had some previous experience with nodemcu?Perhaps I should.
You're right, sorry about that. No excuses.