Set Property and Eventor

On Android with latest everything:

Is it a feature for LED’s and labels to continue to have their properties changed when the app is stopped as that is what happens with my system?

Eventor also crashes my sytem with something as basic as:

If V6 = 3 set V7 99 on 3 second intervals.

Any ideas?

I can send a video later but off to the beach now.

OUououaaaououou!!! Go to the beach good man!

Yes. It is expected. Do you expect another behaviour?

Do you mean app crash?

I was expecting that if the app was stopped then data transfer would stop.

Are you saying the only way to stop data flowing is to power off the ESP?

Eventor is causing the connection to be dropped, flood?

Ah… I see. Yes, this is a bug. Fixed already.

Don’t think so. Connection to hardware, right?

Thanks for the “stop app” fix. Is there a specific Github file I need or is it in the App?

Yes Eventor appears to be causing the ESP to disconnect from the server, and reconnect and disconnect etc. Connections last no more than about 5 seconds. I might turn off Set Property and see if it crashes with just the Eventor running.

Also Set Property with a few other virtualWrite’s done more frequent than every 3 seconds causes the same disconnects as Eventor.

Please download latest server version again - https://github.com/blynkkk/blynk-server/releases/tag/v0.17.2

Please show your events and code responsible for triggering events.

Is your server using the latest server version with the fix as the Set Properties are still running with the project stopped?

@Costas Blynk cloud is without fix.

That’s ok, I’ll check locally.

@Dmitriy confirmed latest version of server has fixed the “stop project” bug on local servers.

Below is a sketch for the issue with ESP (WeMos D1 Mini) disconnecting from server.

At line 17 a figure of around 2500 (ms) the ESP is stable but when you drop this figure to 1500 the ESP keeps disconnecting. Somewhere between 1500 and 2500 it is hit and miss.

With a slider on V4 (range 0 to 5) and left on 0 the project will:

Cycle through the 5 colours for an LED on V0.
Write the colour number (1 to 5) on Value Display V6.
Change the label text on Value Display V5 to the name of the colour (Red, Blue etc).
Write the name of the colour on Value Display V5 in the colour of the LED

/*
SetPropertyV1.ino by Costas 30/8/16
Testing Set Property
*/
//#define BLYNK_DEBUG  
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h> 
#include <SimpleTimer.h>

#define BLYNK_GREEN     "#23C48E"  // 1
#define BLYNK_BLUE      "#04C0F8"  // 2
#define BLYNK_YELLOW    "#ED9D00"  // 3
#define BLYNK_RED       "#D3435C"  // 4
#define BLYNK_DARK_BLUE "#5F7CD8"  // 5

#define MyTimer 1500  // x second intervals

SimpleTimer timer;


char auth[] =  "xxxxxxxxxxxxxx";
char ssid[] =  "xxxxxxxxxxxxxx";
char pass[] = "xxxxxxxxxxxxxx";
String chosencolour;
String LEDcolour;
int slidercolour = 1;
bool boolautocolour = true;

void mycolours()
{
  if(boolautocolour == false){
    pickcolour();
  }
  else{
    autocolour();
  }
  Blynk.setProperty(V0, "color", LEDcolour);   // green LED is default
  Blynk.virtualWrite(V5, chosencolour);
  Blynk.virtualWrite(V6, slidercolour);
  Blynk.virtualWrite(V0, 255);             // LED On   
  delay(500);
  Blynk.virtualWrite(V0, 0);               // LED Off
}

void autocolour(){  // slidercolour was 0
  boolautocolour =  true;
  slidercolour++;
  if(slidercolour == 6){
    slidercolour = 1; // reset back to green
  } 
  pickautocolour();   
}

void pickautocolour(){
  if(slidercolour == 1){
    LEDcolour = BLYNK_GREEN;
    chosencolour = "Green";
    Blynk.setProperty(V5, "color", BLYNK_GREEN);
    Blynk.setProperty(V5, "label", "Green");   
  }
  else if(slidercolour == 2){
    LEDcolour = BLYNK_BLUE; 
    chosencolour = "Blue";
    Blynk.setProperty(V5, "color", BLYNK_BLUE);
    Blynk.setProperty(V5, "label", "Blue");  
  }
  else if(slidercolour == 3){
    LEDcolour = BLYNK_YELLOW;
    chosencolour = "Yellow";
    Blynk.setProperty(V5, "color", BLYNK_YELLOW);
    Blynk.setProperty(V5, "label", "Yellow");   
  }  
  else if(slidercolour == 4){
    LEDcolour = BLYNK_RED;
    chosencolour = "Red"; 
    Blynk.setProperty(V5, "color", BLYNK_RED);
    Blynk.setProperty(V5, "label", "Red");  
  }  
  else if(slidercolour == 5){
    LEDcolour = BLYNK_DARK_BLUE;
    chosencolour = "Dark Blue"; 
    Blynk.setProperty(V5, "color", BLYNK_DARK_BLUE);
    Blynk.setProperty(V5, "label", "Dark Blue"); 
  }
}

void pickcolour(){
  if(slidercolour != 0){
    boolautocolour == false;
  }
  pickautocolour(); 
}

