-->
Page 1 of 1

Custom board with ESP take too long to connect to wifi

PostPosted: Thu Jun 21, 2018 3:09 am
by Itzik Sherf
Hi guys!
I've made a customized ESP8266 board based on sparkfunThingESP for special use.
I've succeeded to program it and use its features (UART,SPI,I2c and etc.)
When i use my board with code that config the ESP as an AP and just show me in the terminal how many
stations are connected to my ESP and try to connect with other device (PC, iphone etc.) it works great.
BUT, I am experiencing issues when i use my board as an station and try to connect to my wifi hotspot. 95% of the time it doesn't success and when it does and it takes about 10 to 20 minutes.
The code i use is very simple but still doesn't work:
Code: Select all#include <ESP8266WiFi.h>        // Include the Wi-Fi library

const char* ssid     = "AndroidDevice";         // The SSID (name) of the Wi-Fi network you want to connect to
const char* password = "19362005";     // The password of the Wi-Fi network

void setup() {
  Serial.begin(115200);         // Start the Serial communication to send messages to the computer
  delay(10);
  Serial.println('\n');

  WiFi.begin(ssid, password);             // Connect to the network
  Serial.print("Connecting to ");
  Serial.print(ssid); Serial.println(" ...");

  int i = 0;
  while (WiFi.status() != WL_CONNECTED) { // Wait for the Wi-Fi to connect
    delay(1000);
    Serial.print(++i); Serial.print(' ');
  }

  Serial.println('\n');
  Serial.println("Connection established!");
  Serial.print("IP address:\t");
  Serial.println(WiFi.localIP());         // Send the IP address of the ESP8266 to the computer
}

void loop() { }