-->
Page 1 of 1

WIFI access problem

PostPosted: Fri Feb 03, 2017 12:18 pm
by alainb
I try to connect an ESP8266 to the WIFI (Arduino IDE) -- but the ESP remains in the loop trying and trying and reporting 'Attempting to connect...'

The red LED is on and the blue blinks from time to time - I assume when it sends the message 'Attempting...'
I checked
-- ssid and password are correct
-- channel of the modem is on 'Auto'
-- 'Disallow Low Rate' is disabled

What could be the problem besides a defective ESP?

(An Arduino Yun performs perfectly in the same network.)

Many thanks for Help!!!

The code:

#include <ESP8266WiFi.h>

const char* ssid = "my_ssid";
const char* password = "my_password";
int status = WL_IDLE_STATUS; // the Wifi status

int ledPin = 2; // GPIO2 of ESP8266
WiFiServer server(80);//Service Port

void setup() {
Serial.begin(115200);
delay(500);

pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);

// Connect to WiFi network
Serial.println();
Serial.println();
//Serial.print("Connecting to ");
//Serial.println(ssid);

WiFi.begin(ssid, password);
while (status != WL_CONNECTED) {
Serial.print("Attempting to connect to WPA SSID: ");
Serial.println(ssid);
// Connect to WPA/WPA2 network:
status = WiFi.begin(ssid, password);
// wait 10 seconds for connection:
delay(10000);
}

Re: WIFI access problem

PostPosted: Sat Feb 04, 2017 4:05 pm
by gdsports
See the following for power/current requirements for the ESP8266 module.

http://esp8266.github.io/Arduino/versio ... 66-modules

Re: WIFI access problem

PostPosted: Sat Feb 04, 2017 6:03 pm
by g6ejd
Yes the ESP takes a (relatively) lot of power on Wi-Fi connect, a good power source is essential. I can get the same problem with certain microUSB cables, so I have to select / test my cables, some have too much resistance to work with the ESP but work fine with other boards. High resistance means high voltage drop when the connection current pulse occurs, seems to create an endless connection failure. Your code looks OK.

Re: WIFI access problem

PostPosted: Wed Apr 05, 2017 10:48 am
by alainb
I have the same problem -- the ESP8266 remains in the loop 'while (status != WL_CONNECTED)...'
The power is regulated from 12V to 3.3V by a LM1117T which should deliver up to 800mA -- I tried 2 different ESP8266 without success -- other devices like smartphone or arduino Yun have no problem at all -- I know just about nothing in electronics -- what could it be??? Many thanks for help !!!