0
votes

It's my first time trying out the esp8266 on the arduino uno, using the ITEADLIB_Arduino_WeeESP8266 library. However I am not able to get anything done, not even wifi.getversion().

Here's the Serial Monitor output

setup begin
FW Version: 
to station err
Join AP failure
setup end

(forever loop)

And here's the code

#include "ESP8266.h"
#include <SoftwareSerial.h>

SoftwareSerial mySerial(3, 2); /* RX:D3, TX:D2 */
ESP8266 wifi(mySerial);

#define SSID        "AndroidAP"
#define PASSWORD    "12345678"

void setup(void)
{

}

void loop(void)
{
    Serial.begin(9600);
    Serial.print("setup begin\r\n");

    Serial.print("FW Version: ");
    Serial.println(wifi.getVersion().c_str());

    if (wifi.setOprToStation()) {
        Serial.print("to station ok\r\n");
    } else {
        Serial.print("to station err\r\n");
    }

    if (wifi.joinAP(SSID, PASSWORD)) {
        Serial.print("Join AP success\r\n");
        Serial.print("IP: ");       
        Serial.println(wifi.getLocalIP().c_str());
    } else {
        Serial.print("Join AP failure\r\n");
    }

    Serial.print("setup end\r\n");
    Serial.println("");
    delay(10000);
}

I followed the instruction on the github readme, and the led on the esp8266 is on the whole time, so I guess it is not a wiring issue. Is it possible that the 8266 is dead?

1
Is that the blue LED that is on the whole time? - Blurry Sterk
@BlurrySterk not blue but a yellow-ish (I left it at home and I forgot what color it is) led was on the whole time - Louis Tsai
I had a few times where the blue LED would stay on. That usually meant that something went wrong with the module. I then reflashed the firmware to get it working again. Here is my wiring: All pins except RX,TX,VCC and GND goes to VCC via 10K pullup resistors. RX goes to the arduino's TX and TX goes to the arduino's RX. Off course you know where VCC and GND goes. The most important thing to note (If you don't know it yet) is that the ESP8266 MUST at all times run at 3.3V. If you have connected it on 5V you might have damaged it. - Blurry Sterk
If you pull the GPIO0 pin to ground and then power up the module it goes into firmware upload mode. I use the "AT_v0.50_on_esp_iot_sdk_v1.4.0_150918" firmware and the "ESP Flash Download Tool" to upload it. Off course there are more API's on the newer firmware which gives you the choice to set the current setting (not save to flash) or set the setting permanently which saves to flash. They are the _CUR and _DEF apis. It is a wonderful little module if you get it working. - Blurry Sterk
About the pins being pulled up; I was assuming you were talking about the module with 8 pins. Basically it is the CH_PD, GPIO0, GPIO2 and RST pins that I pull up to VCC via 10k resistors. If you have a module with more pins then you will have to consult diagrams/datasheets for that module. - Blurry Sterk

1 Answers

0
votes

You may try this Serial.begin(115200);