ESP32-DevKitC-v1/ESP-WROOM-32

Hi,

sorry, I'm just learning, if I write stupid things, please correct me.

I undertook a LED project on ESP32 with WS2812B LED. I bought 5m and divided the strips into two parts. I connected the power supply, back to ESP32, but I get an error when I want to connect more than 75 LEDs

#include <Adafruit_NeoPixel.h>

#define PinLEDY 33


Adafruit_NeoPixel pixels = Adafruit_NeoPixel(80, PinLEDY, NEO_GRB + NEO_KHZ800);
int NUMPIXELS=100; // ilosc ledow
int count=0;
int redColor = 250;
int greenColor = 0;
int blueColor = 0;
int CzyWlaczony=0;
int j=0;

void setup() {
pixels.begin();
Serial.begin(9600); 
delay(1000);

}

void loop() {
 
int i=0;
  for(i=0;i<NUMPIXELS;i++)
              {
               pixels.setPixelColor(1, pixels.Color(255, 255, 255));
                  delay(10);
                  pixels.show();
                  delay(100);

              }
  delay(100000);
}


void allBlack()
{
  for (uint16_t indexPixel = 0; indexPixel < NUMPIXELS; indexPixel++)
  {
     pixels.setPixelColor(indexPixel, 0x000000);
  }
  pixels.show();
  delay(100);
  delay(1000);
}

Error

Guru Meditation Error: Core 1 panic'ed (Double exception).

Core 1 register dump:
PC : 0x4008ba5a PS : 0x00040436 A0 : 0x80088cab A1 : 0x3ffb0260
A2 : 0x3ffb0300 A3 : 0xb33fffff A4 : 0x0000abab A5 : 0x3f407248
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x40080080 A9 : 0x3ffb0360
A10 : 0x00060636 A11 : 0x00040026 A12 : 0x00000001 A13 : 0x3ffbcb80
A14 : 0x00000003 A15 : 0x00060023 SAR : 0x0000001e EXCCAUSE: 0x00000002
EXCVADDR: 0xffffffe0 LBEG : 0x400849d5 LEND : 0x400849dd LCOUNT : 0x00000027

Backtrace: 0x4008ba57:0x3ffb0260 0x40088ca8:0x3ffb0280 0x4008ba57:0x3ffb02b0 0x4008ba57:0x3ffb02d0 0x4008ba57:0x3ffb02f0 0x4008ba57:0x3ffb0320 0x4008ba57:0x3ffb0340 0x4008ba57:0x3ffb0360 0x4008007d:0x3ffb0260 0x4008b511:0x3ffb0280 0x4008ba57:0x3ffb02b0 0x4008ba57:0x3ffb02d0 0x4008ba57:0x3ffb02f0 0x4008ba57:0x3ffb0320 0x4008ba5

Can someone tell me what I'm doing wrong?

even when I have nothing connected except the USBC communication cable, it throws these errors

Welcome to the forum

Please describe exactly how the LED strip is powered. Are you using an external power supply and if so, what are its voltage and current ratings ?

Those delays are most likely the cause. There is an example sketch called Blink Without Delay. See how it works and adapt your code to work with it.

Also... why 2 delays back to back?

pixels.show();
delay(100);
delay(1000);

This too, you are only setting the first (unless 0 indexed) pixel

pixels.setPixelColor(1, pixels.Color(255, 255, 255));

The LED is powered by OUTPUT 5V - 20A

but as I say, this error appears even when the belt is not connected.

you're right, but I've tried to write so many things in so many ways that the "dealay" was left from the old code, plus addressing only one LED. I wanted to show the simplest example/

At what point in the code does the error occur ?

still getting errors

load:0x3fff0030,len:1288
load:0x40078000,len:13856
load:0x40080400,len:4
ho 8 tail 4 room 4
load:0x40080404,len:3048
entry 0x40080590
Guru Meditation Error: Core 1 panic'ed (Double exception).

Core 1 register dump:
PC : 0x4008ba5a PS : 0x00040436 A0 : 0x80088cab A1 : 0x3ffb0260
A2 : 0x3ffb0300 A3 : 0xb33fffff A4 : 0x0000abab A5 : 0x3f407240
A6 : 0xb33fffff A7 : 0xb33fffff A8 : 0x40080080 A9 : 0x3ffb0360
A10 : 0x00060636 A11 : 0x00040026 A12 : 0x00000001 A13 : 0x00060223
A14 : 0xb33fffff A15 : 0xb33fffff SAR : 0x0000000a EXCCAUSE: 0x00000002
EXCVADDR: 0xffffffe0 LBEG : 0x400849d5 LEND : 0x400849dd LCOUNT : 0x00000027

