Login Timeout

I’ve just notice since 30 minutes ago I can not login to Blynk Cloud Server

 1384, room 16 
tail 8
chksum [21785] Connecting to Camar-24
[25788] Connected to WiFi
[25788] IP: 192.168.1.109
[25788] Blynk v0.3.8 on NodeMCU
[25788] Connecting to blynk-cloud.com:8442
[25868] Ready (ping: 0ms).
[30998] Login timeout
[30999] Connecting to blynk-cloud.com:8442
[31070] Ready (ping: 0ms).
[36189] Login timeout
[36190] Connecting to blynk-cloud.com:8442
[36257] Ready (ping: 1ms).

I know the new Cloud Blynk Server just Implemented, what should I do now?

TIA

Same problem here
[19] Blynk v0.3.9 on Arduino Uno [520] Connecting to RingOfFire [3812] 0018000902-AI03 [6947] 192.168.1.3 [6976] Connected to WiFi [114638] Login timeout [125346] Login timeout [134193] Ready (ping: 124ms). [150294] Login timeout [159056] Ready (ping: 125ms).

Code:

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#define ONE_WIRE_BUS 10
#include <OneWire.h>
#include <DallasTemperature.h>
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <TimeLib.h>
#include <SimpleTimer.h>



OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature DS18B20(&oneWire);



// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "03123be3ecbf4ab4b275528b15a36b2e";
SimpleTimer timer;

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xxxxx";
char pass[] = "xxxxx";

// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1

// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600

ESP8266 wifi(&EspSerial);

void setup()
{
  // Set console baud rate
  Serial.begin(9600);
  delay(10);
  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, ssid, pass);
  DS18B20.begin();
  

  timer.setInterval(1000L, sendTemps); // Temperature sensor polling interval (5000L = 5 seconds)
  
}
float tempCong;


void sendTemps()
{
  DS18B20.requestTemperatures(); // Polls the sensors
  

  tempCong = DS18B20.getTempCByIndex(0); // Gets first probe on wire in lieu of by address


  Blynk.virtualWrite(4, tempCong);

}

