Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"to station err, Join AP failure" #79

Open
gsidsid opened this issue Jan 2, 2017 · 2 comments
Open

"to station err, Join AP failure" #79

gsidsid opened this issue Jan 2, 2017 · 2 comments

Comments

@gsidsid
Copy link

gsidsid commented Jan 2, 2017

Every time I run my modified ConnectWiFi example, I get the following:

setup begin
FW Version:
to station err
Join AP failure

This seems to be quite a popular problem, and through all the previous answers I've adapted my code such that it should work. I am running my esp8266 with an Arduino Uno in the following config:

TX->D2
RX->D3
VCC->VCC
GPIO_0->VCC
GND->GND
RST->GND

Here is the code I am using. I modified it to use SoftwareSerial, set the baud rate to 115200, and obviously filled in the appropriate SSID and password. I recall uncommenting a line in the ESP8266 header file as well, for use with my uno.

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

#define PASSWORD "PASSWORD"

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

void setup(void)
{
mySerial.begin(115200);
Serial.begin(115200);
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(wifi.getLocalIP());
}

void loop(void)
{
}

If anyone has any input to provide me as to what may be causing my problem, it would be greatly appreciated. Thanks.

@jpatillo
Copy link

jpatillo commented Mar 2, 2017

Try with these connections:

TX->D2
RX->D3
VCC->VCC
CH_PD->VCC
GND->GND

@jdavies
Copy link

jdavies commented Mar 12, 2017

The example code omits the setting of the speed for Serial1. Simply adding
Serial1.begin(115200);
near the top of the setup() method resolved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants