ESP8266 not working with Sketches

I have tried just about all the popular code by searching the net available to get this thing working on an Uno and a Mega
I have wired it using a voltage divider on the RX pin, and just strait to the Pins
I can use a Terminal or the Arduino Terminal all day long and send and get messages
But no sketches I have tried work.

I have read just about every thread and tried all the code in all these threads, none of them send data or receive data.

I am at a total loss.

If you search Arduino ESP8266 in Bing or whatever, and goto any of these sites listed and test the code
none of them work for me.

I will give more details later, but I think I have pretty much summed things up.

Just a couple of Examples of the very very many I have tried., Arduino to ESP8266 By Serial Communication | Martyn Currey
http://forum.arduino.cc/index.php?topic=306961.0
ESP8266 and Arduino Webserver Code and Sketch

Don’t get me wrong, i know this is not plug-n-pray.
But something should have worked by now for me…

Thank you for any assistance anyone can provide.

Not even this works on the Mega.

/*
Software serial multple serial test
Receives from the hardware serial, sends to software serial.
Receives from software serial, sends to hardware serial.
The circuit:
* RX is digital pin 10 (connect to TX of other device)
* TX is digital pin 11 (connect to RX of other device)
Note:
Not all pins on the Mega and Mega 2560 support change interrupts,
so only the following can be used for RX:
10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
Not all pins on the Leonardo support change interrupts,
so only the following can be used for RX:
8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
created back in the mists of time
modified 25 May 2012
by Tom Igoe
based on Mikal Hart's example
This example code is in the public domain.
*/
#include <SoftwareSerial.h>
SoftwareSerial wifiPort(10, 11); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
// set the data rate for the SoftwareSerial port
wifiPort.begin(9600);
wifiPort.println("AT+RST");
delay(1000);
wifiPort.println("AT");
}
void loop() // run over and over
{
wifiPort.listen();
if (wifiPort.available() ) {
Serial.write(wifiPort.read());
}
if (Serial.available() ){
wifiPort.write(Serial.read());
}
}

BTW: Using the AI-v0.9.5.0 AT Firmware.bin

00200.9.5(b1)
compiled @ Dec 25 2014 21:40:28
AI-THINKER Dec 25 2014

Try this one, http://allaboutee.com/2014/12/27/esp8266-arduino-code-and-circuit/ . It workd for me. And make sure that you set 9600 in serail monitor.

Thank you for the response I have tried that sketch as well.

I have tried that one I made some chagnes and tried a couple of different voltage dividers etc. All Voltages are matching up. I can send and recieve all day long in a terminal.

Not one single sketch will work. Transmits nothing at all, no blue light, no response

Ok, I figured it out I think, after many days and trying everything under the sun. Thinking I had everything hooked up correctly because the Terminal is working. Turns out, and I had tried this before, the TX and RX lines were switched, I had swapped them numerous times before and that never worked. All of a sudden it's working.

Man I hate when the little things get me.

Again, thank you for the response.

BTW, Arduino IDE 1.6.1 just became available.

To Elaborate further...

I DID have to swap the RX and TX,, so

RX from Arduino to TX on ESP8266 TX from Arduino to RX on SPE8266

Again, I had tried this before and it did not work for some reason.

Also, I am not using any Voltage dividers or other parts VCC and CH_PD are tied together on the 3.3V Arduino PIN GND to GND RX from Arduino to TX on ESP8266 TX from Arduino to RX on ESP8266

And this is working.

Tepid:
I have tried just about all the popular code by searching the net available to get this thing working on an Uno and a Mega
I have wired it using a voltage divider on the RX pin, and just strait to the Pins
I can use a Terminal or the Arduino Terminal all day long and send and get messages
But no sketches I have tried work.

I have read just about every thread and tried all the code in all these threads, none of them send data or receive data.

I am at a total loss.

If you search Arduino ESP8266 in Bing or whatever, and goto any of these sites listed and test the code
none of them work for me.

I will give more details later, but I think I have pretty much summed things up.

Hello Tepid,

I am experiencing the exact same thing.
All day long, I can use AT commands over the SerialMonitor.
But nothing in a sketch works at all. There’s absolutely no
response from the ESP8266.

I’ve just ordered another ESP8266 … as I had totally run out of ideas.

  • until I just read your message!

Did you find that TX, RX connected to Ard 0,1 worked ok with SerialMonitor, and
then you had to reverse them when running a sketch …?

Thanks.

Just a couple of Examples of the very very many I have tried., Arduino to ESP8266 By Serial Communication | Martyn Currey
http://forum.arduino.cc/index.php?topic=306961.0
ESP8266 and Arduino Webserver Code and Sketch

Don’t get me wrong, i know this is not plug-n-pray.
But something should have worked by now for me…

Thank you for any assistance anyone can provide.

Not even this works on the Mega.

/*

Software serial multple serial test
Receives from the hardware serial, sends to software serial.
Receives from software serial, sends to hardware serial.
The circuit:

  • RX is digital pin 10 (connect to TX of other device)
  • TX is digital pin 11 (connect to RX of other device)
    Note:
    Not all pins on the Mega and Mega 2560 support change interrupts,
    so only the following can be used for RX:
    10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
    Not all pins on the Leonardo support change interrupts,
    so only the following can be used for RX:
    8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
    created back in the mists of time
    modified 25 May 2012
    by Tom Igoe
    based on Mikal Hart’s example
    This example code is in the public domain.
    */
    #include <SoftwareSerial.h>
    SoftwareSerial wifiPort(10, 11); // RX, TX
    void setup()
    {
    // Open serial communications and wait for port to open:
    Serial.begin(9600);
    while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
    }
    // set the data rate for the SoftwareSerial port
    wifiPort.begin(9600);
    wifiPort.println(“AT+RST”);
    delay(1000);
    wifiPort.println(“AT”);
    }
    void loop() // run over and over
    {
    wifiPort.listen();
    if (wifiPort.available() ) {
    Serial.write(wifiPort.read());
    }
    if (Serial.available() ){
    wifiPort.write(Serial.read());
    }
    }



BTW: Using the AI-v0.9.5.0 AT Firmware.bin

00200.9.5(b1)
compiled @ Dec 25 2014 21:40:28
AI-THINKER Dec 25 2014