Wemos D1 mini does not connect on WIFI

Dear friends,
I kindly ask you to give my some advice.
I used two wemos D1 mini to perform some bridge examples together with some experiments using OTA
All works fine and I have been glad with my code.

BUT
after a small change one device will not connect anymore
I tested it with a second board and after some updates using USB connection it did not connect anymore to.
It is NOT an issue with my WIFI !!
I get results when I ping the IP address which I can see on my router.

It performs well on the same board.
if I upload an example of esp8266_webserver_electricaldevices

So it seems to be an issue using blynk

I reduced my code to the example below .
And the Bug is that the line >>Serial.println(F(“setup_2”));<< will not print out.

The device stops with the message: [1303] Connecting to xxxx << where xxxx is my wifi
It works before for sure

Do I miss something in my code ?
Is there any option to reset the wemos D1 mini to factory defaults?

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <BlynkSimpleEsp8266.h>
char auth[] = "xxxxx";//Tor-Receiver-
char ssid[] = "xxxxx";
char pass[] = "xxxx";
void setup(){ 
  delay (1000);
  Serial.begin(9600);
  Serial.println();
  Serial.println(F("TOR_Receiver_Test")); // on the serial monito I get : TOR_Receiver_3
  Serial.println(F("setup_1")); // on the serial monito I get :  setup_1
  Blynk.begin(auth, ssid, pass); // on the serial monito I get :  [1303] Connecting to  BUT nothing more
  Serial.println(F("setup_2")); // <<<<<< this line will not be printed I do not understand why
 }
void loop() {
  Blynk.run();
}

I would refresh the token in the app and sketch to see if that helps.

Then check in a browser that it gives you the json data for your project with:

http://blynk-cloud.com/YOUR_TOKEN/project (Edit: url corrected)

1 Like

@Costas
are you sure that the link is correct?
I got no response on that link of cause I inserted my token
http://www.blynk-cloud.com/ does not work ??

I updated the token but have still the same issue

Sorry:

http://blynk-cloud.com/YOUR_TOKEN/project

@Costas
Thank you this is what I got
I X ed the personal information.
:“WI_FI”,“status”:“OFFLINE”

but the issue is still the same. no connection

{“id”:7,“name”:“tor receiver”,“createdAt”:1484596480851,“updatedAt”:1484659905211,“widgets”:[{“type”:“LED”,“id”:1,“x”:0,“y”:0,“color”:79755519,“width”:1,“height”:1,“tabId”:0,“deviceId”:0,“pinType”:“VIRTUAL”,“pin”:10,“pwmMode”:false,“rangeMappingOn”:false,“min”:0,“max”:0,“frequency”:0}],“devices”:[{“id”:0,“name”:“New Device”,“boardType”:“WeMos D1 mini”,“token”:“XXXX”,“connectionType”:“WI_FI”,“status”:“OFFLINE”,“disconnectTime”:1484657039591,“lastLoggedIP”:“XXX”}],“theme”:“Blynk”,“keepScreenOn”:false,“isAppConnectedOn”:false,“isShared”:false,“isActive”:false,“hardwareInfo”:{“version”:“0.4.4”,“boardType”:“Arduino”,“buildDate”:“Jan 16 2017 21:03:28”,“heartbeatInterval”:10},“pinsStorage”:{“0-d4”:“1”,“0-d5”:“1”,“0-d2”:“0”}}

The disconnectTime timestamp is Tue, 17 Jan 2017 12:43:59.591 GMT so it suggests you have connected recently.

Not realy
I have still the issue that Blynk.begin does not finish its work
And setup_2 will not be printed out.
Blynk.begin(auth, ssid, pass); // on the serial monito I get : [1303] Connecting to BUT nothing more
Serial.println(F(“setup_2”)); // <<<<<< this line will not be printed I do not understand why

In the meantime I loaded another sketch to the board from which I know that it works.
It uses the same setup procedure but of cause another token
This one works
BUT
the example above still does not
I´m so confused with this

If you an recreate the project and see how that goes.

@Costas
I deleted the blynk project and created a new one.
The same issue happens !

So WeMos is fine because you have flashed another Blynk sketch that works but not this particular one.

Are you sure you have SSID and PWD correct? Is the WeMos appearing in the GUI of your router?

Yes, as I mentioned I can also ping the device with its IP

But how ever your idea to recreate the project did help.
I setup a new sketch in arduino IDE and placed my original code in.
It works :disappointed_relieved:

@Costas a specialy thank you for your time :gift:

I do not understand what´s going wrong.
And it happened two times within one week.
So I´m unsure if I could solve the issue but how ever it works.

Is there any one how could give advice whats wrong in the code on top

Your code is fine. I think sometimes the projects get corrupted. Normally a new token helps but sometimes it requires a new project.

Sometimes the corruption is becuase Blynkers are using the wrong versions of libraries and apps. Sometimes Blynkers use a widget from Android that has not been released on iOS and that can cause problems.

Looks like you are using Blynk’s cloud server.

Android or iOS?
Library version?
App version?

[quote=“Costas, post:12, topic:10902”]
Looks like you are using Blynk’s cloud server.
[/quote] YES

[quote=“Costas, post:12, topic:10902”]
Android or iOS?
[/quote] Android V5.0

[quote=“Costas, post:12, topic:10902”]
Library version?
[/quote] Latest version: 0.4.4

[quote=“Costas, post:12, topic:10902”]
App version?
[/quote] 2.7.1

Arduino V1.8.0

Does your sketch contain this line??

#include <ESP8266WiFi.h>

It should be there…

Thank you.
Yes it does but I missed to copy it into the example above.
But it is included in my real sketch.