BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

ESP8266-12E no long connect Login Time out

HI, getting frustrated. This project worked perfectly 4 days ago, but for last couple of days, always getting

*[130133] Connecting to cloud.blynk.cc:8442*
*[132320] Login timeout*
*[135320] Connecting to cloud.blynk.cc:8442*
*[142215] Connecting to cloud.blynk.cc:8442*
*[149239] Connecting to cloud.blynk.cc:8442*
*[156389] Connecting to cloud.blynk.cc:8442*
*[163463] Connecting to cloud.blynk.cc:8442*
*[170513] Connecting to cloud.blynk.cc:8442*
*[177612] Connecting to cloud.blynk.cc:8442*
*[184637] Connecting to cloud.blynk.cc:8442*

Got ESP8266-12E with following Arduino 1.6.5 IDE (Blynk libraries updated to latest version)
Can telnet cloud.blynk.cc:8442 no problems from laptop on same WiFi subnet.

HelloServer ESP example sketch works fine and perfect.
???
Sketch:

    #define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
    #include <ESP8266WiFi.h>
    #include <BlynkSimpleEsp8266.h>
    char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    void setup()
    {
      Serial.begin(9600);
  Blynk.begin(auth, "keepout", "xxxxxxxx");
pinMode(13, OUTPUT);
}
BLYNK_WRITE(V1)
{
  BLYNK_LOG("Got a value: %s", param.asStr());
  analogWrite(13,param.asInt());
}
void loop()
{
  Blynk.run();
if (analogRead(A0) < 500) {
 Blynk.email("xxxxxx@gmail.com", "Analog0", "Analog0 dropped");
  BLYNK_LOG("should have sent email");
   }
}

Hello.

this is wrong. You shouldn’t use any Blynk command in main loop. Loop may be executed thousand of times per second and your connection will be dropped because of high traffic.

Regarding your connection problem - please install latest Blynk library from trunk.

Thanks Dmitriy for a quick response.

Perfect… :smile: commented out the command and back up and running…

I’ll hunt out how to get read an analogue value and set off and email on the community.

Regarding updaing libraries from trunk, every time i do this - IDE says “already exist”, and Library manager says im INSTALLED, no option to update to a new version…

James

Something like that. Just pseudo code.

int lastTick = 0;

void loop()
{
  Blynk.run();
  if (analogRead(A0) < 500 && (millis() - lastTick > 60000)) { //60000 - 1 minute
      lastTick = millis();
      sendEmail();
  }
}

Good evening! I have a problem, NODEMCU ESP8266-12E device wants to connect to the server BLYNK, that’s sketch
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth [] = “6f80a51fbd384fc3ac91718c7c0c78cb”;

// Your WiFi credentials.
// Set password to “” for open networks.
char ssid [] = “OSTROVSKIY”;
char pass [] = “vova888888”;

void setup ()
{
Serial.begin (9600)
Blynk.begin (auth, ssid, pass)
}

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

but writes in serial port

[2316] Connected to WiFi
[2316] IP: 192.168.0.110
[2316]


/ ) / / _____ _ / / __
/ _ / / // / _ \ / ’
/
/ ____ / _ / \ _ / _ // _ / _ / \ _
/ ___ / V0.4.3 on NodeMCU

[5001] Connecting to blynk-cloud.com:8442
[18236] Connecting to blynk-cloud.com:8442
[32333] Connecting to blynk-cloud.com:8442

NodeMCU notwant then connect that may be at issue ??

@1119 firewall? Blocked ports? Please check your router settings.

Here is also troubleshooting section - http://docs.blynk.cc/#troubleshooting

and which ports should be open on the firewall ??

8442, 8443 for app.

I successfully challenged these ports in the router for ustroysta, working here with this Arrangement sketch
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth [] = “6f80a51fbd384fc3ac91718c7c0c78cb”;

void setup ()
{
Serial.begin (115200)

WiFi.mode (WIFI_STA);

int cnt = 0;
while (WiFi.status ()! = WL_CONNECTED) {
delay (500);
Serial.print ( “.”);
if (cnt ++> = 10) {
WiFi.beginSmartConfig ();
while (1) {
delay (1000);
if (WiFi.smartConfigDone ()) {
Serial.println ();
Serial.println ( “SmartConfig: Success”);
break;
}
Serial.print ( “|”);
}
}
}

WiFi.printDiag (Serial);

Blynk.config (auth);
}

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

only netrymae long rozryvaetsya and connectivity to the server again pidklyuchaetsya

here is what a serial port
PHY mode: N
Channel: 9
AP id: 0
Status: 5
Auto connect: 1
SSID (10): OSTROVSKIY
Passphrase (10): vova888888
BSSID set: 0
[2327]
___ __ __
/ ) / / _____ _ / / __
/ _ / / // / _ \ / ’
/
/ ____ / _ / \ _ / _ // _ / _ / \ _
/ ___ / V0.4.3 on NodeMCU

