Hi. I bued a WS2812B led strip and it worked well. I have’t used it a few days, and today I got another WS2812B led strip. I connected the first one the same way like the second one (to the same arduino), and it’s not working. The app is showing “Offline since 4:10 PM Oct 23, 2020”. I think maybe the esp don’t have network. but that’s weird becuse the login and password are correct.
How can I fix this issue? If you need more details just let me know.
Thanks in advance.
My code:
#include <Adafruit_NeoPixel.h>
#include <SPI.h>
#include <BlynkSimpleEsp8266.h>
#include <ESP8266WiFi.h>
#define PIN D7
#define PIN2 D6
#define NUMPIXELS 276
#define NUMPIXELS2 275
#define BLYNK_PRINT Serial
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel pixels2 = Adafruit_NeoPixel(NUMPIXELS2, PIN2, NEO_GRB + NEO_KHZ800);
void setup() {
Serial.begin(9600);
Blynk.begin("Token", "SSID", "Network_Pass");
pixels.begin();
pixels2.begin();
}
BLYNK_WRITE(V1) { //To do
rainbow(10);
}
BLYNK_WRITE(V2) {
int R = param[0].asInt();
int G = param[1].asInt();
int B = param[2].asInt();
Serial.println(R);
Serial.println(G);
Serial.println(B);
for(int i=0;i<NUMPIXELS;i++){
pixels.setPixelColor(i, pixels.Color(R,G,B));
pixels.show();
}
}
BLYNK_WRITE(V3) {
int brightness = param[0].asInt();
Serial.println(brightness);
for(int i=0;i<NUMPIXELS;i++){
pixels.setBrightness(brightness);
pixels.show();
}
}
BLYNK_WRITE(V4) {
int R2 = param[0].asInt();
int G2 = param[1].asInt();
int B2 = param[2].asInt();
Serial.println(R);
Serial.println(G);
Serial.println(B);
for(int i=0;i<NUMPIXELS;i++){
pixels2.setPixelColor(i, pixels2.Color(R2,G2,B2));
pixels2.show();
}
}
BLYNK_WRITE(V5) {
int brightness2 = param[0].asInt();
Serial.println(brightness2);
for(int i=0;i<NUMPIXELS;i++){
pixels2.setBrightness(brightness2);
pixels2.show();
}
}
void rainbow(int wait) {
for(long firstPixelHue = 0; firstPixelHue < 5*65536; firstPixelHue += 256) {
for(int i=0; i<pixels.numPixels(); i++) {
int pixelHue = firstPixelHue + (i * 65536L / pixels.numPixels());
pixels.setPixelColor(i, pixels.gamma32(pixels.ColorHSV(pixelHue)));
}
pixels.show();
delay(wait);
}
}
void loop() {
Blynk.run();
}