WS2812FX with Blynk disconnects

Hello, I have a problem with my project… Well it works, the following code works correctly but when I stop using it(when I stop change the data) it disconnects… idk if its something wrong with the code also I don’t know if there is a delay() function inside the WS2812FX library.
What I have done is:
created a menu widget(v3)(each item has a different mode), used zeRGBa(v2), and 2 sliders, one for brightness(v1) and one for speed(v4).
if I use a mode (from the menu) that changes the colors quickly(for example rainbow mode) it disconnects quicker than if I use a static color mode…
Any thoughts?


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

#define LED_COUNT 16
#define LED_PIN 5
#define BLYNK_PRINT Serial
WS2812FX ws2812fx = WS2812FX(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
//FX_MODE_FIREWORKS_RANDOM
void setup()
{
Serial.begin(9600);
Blynk.begin("auth", "ssid", "pass");
  ws2812fx.init();
  ws2812fx.setBrightness(5);
  ws2812fx.setSpeed(2500);
  ws2812fx.setColor(BLACK);
  ws2812fx.setMode(FX_MODE_STATIC);
  //ws2812fx.setMode(FX_MODE_COMET);
  //ws2812fx.setSpeed(1100);
  Blynk.virtualWrite(V1, 5);
  Blynk.virtualWrite(V4, 2500);
  ws2812fx.start();
}
int R, G, B;
BLYNK_WRITE(V2)
{

  R = param[0].asInt();
  G = param[1].asInt();
  B = param[2].asInt();
  ws2812fx.setColor(R, G, B);
  ws2812fx.setMode(FX_MODE_STATIC);

}

BLYNK_WRITE(V3){
  switch(param.asInt()){
    case 1:{
      //ws2812fx.setColor(R, G, B);
      ws2812fx.setMode(FX_MODE_RAINBOW);
      ws2812fx.setSpeed(3000);
      break;
    }
    case 2:{
      ws2812fx.setColor(R, G, B);
      ws2812fx.setMode(FX_MODE_BREATH);
      Blynk.virtualWrite(V1, 100);
      ws2812fx.setBrightness(100);
      break;
    }
    case 3:{
      ws2812fx.setMode(FX_MODE_COLOR_WIPE_RANDOM);
      Blynk.virtualWrite(V4, 2000);
      ws2812fx.setSpeed(2500);
      break;
    }
    case 4:{
      ws2812fx.setMode(FX_MODE_RAINBOW_CYCLE);
      Blynk.virtualWrite(V4, 2000);
      ws2812fx.setSpeed(2000);
      break;
    }
    case 5:{
      ws2812fx.setMode(FX_MODE_TWINKLE_FADE_RANDOM);
      Blynk.virtualWrite(V4, 700);
      ws2812fx.setSpeed(700);
      break;
    }
    case 6:{
      ws2812fx.setMode(FX_MODE_CHASE_RAINBOW);
      ws2812fx.setSpeed(1800);
      Blynk.virtualWrite(V4, 1800);
      break;
    }
    default:{
      ws2812fx.setColor(R, G, B);
      ws2812fx.setMode(FX_MODE_STATIC);
    }
  }
}

BLYNK_WRITE(V1){
  ws2812fx.setBrightness(param.asInt());
}
BLYNK_WRITE(V4){
  ws2812fx.setSpeed(param.asInt());
}
void loop()
{
  ws2812fx.service();
  Blynk.run();
}

does blynk support the WS2812FX library?
I’m asking because I haven’t found any helpful threads in this forum and generally in other forums so my guess is that its not supported because of the possible delay() function the WS2812FX lib is using?
Any thoughts?

Also I have to say that after some tests I made it to work but only with my local rpi server…
When I try to connect it with the blynk cloud it works for 5-6 minutes and then is just tries to reconnect…
Updated code:

#define BLYNK_PRINT Serial


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

#include <DNSServer.h>
#include <WebServer.h>
#include <WiFiManager.h>

#include <WS2812FX.h>

#define LED_COUNT 16
#define LED_PIN 12
WS2812FX ws2812fx = WS2812FX(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);

void setup()
{
  Serial.begin(9600);
  WiFiManager wifiManager;
  //wifiManager.resetSettings(); //uncomment this if its for testing
  wifiManager.autoConnect("CubeLamp");
  Serial.println("connected...yeey :)");
  WiFi.mode(WIFI_STA);
  Blynk.config("auth");
  bool result = Blynk.connect();

  if (result != true)
  {
  Serial.println("BLYNK Connection Fail");
  ESP.reset();
  }
  else
  {
  Serial.println("BLYNK Connected!! Yay again");
   }
  Blynk.virtualWrite(V1, 20);
  Blynk.virtualWrite(V4, 2500);

  ws2812fx.init();
  ws2812fx.setBrightness(20);
  ws2812fx.setSpeed(2500);
  ws2812fx.setColor(BLACK);
  ws2812fx.setMode(FX_MODE_STATIC);
  ws2812fx.start();
}

int R, G, B;
BLYNK_WRITE(V7)
{
  R = param[0].asInt();
  ws2812fx.setColor(R, G, B);
  ws2812fx.setMode(FX_MODE_STATIC);

}
BLYNK_WRITE(V8)
{
  G = param.asInt();
  ws2812fx.setColor(R, G, B);
  ws2812fx.setMode(FX_MODE_STATIC);

}
BLYNK_WRITE(V9)
{
  B = param.asInt();
  ws2812fx.setColor(R, G, B);
  ws2812fx.setMode(FX_MODE_STATIC);

}

BLYNK_WRITE(V3){
  switch(param.asInt()){
    case 1:{
      //ws2812fx.setColor(R, G, B);
      ws2812fx.setMode(FX_MODE_RAINBOW);
      ws2812fx.setSpeed(3000);
      break;
    }
    case 2:{
      ws2812fx.setColor(R, G, B);
      ws2812fx.setMode(FX_MODE_BREATH);
      Blynk.virtualWrite(V1, 100);
      ws2812fx.setBrightness(100);
      break;
    }
    case 3:{
      ws2812fx.setMode(FX_MODE_COLOR_WIPE_RANDOM);
      Blynk.virtualWrite(V4, 2000);
      ws2812fx.setSpeed(2500);
      break;
    }
    case 4:{
      ws2812fx.setMode(FX_MODE_RAINBOW_CYCLE);
      Blynk.virtualWrite(V4, 2000);
      ws2812fx.setSpeed(2000);
      break;
    }
    case 5:{
      ws2812fx.setMode(FX_MODE_TWINKLE_FADE_RANDOM);
      Blynk.virtualWrite(V4, 700);
      ws2812fx.setSpeed(700);
      break;
    }
    case 6:{
      ws2812fx.setMode(FX_MODE_CHASE_RAINBOW);
      ws2812fx.setSpeed(1800);
      Blynk.virtualWrite(V4, 1800);
      break;
    }
    default:{
      ws2812fx.setColor(R, G, B);
      ws2812fx.setMode(FX_MODE_STATIC);
    }
  }
}

BLYNK_WRITE(V1){
  ws2812fx.setBrightness(param.asInt());
}
BLYNK_WRITE(V4){
  ws2812fx.setSpeed(param.asInt());
}
void loop()
{
  if(!Blynk.connected()){
    Serial.println("Trying to reconnect..");
    Blynk.connect();
  }else{
    Blynk.run();
  }
  ws2812fx.service();
}