Wifi Password Bug¿?

While testing the product I discovered if you put ok ssid and wrong password the esp8266 esp-12e wont start

I think it should start and print “incorrect password”.

A good thing would be to have an option to put a secondary wifi configuration in case first fails connect to second one.

you should tell the product manufacturer perhaps?

http://www.electrodragon.com/contact/

this is the Blynk app forum…

@Dave1829 I would agree that the functioning of ESP’s is nothing to do with Blynk but I’m interested to know how you know @kranick is using an ESP from the supplier you mentioned?

@Costas @Dave1829

Code used withoth  Blynk:

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

Code used with Blynk:
Blynk.begin(auth, ssid, password,"192.168.1.128");

As you can see class “BLYNK” is not the same of Wifi so I think this problem is related to Blynk and not ESp8266

The Wifi class works OK :slight_smile:

@kranick would you want everyone stood outside your house with their projects connecting to Blynk because you want the service to work with an incorrect password.

This is not a bug, it is designed that way to ensure only authorised individuals can use your system.

You can get your project to work without Blynk, if that is what you want, just include a timeout on the connection and proceed without Blynk if it doesn’t connect to the router within the timeout you set.

@Costas Please dont mix up two things this is a password related between esp8266 and my wifi and the other post is I cant share project.

Of course when I put correct pass esp connect and is online (project sharing still fails).

I need to share a remote control ON/Buttom to enable / disable an alarm we have one android and one Iphone this project is perfect (Blynk)

I’m not mixing up anything it was your rather misleading first sentence in this thread that was ‘mixed up’.

“While testing the product I discovered if you put ok ssid and wrong password the esp8266 esp-12e wont start.”

Maybe you start by fully explaining what this sentence means and what you really want to do.

@Costas While using wrong password with class Blynk.begin wont start, while using Wifi.begin class it works ok.

Sorry I am not native English and I am not so good with English. I am Spanish.

By mistake while I was configuring my ESP I saw it wont start as normal checking the code I found I put wrong password of my WIFI network , when I put correct password the ESP started working ok.

SSID = The name of your wifi
Password= Password of your Wifi

http://bfy.tw/5gP1 :slight_smile:

1 Like

@Dave1829 nope I dont use that one @Costas is saying one random supplier (I think) I use Webmos D1 R2 because allow to input 9-24v and have an output of 3v and 5v and voltage in so I have three voltage to play. In my case I control a PIR a Door Sensor and a relay (relay still developing), then I make a shield to connect with rj45 or rj11 plug and play .

@kranick when you say 'it works" with an incorrect password for WiFi.begin but not Blynk.begin, as shown in your extract below, I can’t see how.

  WiFi.begin(ssid, WRONGpassword);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

Surely an incorrect password is an incorrect password (WiFi or Blynk) and the while loop should stop the rest of the sketch from running (unless there is an automatic timeout with the ESP’s that breaks the while loop).

@Costas when you run Wifi.begin it continue the sketch and enter in the While but never outside and no reset.

When you connect to Blynk.begin the Esp reset. There are no While there because Wifi.status is not related to blynk class.

I think we are discussing why Esp reset instead of saying can not connect to the wifi or wrong password .

Maybe I should do one thing I am missing is remove the While in the WIFI class and check if reset.

The same happens when you want to use attachinterrupt (my code changed a whole for this) but this is known with the wifi class it doesnt reset and with Blynk class it reset.

Anyway my interest is share the Remote Control and solve the other post .

I think we are getting there now and I think you are right.

With a WeMos D1 Mini the standard standalone sketch does crash the ESP if you enter the wrong password.

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "xxxxxxxxxxxxxxxxxx";

void setup()
{
  Serial.begin(115200);
  Blynk.begin(auth, "Office", "wrongpass");  // ESP will never run
}

void loop()
{
  Blynk.run();
}

@Costas For me this is not an Issue but for other users could be because they dont know why ESP is not starting.

I only tell this here because If the bug is confirmed someone could fix.

Maybe I don’t like the word bug.

A fix:

#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char blynk_token[] = "xxxxxxxxxx";

void setup()
{
  Serial.begin(115200);
  delay(20);
  Serial.println();
  WiFi.begin("Office", "wrongpass");
  delay(500);
  Blynk.config(blynk_token);
  Blynk.connect(3333);  // Show possible password error every 10 seconds
  while (Blynk.connect() == false) {
    delay(500);
    Serial.println("Check your password");
  }
  Serial.println("Connected");
}

void loop()
{
  Blynk.run();
}

@Costas I dont know whats blynk does internally but based on your code Blynk.class call WIFI.class for extract connection object or username and password otherwise I dont know how Blynk knows abouth WIFI class connection.

Did you see WiFi.begin(“Office”, “wrongpass”); in my sketch?
WiFi connection is made before attempting to connect to Blynk.
It is done this way when using WiFIManager etc.

@Costas
Yes thats why I ask WIFI has connection but Blynk get that connection?

I am Java guy and maybe I am thinking in objects and this thiings works different.

Of course your scketch should print Connnected if blynk has connection will test later.

Yes Blynk can use your existing WiFi connection as long as you feed it:

Blynk.config..........
Blynk.connect......

so then they should learn from their errors of typing wrong password?

this is the only issue i see here, that a user inputs wrong data?

it is pretty basic stuff mate!!! if they can’t “debug” that - they may as well do elsewise…

but I’m glad you are having fun with @Costas - he is a very good source of information and understanding :slight_smile:

1 Like