Add, new project all stop working. Device is offline since

Hello!!! is you find the solution? I have the same situation! Old project work, than add new one and all stop working. Device is offline since…
ping of blynk cloud is 175mc

Device is WEMOS D1 mini

#include "DHT.h"
#define RELEON D4   //  реле ВКЛ на ноге Д4
#define RELEOFF D3   // реле ОТКЛ на ноге Д3
#define STATCONT D6 // контролируемый пин статус включения контактора
                    // #define PWR D7 // контролируемый пин питание 220В

#define DHTPIN D2 // what digital pin we're connected to
#define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h> //  таймер

bool releon ; 
bool releoff ;
int buttonState = 0;


// You should get Auth Token in the Blynk App.
char auth[] = "e1ee77a6dbaf48bcbc5b7374fb9d6f3b";
DHT dht(DHTPIN, DHTTYPE);

 
void setup()
{
  Serial.begin(115200);
  Blynk.begin(auth, "Da4ka", "8914597DD");
  pinMode(RELEON, OUTPUT);
  pinMode(RELEOFF, OUTPUT);
      //pinMode(STATCONT, INPUT);
  pinMode(PWR, INPUT);
  timer.setInterval(1000, sendOnOff);//устанавливаем перезапуск sendOnOff с интервалом 1с.
    //timer.setInterval(1000, pwrstat);//устанавливаем перезапуск pwrstat с интервалом 1с.
  
  dht.begin();
  
  digitalWrite(RELEON, LOW);
  digitalWrite(RELEOFF, HIGH);
  delay(500);
  digitalWrite(RELEOFF, LOW);
 }

WidgetLED led1(V6); //светодиод виджет на смарте подключен к V6 
SimpleTimer timer;

  //WidgetLED led2(V7); //светодиод виджет на смарте подключен к V7 
  //SimpleTimer timer;

void sendOnOff() {
  int x = digitalRead(STATCONT);//читаем пин статус включения контактора
  if (x == 0) {//проверим состояние
    led1.on(); //вкл вирт.светодиод
  }
  else { //иначе выключим
    led1.off();
  }
}
//void pwrstat() {
 // int y = digitalRead(PWR);//читаем пин модуля наличие 220V
  //if (y == 1) {//проверим состояние
    //led2.on(); //вкл вирт.светодиод
  //}
  //else { //иначе выключим
    //led2.off();
 // }
//}
 
BLYNK_WRITE(V1) // запрос данных с датчика DHT22
{
  buttonState = param.asInt();
  }
 
BLYNK_WRITE(V4) // реле D4 
{
  releon = param.asInt();
  digitalWrite(RELEON, releon);
}

BLYNK_WRITE(V5) // реле D3 
{
  releoff = param.asInt();
  digitalWrite(RELEOFF, releoff);
}


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

void Send(){
   float h = dht.readHumidity();  // Read temperature as Celsius (the default)
  float t = dht.readTemperature();
    //if (buttonState == 1)
  //{
  Blynk.virtualWrite(V2, h);
  Blynk.virtualWrite(V3, t);
  //}
}

Please don’t add “me toos” onto others projects… particularly old ones. That issue you tagged onto was most likely bad coding practice, as is likely yours… but otherwise are not “the same”.

I have moved your issue into your own topic.

Start with cleaning up your code… you are running a function directly from the void loop(), which runs hundreds of times a second… use timers instead for that function.

http://docs.blynk.cc/#blynk-firmware-blynktimer

Ребята правильно ли я понимаю, подозреваемый неправильный код перегружает процессор или server? что будет если его исправить или просто выключить его из сети? по идее он должен дать другому, который работал ранее заработать?

@Sergeyshatsky
https://community.blynk.cc/c/ru

Trash coding can be reason of esp or sever query overloading. it is understandable.

  • If we disconnect (last connected) device is it release the server and can it to give to other device to be Online status?
  • How many projects can be created and used on one mobile device? Is any restriction of number?

Sorry. didn’t get what you are asking.

I think the OP is implying that because the last connected project keeps disconnecting, he figures that it is somehow overloading the rest of his projects, so he want to know what the server limits are.

I don’t think he understands that the bad coding practices primarily affect the devices ability to run and stay connected to the server, and are not really affecting the rest of the server or other projects.

However, there may be a possibility that the OP hasn’t set up his Local Server properly… basically this topic issue is unclear :stuck_out_tongue:

for example - in android mobile was created 1 blynk project and it was work. some times with error -Offline since …date. There is not good internet connection, and I think that is due to this reason. Then I make a new - second project on WEMOS D1 mini and third project on ESP32 in area with good internet connection. Test of it and 1-2 projects and 1-3 was work, but have some disconnection offline status, but works. Than I install second project with the WEMOS board/ 2 project work some minutes and after 2-4 minutes all projects stopped due to Offline status.
This is the history. OH I forget - once I see in 2 project that board was not wemos, just esp8266 and it was work. I change it. But why both project stop working - have no idea. Did you?

@Sergeyshatsky your problem is your bad code, you can’t have send() running thousands of times a second in loop() trying to read your sensors. See GET_DATA example for how to call functions at timed intervals.

1 Like

Thank you for quick reply on end of the week I reprogramming wemos with youк comments and inform you as well.

Thank you for your comments. I make necessary correction and exclude send()running from loop. Half day all three project was offline with new sketch code. Than one start work , than second and third. One reason was wrong coding. All three project start working only after I change of code to the first project. Thanks for everybody for help. Think to set up local blynk server.