void loop()
{
  if (tempCong >= -8) 
    {
      //Blynk.notify("Temperatura alta!");
      Blynk.email("rodrigo.cavalheiro@gmail.com", "Alerta de temperatura", "Câmara de congelados acima de -8C!");
      delay(100000);
     }

 
  Blynk.run();
  timer.run();
}
`

Any chance?

Hard to tell if I’m fighting some problem tonight as well or if I have code issues… Just sits there connecting to blynk-cloud.com over & over.

Simple fix, remove Blynk.email() from the loop().

The issue you ask yourself? Well when if (tempCong >= -8) is TRUE, then it will loop the Blynk.email function hundreds of times and you will be disconnected from the cloud server due to flooding.

Also put Blynk.run() first in the loop and remove the silly delay(100000); because that will also cause a disconnect.
Avoid using delays completely.

Hey Jamin! Thanks for answering.

I need to monitor the fridge constantly. If I put the if-clause out of the loop, I’ll be taking the reads only one time! Right?

Thanks.

You can use SimpleTimer library to query the data once in 30 secs.
Also you can use a Graph widget for an alternative.

I saw that you run the sendTemps in 1 sec interval. Put the email part in there.

1 Like

yup put it behind a timer at 500ms, then make sure you set a boolean after you send the email so that it only sends once.

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

void monitorFridge(){
  if (tempCong >= -8 && !sentNotice) 
    {
      //Blynk.notify("Temperatura alta!");
      Blynk.email("rodrigo.cavalheiro@gmail.com", "Alerta de temperatura", "Câmara de congelados acima de -8C!");
     sentNotice= 1; // mark it sent so it doesnt loop and flood
     } else if(tempCong != -8) {
   sentNotice= 0;
}
}

Jamin, that was awesome!

I can read the temperatures in the app but I don’t receive the emails.
Please notice that there are 2 temp sensors.
Both boolean variables were declared correctly.

My code:

    void setup()
    {
  // Set console baud rate
  Serial.begin(9600);
  delay(10);
  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, ssid, pass);
  DS18B20.begin();
  DS18B20B.begin();

  timer.setInterval(5000L, sendTemps); // Temperature sensor polling interval (5000L = 5 seconds)
  
}

void sendTemps()
{
  DS18B20.requestTemperatures(); // Polls the sensors
  DS18B20B.requestTemperatures();

  tempCong = DS18B20.getTempCByIndex(0); // Gets first probe on wire in lieu of by address
  tempResf = DS18B20B.getTempCByIndex(0);

  Blynk.virtualWrite(4, tempCong);
  Blynk.virtualWrite(5, tempResf);
}

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

void monitorFridge(){
  if (tempCong >= -8 && !sentNotice1) 
    {
      //Blynk.notify("Temperatura alta!");
      Blynk.email("rodrigo.cavalheiro@gmail.com", "Alerta de temperatura", "Câmara de congelados acima de -8C!");
     sentNotice1= 1; // mark it sent so it doesnt loop and flood
     } else if(tempCong < -8) {
   sentNotice1= 0;
}
  if (tempResf >= 11 && !sentNotice2) 
    {
      //Blynk.notify("Temperatura alta!");
      Blynk.email("rodrigo.cavalheiro@gmail.com", "Alerta de temperatura", "Câmara de congelados acima de 11C!");
     sentNotice2= 1; // mark it sent so it doesnt loop and flood
     } else if(tempResf < 11 ) {
   sentNotice2= 0;
}
}

Hey firstly just make sure you format your code correctly.
do this:

```
code
```

also you forgot to set up a timer for monitorFridge().

timerFridge = timer.setInterval(500L, monitorFridge); 

Jamin, last question: I can’t receive the emails.

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

void monitorFridge(){
  if (tempCong >= -8 && !sentNotice1) 
    {
      //Blynk.notify("Temperatura alta!");
     Blynk.email("rodrigo.cavalheiro@gmail.com", "Congelados > Alerta de temperatura", "Câmara de congelados acima de -8C!");
     sentNotice1= 1; // mark it sent so it doesnt loop and flood
     } else if(tempCong < -8) {
     sentNotice1= 0;
}
  if (tempResf >= 11 && !sentNotice2) 
    {
      //Blynk.notify("Temperatura alta!");
     Blynk.email("rodrigo.cavalheiro@gmail.com", "Refrigerados > Alerta de temperatura", "Câmara de refrigerados acima de 11C!");
     sentNotice2= 1; // mark it sent so it doesnt loop and flood
     } else if(tempResf < 11 ) {
     sentNotice2= 0;
}
}

Also, I put a timerFridge.setInterval(5000L, monitorFridge); in void setup()

Thanks!

where is sentnotice declared?

Please paste your code in it’s entirety.

Here it ts.

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#define ONE_WIRE_BUS 10
#define TWO_WIRE_BUS 11

#include <OneWire.h>
#include <DallasTemperature.h>
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <TimeLib.h>
#include <SimpleTimer.h>

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature DS18B20(&oneWire);

OneWire twoWire(TWO_WIRE_BUS);
DallasTemperature DS18B20B(&twoWire);

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


// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "RingOfFire";
char pass[] = "xxxxxxx";

//variables
float tempCong;
float tempResf;
boolean sentNotice1;
boolean sentNotice2;
SimpleTimer timer;
SimpleTimer timerFridge;

// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1

// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600

ESP8266 wifi(&EspSerial);

void setup()
{
  // Set console baud rate
  Serial.begin(9600);
  delay(10);
  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, ssid, pass);
  DS18B20.begin();
  DS18B20B.begin();

  timer.setInterval(5000L, sendTemps); // Temperature sensor polling interval (5000L = 5 seconds)
  timerFridge.setInterval(5000L, monitorFridge);
}

void sendTemps()
{
  DS18B20.requestTemperatures(); // Polls the sensors
  DS18B20B.requestTemperatures();

  tempCong = DS18B20.getTempCByIndex(0); // Gets first probe on wire in lieu of by address
  tempResf = DS18B20B.getTempCByIndex(0);

  Blynk.virtualWrite(4, tempCong);
  Blynk.virtualWrite(5, tempResf);
}

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

void monitorFridge(){
  if (tempCong >= -8 && !sentNotice1) 
    {
      //Blynk.notify("Temperatura alta!");
     Blynk.email("rodrigo.cavalheiro@gmail.com", "Congelados > Alerta de temperatura", "Câmara de congelados acima de -8C!");
     sentNotice1= 1; // mark it sent so it doesnt loop and flood
     } else if(tempCong < -8) {
     sentNotice1= 0;
}
  if (tempResf >= 11 && !sentNotice2) 
    {
      //Blynk.notify("Temperatura alta!");
     Blynk.email("rodrigo.cavalheiro@gmail.com", "Refrigerados > Alerta de temperatura", "Câmara de refrigerados acima de 11C!");
     sentNotice2= 1; // mark it sent so it doesnt loop and flood
     } else if(tempResf < 11 ) {
     sentNotice2= 0;
}
}

btw - this is how i run simpletimer:

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#define ONE_WIRE_BUS 10
#define TWO_WIRE_BUS 11

#include <OneWire.h>
#include <DallasTemperature.h>
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <TimeLib.h>
#include <SimpleTimer.h>

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature DS18B20(&oneWire);

OneWire twoWire(TWO_WIRE_BUS);
DallasTemperature DS18B20B(&twoWire);

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


// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "RingOfFire";
char pass[] = "xxxxxxx";

//variables
float tempCong;
float tempResf;
boolean sentNotice1;
boolean sentNotice2;
SimpleTimer timer;

// Hardware Serial on Mega, Leonardo, Micro...
//#define EspSerial Serial1

// or Software Serial on Uno, Nano...
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600

ESP8266 wifi(&EspSerial);

void setup()
{
  // Set console baud rate
  Serial.begin(9600);
  delay(10);
  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, ssid, pass);
  DS18B20.begin();
  DS18B20B.begin();

  timer.setInterval(5000L, sendTemps); // Temperature sensor polling interval (5000L = 5 seconds)
  timer.setInterval(5000L, monitorFridge);
}

void sendTemps()
{
  DS18B20.requestTemperatures(); // Polls the sensors
  DS18B20B.requestTemperatures();

  tempCong = DS18B20.getTempCByIndex(0); // Gets first probe on wire in lieu of by address
  tempResf = DS18B20B.getTempCByIndex(0);

  Blynk.virtualWrite(4, tempCong);
  Blynk.virtualWrite(5, tempResf);
}

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

void monitorFridge() {
  if (tempCong >= -8 && !sentNotice1)
  {
    //Blynk.notify("Temperatura alta!");
    Blynk.email("rodrigo.cavalheiro@gmail.com", "Congelados > Alerta de temperatura", "Câmara de congelados acima de -8C!");
    sentNotice1 = 1; // mark it sent so it doesnt loop and flood
  } 
  else if (tempCong < -8) 
  {
    sentNotice1 = 0;
  }
  if (tempResf >= 11 && !sentNotice2)
  {
    //Blynk.notify("Temperatura alta!");
    Blynk.email("rodrigo.cavalheiro@gmail.com", "Refrigerados > Alerta de temperatura", "Câmara de refrigerados acima de 11C!");
    sentNotice2 = 1; // mark it sent so it doesnt loop and flood
  } 
  else if (tempResf < 11 ) 
  {
    sentNotice2 = 0;
  }
}

you should add in some serial prints to see if/where the code is not working…

1 Like

No success at all… No email sent. Do you guys have any idea?

use serial prints to see where it is failing.

void monitorFridge() {
  if (tempCong &gt;= -8 && !sentNotice1)
  {
    //Blynk.notify("Temperatura alta!");
    Blynk.email("rodrigo.cavalheiro@gmail.com", "Congelados &gt; Alerta de temperatura", "Câmara de congelados acima de -8C!");
serial.Print(F("temp is high! just tried to send email"));
    sentNotice1 = 1; // mark it sent so it doesnt loop and flood
  } 
  else if (tempCong &lt; -8) 
  {
    serial.Print(F("temp is OK! no need to send email"));
sentNotice1 = 0;
  }
  if (tempResf &gt;= 11 && !sentNotice2)
  {
    //Blynk.notify("Temperatura alta!");
    Blynk.email("rodrigo.cavalheiro@gmail.com", "Refrigerados &gt; Alerta de temperatura", "Câmara de refrigerados acima de 11C!");
    sentNotice2 = 1; // mark it sent so it doesnt loop and flood
  } 
  else if (tempResf &lt; 11 ) 
  {
    sentNotice2 = 0;
  }
}

Hello!

I changed the code to include serial prints, tried to change the email but email still not working.

Serial monitor:

[19] Blynk v0.3.10 on Arduino Uno
[520] Connecting to Papa-Rica Wi-Fi
[3585] 
OK
[6727] 192.168.1.100
[6757] Connected to WiFi
temp is high! just tried to send email[14504] Login timeout
[26024] Login timeout
[36716] Login timeout
[46937] Ready (ping: 1589ms).

Even when I try to send a “Success login” notification or email on void setup() it completely ignores the command.
Do I have to call any library for notifications or email?

Output from last code:

[19] Blynk v0.3.10 on Arduino Uno
[525] Connecting to Papa-Rica Wi-Fi
[3592] 0018000902-AI03
[6731] 192.168.1.100
[6761] Connected to WiFi
temp is high! just tried to send email
[14529] Login timeout
[25542] Ready (ping: 1588ms).
[43947] Heartbeat timeout
[53080] Ready (ping: 1589ms).
temp is OK! no need to send email
temp is OK! no need to send email
temp is OK! no need to send email
temp is OK! no need to send email
temp is OK! no need to send email
temp is OK! no need to send email
temp is high! just tried to send email
[138557] Login timeout