[5001] Connecting to blynk-cloud.com:8442
[13390] Ready (ping: 0ms).
[39198] Connecting to blynk-cloud.com:8442
[52594] Connecting to blynk-cloud.com:8442
[66818] Connecting to blynk-cloud.com:8442

@1119 I recommend you to start from basic sketch. Did you try it? http://examples.blynk.cc/
Make sure is works for you. After that you can add step-by-step your own code.

da used

did not work

Same output?

here is a basic sketch
#define BLYNK_PRINT Serial

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth [] = “6f80a51fbd384fc3ac91718c7c0c78cb”;

// Your WiFi credentials.
// Set password to “” for open networks.
char ssid [] = “OSTROVSKIY”;
char pass [] = “vova888888”;

void setup ()
{
// Debug console
Serial.begin (115200)

Blynk.begin (auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, Ssid, pass, “blynk-cloud.com”, 8442);
//Blynk.begin(auth, Ssid, pass, IPAddress (192,168,1,100), 8442);
}

void loop ()
{
Blynk.run ();
// You can inject your own code or combine it with other sketches.
// Check other examples on how to communicate with Blynk. Remember
// To avoid delay () function!
}

so it Global nepratsyue
here writes a serial port

[2325] Connected to WiFi
[2325] IP: 192.168.0.110
[2325]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v0.4.3 on NodeMCU

[5001] Connecting to blynk-cloud.com:8442
[18068] Connecting to blynk-cloud.com:8442
[32317] Connecting to blynk-cloud.com:8442
[46541] Connecting to blynk-cloud.com:8442
[60841] Connecting to blynk-cloud.com:8442
[75065] Connecting to blynk-cloud.com:8442
[89289] Connecting to blynk-cloud.com:8442
[103438] Connecting to blynk-cloud.com:8442
[117637] Connecting to blynk-cloud.com:8442
[131861] Connecting to blynk-cloud.com:8442
[146185] Connecting to blynk-cloud.com:8442
[160410] Connecting to blynk-cloud.com:8442
[174758] Connecting to blynk-cloud.com:8442
[188982] Connecting to blynk-cloud.com:8442
[203206] Connecting to blynk-cloud.com:8442
[217505] Connecting to blynk-cloud.com:8442
[231730] Connecting to blynk-cloud.com:8442
[245954] Connecting to blynk-cloud.com:8442
[260203] Connecting to blynk-cloud.com:8442
[274402] Connecting to blynk-cloud.com:8442
[288751] Connecting to blynk-cloud.com:8442

here’s firmware back bay
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth [] = “6f80a51fbd384fc3ac91718c7c0c78cb”;

void setup ()
{
Serial.begin (115200)

WiFi.mode (WIFI_STA);

int cnt = 0;
while (WiFi.status ()! = WL_CONNECTED) {
delay (500);
Serial.print ( “.”);
if (cnt ++> = 10) {
WiFi.beginSmartConfig ();
while (1) {
delay (1000);
if (WiFi.smartConfigDone ()) {
Serial.println ();
Serial.println ( “SmartConfig: Success”);
break;
}
Serial.print ( “|”);
}
}
}

WiFi.printDiag (Serial);

Blynk.config (auth);
}

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

Initially it on this pidklyuchaetsya and sweat rozryvaetsya connectivity

PHY mode: N
Channel: 9
AP id: 0
Status: 5
Auto connect: 1
SSID (10): OSTROVSKIY
Passphrase (10): vova888888
BSSID set: 0
[2318]
___ __ __
/ ) / / _____ _ / / __
/ _ / / // / _ \ / ’
/
/ ____ / _ / \ _ / _ // _ / _ / \ _
/ ___ / V0.4.3 on NodeMCU

[5001] Connecting to blynk-cloud.com:8442
[13528] Ready (ping: 1ms).
[28940] Connecting to blynk-cloud.com:8442
[42286] Connecting to blynk-cloud.com:8442
[56610] Connecting to blynk-cloud.com:8442
[70884] Connecting to blynk-cloud.com:8442
[85108] Connecting to blynk-cloud.com:8442
[99382] Connecting to blynk-cloud.com:8442
[113506] Connecting to blynk-cloud.com:8442
[127730] Connecting to blynk-cloud.com:8442

what problems I myself can not concepts, why not want to work

Paste the Serial output with the following debug code at the very top of your sketch… above the libraries.

#define Blynk_PRINT Serial

I have a similar problem.
I brought up the local server according to the instructions.
in general, it works, but very often the connection takes too long.
Device ESP8266. Server - Khadas VIM3 (Ubuntu 20.04)