#include <Adafruit_NeoPixel.h>

#define PinLEDY 33


Adafruit_NeoPixel pixels = Adafruit_NeoPixel(75, PinLEDY, NEO_GRB + NEO_KHZ800);
int NUMPIXELS=100; // ilosc ledow
int count=0;
int redColor = 250;
int greenColor = 0;
int blueColor = 0;
int CzyWlaczony=0;
int j=0;
unsigned long preMillis =0;


void setup() {
pixels.begin();
Serial.begin(115200); 

}

void loop() {
 
 unsigned long ms = millis();
int i=0;
  for(i=0;i<NUMPIXELS;i++)
              {
               pixels.setPixelColor(i, pixels.Color(255, 255, 255));
                  pixels.show();
                  if((ms-preMillis)>=1000)
                  {
                    preMillis=ms;
                  }

              }
}


void allBlack()
{
  for (uint16_t indexPixel = 0; indexPixel < NUMPIXELS; indexPixel++)
  {
     pixels.setPixelColor(indexPixel, 0x000000);
  }
  pixels.show();
}

It's hard to say for sure when I will change the number of LEDs from below 75 to, for example, 76 and higher


Program with error ;(

This isn't doing anything useful. your pixel code should be inside this. Then again, you are inside a for loop when you should be in a while loop, manually advancing the index.

I should also point out this is only setting the pixels to be white forever but I sure there is more code to be added later to change that.

:man_facepalming:

You are trying to access 25 LEDs that don't exist.

but this is not the reason ;( as you can see, I am trying to run even one LED without specifying the parameter in pixels.setPixelColor.

Even when I correct the code to make it logical, I get the same errors. There is clearly an error with the first argument in

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PinLEDY, NEO_GRB + NEO_KHZ800);

#include <Adafruit_NeoPixel.h>
#define PinLEDY 33
#define NUMPIXELS 80


Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PinLEDY, NEO_GRB + NEO_KHZ800);


void setup() {
pixels.begin();
Serial.begin(115200); 
}

void loop() {

               pixels.setPixelColor(1, pixels.Color(255, 255, 255));
                  pixels.show();
        
}

That's not clear to me.
You code runs fine (even the buggy code that accessed beyond the end of the NeoPixel array) on an ESP32 Dev Board. There were no actual NeoPixels connected, but that's irrelevant. I did change to Pin 4 for the LEDs.

Even bumped the number of Pixels up to 200.
Using Arduino IDE v1.8.19. ESP32 Core 3.0.4, NeoPixel Library v1.11.0.

#include <Adafruit_NeoPixel.h>

#define PinLEDY 4


Adafruit_NeoPixel pixels = Adafruit_NeoPixel(200, PinLEDY, NEO_GRB + NEO_KHZ800);
int NUMPIXELS = 200; // ilosc ledow
int count = 0;
int redColor = 250;
int greenColor = 0;
int blueColor = 0;
int CzyWlaczony = 0;
int j = 0;

void setup() {
  pixels.begin();
  Serial.begin(115200);
  delay(1000);

}

void loop() {

  int i = 0;
  for (i = 0; i < NUMPIXELS; i++)              {
    pixels.setPixelColor(1, pixels.Color(255, 255, 255));
    delay(10);
    pixels.show();
    delay(100);
    Serial.println(i);
  }
  delay(100000);
}


void allBlack() {
  for (uint16_t indexPixel = 0; indexPixel < NUMPIXELS; indexPixel++)  {
    pixels.setPixelColor(indexPixel, 0x000000);
  }
  pixels.show();
  delay(100);
  delay(1000);
}

I got it to crash instantly using Arduino IDE 2.3.2 and Adafruit_NeoPixel 1.12.2 on a ESP32-WROOM-32D.

Maybe the older IDE and library version are more stable?

what could I be doing wrong? :frowning:

Try the same versions gfvalvo is using. See if it still crashes.

Damn, I didn't think about that, I even downgraded Bootloader and else. I will check Arduino version

Perhaps more important is the ESP32 core and library versions.

Same ;/

I downloaded NeoPixel Library v1.11.0 and it started working. Thank you very much guys for your help! I couldn't have done it without you and I still wasted 3 evenings...

Thanks!!!