WIFI access problem
Posted: Fri Feb 03, 2017 12:18 pm
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);
}
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);
}