BLYNK_WRITE(V4){  // slider to pick LED colour 1 Green 2 Blue 3 Yellow 4 Red 5 Dark blue
  slidercolour = param.asInt();
  if(slidercolour != 0){
    boolautocolour = false;
  }
  else{
    boolautocolour = true;  
  }
}

void setup()
{
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass, "192.168.10.10");  // local server IP
  while (Blynk.connect() == false) {
    // Wait until connected
  }
  timer.setInterval(MyTimer, mycolours);

}

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

Real time video with 400ms “blink time” and slider simulation on a Cloud server:

So as long as you don’t push too much data you can get a pretty short cycle time.

// LEDSelectorV3.ino by Costas 31/8/16   Testing Set Property with LED widget
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h> 
#include <SimpleTimer.h>

// 1 GREEN "#23C48E", 2 LIGHT BLUE "#04C0F8", 3 YELLOW "#ED9D00", 4 RED "#D3435C", 5 DARK BLUE "#5F7CD8"
// 6 will scroll through colours 1 to 5

#define MyTimer 400 // ms intervals for just LED 400ms is OK but 300ms is not
//#define SIMULATOR  // see line below
int SIMULATOR = 1; // better with Blynk button than #ifdef, on by default
SimpleTimer timer;

char auth[] = "xxxxxxxx";
char ssid[] = "xxxxxxxx";
char pass[] = "xxxxxxx";
char LEDcolour[8] = "#D3435C";   // Red
int slidercolour = 3;  // start up with Red LED, red is 4 but function has ++
bool boolautocolour = true;
bool LEDisON = true;

void pickcolour(){
  if(slidercolour != 6){  // was 0 but 6 used due to slider scale bug
    boolautocolour == false;
  }
  pickautocolour(); 
}

void mycolours()
{
  if(boolautocolour == false){
    pickcolour();
  }
  else{
    autocolour();
  }
  Blynk.setProperty(V0, "color", LEDcolour);   // green LED is default
  
  if((slidercolour != 6) && (LEDisON == true)){ // blink effect is not needed in colour scroll mode
    Blynk.virtualWrite(V0, 0);               // turn LED OFF
    LEDisON = false;
  }
  if((slidercolour != 6) && (LEDisON == false)){ // blink effect is not needed in colour scroll mode
    Blynk.virtualWrite(V0, 255);             // turn LED ON   
    LEDisON = true;               
  }  
}

void autocolour(){  // slidercolour was 0
  boolautocolour =  true;
  slidercolour++;
  if(slidercolour == 7){  // was 6 but changed to 7 due to slider scale bug
    slidercolour = 1; // reset back to green
  } 
  pickautocolour();   
}

void pickautocolour(){
  if(slidercolour == 1){           // Green
    strcpy(LEDcolour, "#23C48E");  // NOT "BLYNK_GREEN" from original #define BLYNK GREEN "#23C48E"
    if(SIMULATOR){
      Blynk.virtualWrite(V1, 1);     // SIMULATION slider
    }
  }
  else if(slidercolour == 2){      // Light Blue
    strcpy(LEDcolour, "#04C0F8");
    if(SIMULATOR){
      Blynk.virtualWrite(V1, 2);     // SIMULATION slider
    }
  }
  else if(slidercolour == 3){      // Yellow
    strcpy(LEDcolour, "#ED9D00");
    if(SIMULATOR){
      Blynk.virtualWrite(V1, 3);     // SIMULATION slider
    }
  }  
  else if(slidercolour == 4){      // Red
    strcpy(LEDcolour, "#D3435C");
    if(SIMULATOR){
      Blynk.virtualWrite(V1, 4);     // SIMULATION slider
    }
  }  
  else if(slidercolour == 5){      // Dark Blue
    strcpy(LEDcolour, "#5F7CD8");
    if(SIMULATOR){
      Blynk.virtualWrite(V1, 5);
    }
  }
}

BLYNK_WRITE(V2){  // stop and start simulator
  SIMULATOR = param.asInt();
}

BLYNK_WRITE(V4){  // slider to pick LED colour 1 Green 2 Light Blue 3 Yellow 4 Red 5 Dark blue, 6 scroll all colours
  slidercolour = param.asInt();
  if(SIMULATOR){
    Blynk.virtualWrite(V1, slidercolour);  // SIMULATION slider
  }
  if(slidercolour != 6){      // was 0 but changed to 6 due to slider scale bug
    boolautocolour = false;
  }
  else{
    boolautocolour = true;  
  }
}

void setup()
{
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass, "x.x.x.x");  // local server IP
  while (Blynk.connect() == false) {
  }
  timer.setInterval(MyTimer, mycolours);
  Blynk.virtualWrite(V2, HIGH); // Simulation button ON at start up (consider sync later)
  Blynk.virtualWrite(V4, 6);    // Set LED colour selection slider to position 6
  Blynk.virtualWrite(V1, 6);    // Set simulation slider to position 6

}

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

Could you please let us know when your server has had the fix applied, thanks.

Ok. But there are no plans for new deploy in nearest week.