20:20:05.422 -> [6208] Ready (ping: 49ms).
20:20:05.465 -> Blynk Started OK...
20:20:05.465 -> OTA Started OK...
20:20:10.547 -> Sleeping...
20:20:38.644 -> Woke up!
20:21:08.094 -> WiFi reconnecting...
20:21:08.094 -> [41600] Connecting to EARL.net
20:21:14.572 -> [48080] Connected to WiFi
20:21:14.572 -> [48080] IP: 172.18.1.26
20:21:14.572 -> [48080] 
20:21:14.572 ->     ___  __          __
20:21:14.572 ->    / _ )/ /_ _____  / /__
20:21:14.572 ->   / _  / / // / _ \/  '_/
20:21:14.572 ->  /____/_/\_, /_//_/_/\_\
20:21:14.606 ->         /___/ v1.0.0-beta.3 on ESP8266
20:21:14.606 -> 
20:21:14.606 -> **[48087] [client] Connecting to - 172.18.1.111**
20:21:14.801 -> [48301] Ready (ping: 54ms).
20:21:14.887 -> Connection restored OK...
20:21:14.887 -> Data sending started...
20:21:21.916 -> millis() = 55432
20:21:22.534 ->  Data sended OK...
20:21:22.622 -> Sended OK...
20:21:27.615 -> Sleeping...
20:21:55.831 -> Woke up!
20:22:25.276 -> WiFi reconnecting...
20:22:25.276 -> [91366] Connecting to EARL.net
20:22:31.771 -> [97847] Connected to WiFi
20:22:31.771 -> [97848] IP: 172.18.1.26
20:22:31.771 -> [97848] 
20:22:31.771 ->     ___  __          __
20:22:31.771 ->    / _ )/ /_ _____  / /__
20:22:31.771 ->   / _  / / // / _ \/  '_/
20:22:31.771 ->  /____/_/\_, /_//_/_/\_\
20:22:31.771 ->         /___/ v1.0.0-beta.3 on ESP8266
20:22:31.771 -> 
20:22:31.771 -> **[97855] [client] Connecting to - 172.18.1.111**
20:22:37.892 -> **[103970] [client] Connecting to - 172.18.1.111**
20:22:44.004 -> **[110106] [client] Connecting to - 172.18.1.111**
20:22:50.156 -> **[116250] [client] Connecting to - 172.18.1.111**
20:22:56.287 -> **[122387] [client] Connecting to - 172.18.1.111**
20:23:02.427 -> **[128532] [client] Connecting to - 172.18.1.111**
20:23:02.678 -> [128744] Ready (ping: 16ms).
20:23:02.717 -> Connection restored OK...
20:23:02.717 -> Data sending started...
20:23:14.123 -> millis() = 140224
20:23:14.765 ->  Data sended OK...
20:23:14.808 -> Sended OK...
20:23:19.798 -> Sleeping...

Server log

17:01:42.446 INFO - Using data dir ‘/home/khadas/blynk-server/DATA’
17:01:43.337 INFO - Region : local. Host : 172. 18.1. 111.
17:01:44.128 INFO - Initializing gmail smtp mail transport. Username : examplegmailcom. SMTP host : smtpgmailcom:587
17:01:44.215 INFO - Reports : 0
17:01:44.219 INFO - Didn’t find Let’s Encrypt certificates.
17:01:44.220 INFO - Automatic certificate generation is turned ON.
17:01:43.796 INFO - HTTP API and WebSockets server listening at 8080 port.
17:01:43.800 INFO - HTTPS API, WebSockets and Admin page server listening at 9443 port.
17:01:43.803 INFO - Mqtt hardware server listening at 8440 port.
17:01:48.550 WARN - User ‘nvyandexru’ credentials are wrong. /172. 18.1. 10:46328
17:01:51.276 WARN - User 'nv
yandexru’ credentials are wrong. /172. 18.1. 10:46330
17:01:53.161 WARN - User ‘nvyandexru’ credentials are wrong. /172. 18.1. 10:46332
17:03:58.701 WARN - User 'nv
yandexcom’ not registered. /172. 18.1. 10:46340
17:04:55.275 WARN - User 'nvyandexru’ credentials are wrong. /172. 18.1. 10:46358
17:07:36.722 INFO - Trying register user : ea
mgmailcom, app : Blynk
17:07:36.745 INFO - Registered ea
mgmailcom.
17:07:36.941 INFO - ea
mgmail.com Blynk-app (android-22729) joined.
17:07:38.270 WARN - Error sending greeting email for ea
*mgmailcom.
17:07:52.120 INFO - Creating new dashboard.

Uninstall this and install 0.6.1 instead.

Pete.