0

I'm uploading this sketch to try connecting ESP to internet. However, most of the times I've ran it it takes a very long time to connect, a lot of times I've had to break the process because it seems it goes to nowhere. Few times it has connected in less than a minute. Is it any alternative to boost the connection?

Also, when I reset the module, it writes to the terminal 3 strange characters, and freezes without even starting to execute its sketch. Do you mind me asking how to solve that?

Regards!

#include <ESP8266WiFi.h>
const char red[] = "CDT10";
const char pass[] = "G7ZSY74Cs";
unsigned long muestra = 0;
void setup() {
 Serial.begin(9600);
 WiFi.mode(WIFI_STA);
 WiFi.begin(red,pass);
 while (WiFi.status() != WL_CONNECTED){
 Serial.print(".");
 delay(1000);
 }
 Serial.println("");
 Serial.println("WiFi connected");
 Serial.print("IP address: "); Serial.println(WiFi.localIP());
 Serial.print("Chip ID: "); Serial.println(ESP.getChipId());
}
void loop() {
 delay(5000);
 muestra = millis();
 Serial.println(muestra);
}
asked May 9, 2017 at 18:11
3
  • Which board are you using? Commented May 9, 2017 at 18:13
  • Right now, ESP-01. Commented May 9, 2017 at 18:14
  • is the bandwidth ok once it connects? Commented May 9, 2017 at 18:27

1 Answer 1

1

I have also experienced the inability to connect sometimes. I wait a certain amount of time for it to connect then do a ESP.reset() if it fails.

As for the boot problem it sounds like you are keeping GPIO0 low so it goes back into programming mode. Hold it high and it will run your program instead.

answered May 9, 2017 at 18:16
1
  • It worked! I forgot to hold high the GPIO0. Now it is running right. Thanks! Commented May 9, 2017 at 19:37

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.