Esp32now c3 super mini code help please

hey guys, im trying to get these boards to communicate with each other but im getting no where with it.

the project is split into 2 parts, a master board and a slave board. (which when i eventually get them talking to each other i need to expand to 2 master boards that sync the led on/off state together and expand the slave boards to 6)

anyway, here is the master code

#include <esp_now.h>
#include <WiFi.h>
#include <esp_wifi.h>

#define BUTTON_PIN 4

uint8_t slaveMAC[] = {0xB8, 0x50, 0xD8, 0x84, 0x44, 0xFC};

bool ledsOn = false;
bool lastButtonState = HIGH;
bool buttonHandled = false;
uint32_t lastDebounce = 0;
const uint16_t DEBOUNCE_MS = 50;

esp_now_peer_info_t peerInfo;

void onSent(const wifi_tx_info_t *info, esp_now_send_status_t status) {
  Serial.println(status == ESP_NOW_SEND_SUCCESS ? "ACK received" : "ACK not received");
}

void setup() {
  Serial.begin(115200);
  delay(1000);
  pinMode(BUTTON_PIN, INPUT_PULLUP);

  WiFi.mode(WIFI_STA);
  WiFi.disconnect();

  Serial.print("Master MAC: ");
  Serial.println(WiFi.macAddress());

  if (esp_now_init() != ESP_OK) {
    Serial.println("ESP-NOW init failed");
    while (1);
  }
  esp_wifi_set_channel(1, WIFI_SECOND_CHAN_NONE);

  esp_now_register_send_cb(onSent);

  memcpy(peerInfo.peer_addr, slaveMAC, 6);
  peerInfo.channel = 1;
  peerInfo.encrypt = false;
  esp_now_add_peer(&peerInfo);
}

void loop() {
  bool reading = digitalRead(BUTTON_PIN);

  if (reading != lastButtonState) {
    lastDebounce = millis();
    buttonHandled = false;
  }

  if (!buttonHandled && (millis() - lastDebounce) > DEBOUNCE_MS && reading == LOW) {
    ledsOn = !ledsOn;
    uint8_t msg = ledsOn ? 1 : 0;
    Serial.print("Sending: LEDs ");
    Serial.println(ledsOn ? "ON" : "OFF");
    esp_now_send(slaveMAC, &msg, sizeof(msg));
    buttonHandled = true;
  }

  lastButtonState = reading;
}```

here is the slave code

#include <esp_now.h>

#include <WiFi.h>

#include <esp_wifi.h>

#include <FastLED.h>



#define STRIP1_PIN  3

#define STRIP2_PIN  4

#define NUM_LEDS    4



CRGB strip1\[NUM_LEDS\];

CRGB strip2\[NUM_LEDS\];



bool ledsOn = false;

uint8_t bright1 = 128, bright2 = 128;

uint32_t lastChange1 = 0, lastChange2 = 0;

uint16_t interval1 = 100, interval2 = 100;



void onReceive(const esp_now_recv_info_t \*info, const uint8_t \*data, int len) {

  Serial.printf("Packet received! len=%d data\[0\]=%d\\n", len, data\[0\]);

  if (len < 1) return;

  ledsOn = (data\[0\] == 1);

  if (!ledsOn) {

    fill_solid(strip1, NUM_LEDS, CRGB::Black);

    fill_solid(strip2, NUM_LEDS, CRGB::Black);

    FastLED.show();

  }

}



void setup() {

  Serial.begin(115200);

  delay(1000);



  FastLED.addLeds<WS2812B, STRIP1_PIN, GRB>(strip1, NUM_LEDS);

  FastLED.addLeds<WS2812B, STRIP2_PIN, GRB>(strip2, NUM_LEDS);

  FastLED.setBrightness(255);



  WiFi.mode(WIFI_STA);

  WiFi.disconnect();



  Serial.println("======================");

  Serial.print("Slave MAC Address: ");

  Serial.println(WiFi.macAddress());

  Serial.println("Copy the above MAC into master slaveMAC\[\]");

  Serial.println("======================");



  if (esp_now_init() != ESP_OK) {

    Serial.println("ESP-NOW init failed");

    while (1);

  }

  esp_wifi_set_channel(1, WIFI_SECOND_CHAN_NONE);



  esp_now_register_recv_cb(onReceive);

}



void loop() {

  if (!ledsOn) return;



  uint32_t now = millis();



  if (now - lastChange1 >= interval1) {

    bright1 = random8(40, 255);

    interval1 = random(50, 151);

    lastChange1 = now;

    fill_solid(strip1, NUM_LEDS, CRGB::Red);

    for (auto& led : strip1) led.nscale8(bright1);

  }



  if (now - lastChange2 >= interval2) {

    bright2 = random8(40, 255);

    interval2 = random(50, 151);

    lastChange2 = now;

    fill_solid(strip2, NUM_LEDS, CRGB(255, 165, 0));

    for (auto& led : strip2) led.nscale8(bright2);

  }



  FastLED.show();

}

now, when i connect both boards to individual ides i get these responces from them

master:

Master MAC: B8:50:D8:6C:39:87

slave

Slave MAC Address: B8:50:D8:84:44:FC

Copy the above MAC into master slaveMAC[]
======================

when i press the button, i get no responce on the slave chip and this returned on the master chip

Sending: LEDs ON
ACK not received

as best i can tell, (because the leds arent lighting up) the slave isnt receiving the "on" command. but i dont know why.

the mac address matches.

im using esp32family device ozobotDRVKIT boards, i have the ides set to esp32c3dev module.

not sure what other information i can provide to help but im going in circles, the arduino ai is running around in circles as well like a dog chasing its tail, it obviously has no idea whats broken.

i need help with this so badly

This line of code in the receiver sketch looks very odd

hi UKHeliBob, been a while for sure. hope your keeping well.

honestly that was a part of the code the arduino AI generated and not entirely sure how to go about resolving that one.

that said, would it affect the fact there is no communication between the boards anyway?

im holding off making any changes to my code pending help on here so we're all working on the same base codes. i will also edit the primary post to reflect any changes, or i can just post the new sets in replies. what ever makes it easier.

thank you for once again stepping in with your help :smiley:

edit, its a corrupted line, yeek, i will fix that bit i have also noticed more corruptions, such as the CRGB strip1 and strip 2 lines. i need to review each line.

The receiver code as posted does not compile. Please post it when you have got rid of the corruption. It is riddled with nonsense like this

CRGB strip1\[NUM_LEDS\];

CRGB strip2\[NUM_LEDS\];

will do, im working on it now. i already took care of those two lines and reviewing every single line carfully now.

sorry about that.

updated code, compiled and flashed.

master

#include <esp_now.h>
#include <WiFi.h>
#include <esp_wifi.h>

#define BUTTON_PIN 4

uint8_t slaveMAC[] = {0xB8, 0x50, 0xD8, 0x84, 0x44, 0xFC};

bool ledsOn = false;
bool lastButtonState = HIGH;
bool buttonHandled = false;
uint32_t lastDebounce = 0;
const uint16_t DEBOUNCE_MS = 50;

esp_now_peer_info_t peerInfo;

void onSent(const wifi_tx_info_t *info, esp_now_send_status_t status) {
  Serial.println(status == ESP_NOW_SEND_SUCCESS ? "ACK received" : "ACK not received");
}

void setup() {
  Serial.begin(115200);
  delay(1000);
  pinMode(BUTTON_PIN, INPUT_PULLUP);

  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  WiFi.setTxPower(WIFI_POWER_8_5dBm); 

  Serial.print("Master MAC: ");
  Serial.println(WiFi.macAddress());

  if (esp_now_init() != ESP_OK) {
    Serial.println("ESP-NOW init failed");
    while (1);
  }
  esp_wifi_set_channel(1, WIFI_SECOND_CHAN_NONE);

  esp_now_register_send_cb(onSent);

  memcpy(peerInfo.peer_addr, slaveMAC, 6);
  peerInfo.channel = 1;
  peerInfo.encrypt = false;
  esp_now_add_peer(&peerInfo);
}

void loop() {
  bool reading = digitalRead(BUTTON_PIN);

  if (reading != lastButtonState) {
    lastDebounce = millis();
    buttonHandled = false;
  }

  if (!buttonHandled && (millis() - lastDebounce) > DEBOUNCE_MS && reading == LOW) {
    ledsOn = !ledsOn;
    uint8_t msg = ledsOn ? 1 : 0;
    Serial.print("Sending: LEDs ");
    Serial.println(ledsOn ? "ON" : "OFF");
    esp_now_send(slaveMAC, &msg, sizeof(msg));
    buttonHandled = true;
  }

  lastButtonState = reading;
}

slave

#include <esp_now.h>
#include <WiFi.h>
#include <esp_wifi.h>
#include <FastLED.h>

#define STRIP1_PIN 3
#define STRIP2_PIN 4
#define NUM_LEDS 4



CRGB strip1[NUM_LEDS];
CRGB strip2[NUM_LEDS];

bool ledsOn = false;
uint8_t bright1 = 128, bright2 = 128;
uint32_t lastChange1 = 0, lastChange2 = 0;
uint16_t interval1 = 100, interval2 = 100;

void onReceive(const esp_now_recv_info_t * info, const uint8_t * data, int len) {
  Serial.printf("Packet received! len=%d data[0]=%d\n", len, data[0]);
  if (len < 1) return;
  ledsOn = (data[0] == 1);
  if (!ledsOn) {
    fill_solid(strip1, NUM_LEDS, CRGB::Black);
    fill_solid(strip2, NUM_LEDS, CRGB::Black);
    FastLED.show();
  }
}



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

  FastLED.addLeds<WS2812B, STRIP1_PIN, GRB>(strip1, NUM_LEDS);
  FastLED.addLeds<WS2812B, STRIP2_PIN, GRB>(strip2, NUM_LEDS);
  FastLED.setBrightness(255);

  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  WiFi.setTxPower(WIFI_POWER_8_5dBm); 

  Serial.println("======================");
  Serial.print("Slave MAC Address: ");
  Serial.println(WiFi.macAddress());
  Serial.println("======================");

  if (esp_now_init() != ESP_OK) {
    Serial.println("ESP-NOW init failed");
    while (1)
      ;
  }

  esp_wifi_set_channel(1, WIFI_SECOND_CHAN_NONE);
  esp_now_register_recv_cb(onReceive);
}

void loop() {
  if (!ledsOn) return;
  uint32_t now = millis();

  if (now - lastChange1 >= interval1) {
    bright1 = random8(40, 255);
    interval1 = random(50, 151);
    lastChange1 = now;
    fill_solid(strip1, NUM_LEDS, CRGB::Red);
    for (auto& led : strip1) led.nscale8(bright1);
  }

  if (now - lastChange2 >= interval2) {
    bright2 = random8(40, 255);
    interval2 = random(50, 151);
    lastChange2 = now;
    fill_solid(strip2, NUM_LEDS, CRGB(255, 165, 0));
    for (auto& led : strip2) led.nscale8(bright2);
  }

  FastLED.show();
}

now, i get ack recveived. on the master, however the slave generates a whole lot of stuff i dont understand

Packet received! len=1 data[0]=0
E (192008) rmt: rmt_tx_register_to_group(152): no free tx channels
E (192008) rmt: rmt_new_tx_channel(286): register channel failed
E (192009) led_strip_rmt: led_strip_new_rmt_device(204): create RMT TX channel failed
ESP_ERROR_CHECK failed: esp_err_t 0x105 (ESP_ERR_NOT_FOUND) at 0x42005190
file: "c:\Users\ryder\Documents\Arduino\libraries\FastLED\src\platforms\esp\32\rmt_5\strip_rmt.cpp" line 70
func: led_strip_t* fl::{anonymous}::configure_led_with_timings(int, uint32_t, bool, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, bool, uint8_t, uint8_t*)
expression: led_strip_new_rmt_device(&strip_config, &rmt_config, &led_strip)

abort() was called at PC 0x403868ed on core 0
Core  0 register dump:
MEPC    : 0x40386932  RA      : 0x403868f6  SP      : 0x3fca7820  GP      : 0x3fc90600  
TP      : 0x3fca7d90  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130  
S0/FP   : 0x3fca784c  S1      : 0x3fca784c  A0      : 0x3fca7858  A1      : 0x3fca783a  
A2      : 0x00000000  A3      : 0x3fca7885  A4      : 0x00000001  A5      : 0x3fc99000  
A6      : 0x7a797877  A7      : 0x76757473  S2      : 0x00000000  S3      : 0x00000004
S4      : 0x00000118  S5      : 0x00000177  S6      : 0x000003e8  S7      : 0x0000036b  
S8      : 0x000000fa  S9      : 0x00000004  S10     : 0x3fca9e84  S11     : 0x00000018  
T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938  
MSTATUS : 0x00001881  MTVEC   : 0x40380001  MCAUSE  : 0x00000002  MTVAL   : 0x00000000  
MHARTID : 0x00000000  

***then a bunch of stack memory batches then***

Rebooting...
ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40386a46
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x110c
load:0x403cbf10,len:0xb54
load:0x403ce710,len:0x2f9c
entry 0x403cbf10
======================
Slave MAC Address: B8:50:D8:84:44:FC

i understand the word crashed and packet received lol. so at least they're talking to each other......sort off.

okay i got stuff in the wrong place. i need to restructure this i think.

The data is being received but I am suspicious of where it is being stored in memory. Delete the following lines in the onReceive() function

    if (len < 1) return;
    ledsOn = (data[0] == 1);
    if (!ledsOn)
    {
        fill_solid(strip1, NUM_LEDS, CRGB::Black);
        fill_solid(strip2, NUM_LEDS, CRGB::Black);
        FastLED.show();
    }

The LEDs will not turn on/off, but does the sketch still crash when data is received ?

im just trying out a restructured sketch (in a seperate ide window to preserve this context) once thats uploaded and tried i will do as you suggest and see what happens, but thats the set of data i've removed/relocated as i think thats what was causing the crash. i will post back in 10 with the results

Slave MAC Address: B8:50:D8:84:44:FC

======================

Packet received! len=1 data[0]=0

no crash at all. so that block of code is causing the issues......man i wish i knew what i was doing lol

if i moved the entire onReceive() function including the lines that had been deleted into the setup, would that relocate its storage in memory and possibly allow it to function?

Try this?

#include <esp_now.h>
#include <WiFi.h>
#include <esp_wifi.h>
#include <FastLED.h>

#define STRIP1_PIN 3
#define STRIP2_PIN 4
#define NUM_LEDS 4

CRGB strip1[NUM_LEDS];
CRGB strip2[NUM_LEDS];

bool ledsOn = false;
bool ledsOnPrev = false;
uint8_t bright1 = 128, bright2 = 128;
uint32_t lastChange1 = 0, lastChange2 = 0;
uint16_t interval1 = 100, interval2 = 100;

void onReceive(const esp_now_recv_info_t * info, const uint8_t * data, int len) {
  Serial.printf("Packet received! len=%d data[0]=%d\n", len, data[0]);
  if (len < 1) return;
  ledsOnPrev = ledsOn;
  ledsOn = (data[0] == 1);
}

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

  FastLED.addLeds<WS2812B, STRIP1_PIN, GRB>(strip1, NUM_LEDS);
  FastLED.addLeds<WS2812B, STRIP2_PIN, GRB>(strip2, NUM_LEDS);
  FastLED.setBrightness(255);

  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  WiFi.setTxPower(WIFI_POWER_8_5dBm); 

  Serial.println("======================");
  Serial.print("Slave MAC Address: ");
  Serial.println(WiFi.macAddress());
  Serial.println("======================");

  if (esp_now_init() != ESP_OK) {
    Serial.println("ESP-NOW init failed");
    while (1)
      ;
  }

  esp_wifi_set_channel(1, WIFI_SECOND_CHAN_NONE);
  esp_now_register_recv_cb(onReceive);
}

void loop() {
  if (!ledsOn) {
    if (ledsOnPrev) {
      fill_solid(strip1, NUM_LEDS, CRGB::Black);
      fill_solid(strip2, NUM_LEDS, CRGB::Black);
      FastLED.show();
    }
  }
  else {

    uint32_t now = millis();

    if (now - lastChange1 >= interval1) {
      bright1 = random8(40, 255);
      interval1 = random(50, 151);
      lastChange1 = now;
      fill_solid(strip1, NUM_LEDS, CRGB::Red);
      for (auto& led : strip1) led.nscale8(bright1);
      FastLED.show();
    }

    if (now - lastChange2 >= interval2) {
      bright2 = random8(40, 255);
      interval2 = random(50, 151);
      lastChange2 = now;
      fill_solid(strip2, NUM_LEDS, CRGB(255, 165, 0));
      for (auto& led : strip2) led.nscale8(bright2);
      FastLED.show();
    }
  }
}

My theory is that FastLED.show() is getting called continuously, not just when the LEDs need updating. This may disable interrupts and somehow prevent ESPnow from working normally, especially given that the C3 only has one CPU core.

i will give it a go now and let you know

Packet received! len=1 data[0]=1
E (25023) rmt: rmt_tx_register_to_group(152): no free tx channels
E (25024) rmt: rmt_new_tx_channel(286): register channel failed
E (25024) led_strip_rmt: led_strip_new_rmt_device(204): create RMT TX channel failed
ESP_ERROR_CHECK failed: esp_err_t 0x105 (ESP_ERR_NOT_FOUND) at 0x4200514c
file: "c:\Users\ryder\Documents\Arduino\libraries\FastLED\src\platforms\esp\32\rmt_5\strip_rmt.cpp" line 70
func: led_strip_t* fl::{anonymous}::configure_led_with_timings(int, uint32_t, bool, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, bool, uint8_t, uint8_t*)
expression: led_strip_new_rmt_device(&strip_config, &rmt_config, &led_strip)

abort() was called at PC 0x403868ed on core 0
Core  0 register dump:

(blocks ommited i can post them if needed)

Stack memory:
(blocks ommited i can post them if needed)

ELF file SHA256: 9680f46ec

Rebooting...

ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40386a46
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x110c
load:0x403cbf10,len:0xb54
load:0x403ce710,len:0x2f9c
entry 0x403cbf10
======================
Slave MAC Address: B8:50:D8:84:44:FC
======================

that was following your suggestion. i have now reverted back to this code just to keep things at a baseline.

#include <esp_now.h>
#include <WiFi.h>
#include <esp_wifi.h>
#include <FastLED.h>

#define STRIP1_PIN 3
#define STRIP2_PIN 4
#define NUM_LEDS 4



CRGB strip1[NUM_LEDS];
CRGB strip2[NUM_LEDS];

bool ledsOn = false;
uint8_t bright1 = 128, bright2 = 128;
uint32_t lastChange1 = 0, lastChange2 = 0;
uint16_t interval1 = 100, interval2 = 100;

void onReceive(const esp_now_recv_info_t * info, const uint8_t * data, int len) {
  Serial.printf("Packet received! len=%d data[0]=%d\n", len, data[0]);
//  if (len < 1) return;
//  ledsOn = (data[0] == 1);
//  if (!ledsOn) {
//    fill_solid(strip1, NUM_LEDS, CRGB::Black);
//    fill_solid(strip2, NUM_LEDS, CRGB::Black);
//    FastLED.show();
//  }

}


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

  FastLED.addLeds<WS2812B, STRIP1_PIN, GRB>(strip1, NUM_LEDS);
  FastLED.addLeds<WS2812B, STRIP2_PIN, GRB>(strip2, NUM_LEDS);
  FastLED.setBrightness(255);

  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  WiFi.setTxPower(WIFI_POWER_8_5dBm); 

  Serial.println("======================");
  Serial.print("Slave MAC Address: ");
  Serial.println(WiFi.macAddress());
  Serial.println("======================");

  if (esp_now_init() != ESP_OK) {
    Serial.println("ESP-NOW init failed");
    while (1)
      ;
  }

  esp_wifi_set_channel(1, WIFI_SECOND_CHAN_NONE);
  esp_now_register_recv_cb(onReceive);
}

void loop() {
  if (!ledsOn) return;
  uint32_t now = millis();

  if (now - lastChange1 >= interval1) {
    bright1 = random8(40, 255);
    interval1 = random(50, 151);
    lastChange1 = now;
    fill_solid(strip1, NUM_LEDS, CRGB::Red);
    for (auto& led : strip1) led.nscale8(bright1);
  }

  if (now - lastChange2 >= interval2) {
    bright2 = random8(40, 255);
    interval2 = random(50, 151);
    lastChange2 = now;
    fill_solid(strip2, NUM_LEDS, CRGB(255, 165, 0));
    for (auto& led : strip2) led.nscale8(bright2);
  }

  FastLED.show();
}

Hmmm...

Try my code again with each call to FastLED.show() commented out.

okay so thats all 3 instances of FastLED.show() commented out in the loop,

packet received! len-1 data[0]=0

so, to me, it appears its the lastled being called into function thats breaking the code?

edit: it just occured to me my manners have failed, thank you for also stepping in to help with this, i been at it for days already and finally had to resort to coming in to ask for help :frowning:

Try this too !

void onReceive(const esp_now_recv_info_t* info, const uint8_t* data, int len)
{
    Serial.printf("Packet received! len=%d data = %d\n", len, data);
    if (len < 1) return;
    if (!data)
    {
        fill_solid(strip1, NUM_LEDS, CRGB::Black);
        fill_solid(strip2, NUM_LEDS, CRGB::Black);
        FastLED.show();
    }
}

hello again, is that using the latest code posted above where i commented out the 3 lines in loop or the original where you had me delete a section?

The original receiver code with a replacement onReceive() function

copy that, will run the change and upload now.

#include <esp_now.h>
#include <WiFi.h>
#include <esp_wifi.h>
#include <FastLED.h>

#define STRIP1_PIN 3
#define STRIP2_PIN 4
#define NUM_LEDS 4



CRGB strip1[NUM_LEDS];
CRGB strip2[NUM_LEDS];

bool ledsOn = false;
uint8_t bright1 = 128, bright2 = 128;
uint32_t lastChange1 = 0, lastChange2 = 0;
uint16_t interval1 = 100, interval2 = 100;

void onReceive(const esp_now_recv_info_t* info, const uint8_t* data, int len)
{
    Serial.printf("Packet received! len=%d data = %d\n", len, data);
    if (len < 1) return;
    if (!data)
    {
        fill_solid(strip1, NUM_LEDS, CRGB::Black);
        fill_solid(strip2, NUM_LEDS, CRGB::Black);
        FastLED.show();
    }
}



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

  FastLED.addLeds<WS2812B, STRIP1_PIN, GRB>(strip1, NUM_LEDS);
  FastLED.addLeds<WS2812B, STRIP2_PIN, GRB>(strip2, NUM_LEDS);
  FastLED.setBrightness(255);

  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  WiFi.setTxPower(WIFI_POWER_8_5dBm); 

  Serial.println("======================");
  Serial.print("Slave MAC Address: ");
  Serial.println(WiFi.macAddress());
  Serial.println("======================");

  if (esp_now_init() != ESP_OK) {
    Serial.println("ESP-NOW init failed");
    while (1)
      ;
  }

  esp_wifi_set_channel(1, WIFI_SECOND_CHAN_NONE);
  esp_now_register_recv_cb(onReceive);
}

void loop() {
  if (!ledsOn) return;
  uint32_t now = millis();

  if (now - lastChange1 >= interval1) {
    bright1 = random8(40, 255);
    interval1 = random(50, 151);
    lastChange1 = now;
    fill_solid(strip1, NUM_LEDS, CRGB::Red);
    for (auto& led : strip1) led.nscale8(bright1);
  }

  if (now - lastChange2 >= interval2) {
    bright2 = random8(40, 255);
    interval2 = random(50, 151);
    lastChange2 = now;
    fill_solid(strip2, NUM_LEDS, CRGB(255, 165, 0));
    for (auto& led : strip2) led.nscale8(bright2);
  }

  FastLED.show();
}
======================
Slave MAC Address: B8:50:D8:84:44:FC
======================
Packet received! len=1 data = 1070188992
Packet received! len=1 data = 1070188992

however, the leds did not actually turn on or off (wiring has been confirmed to be correct, i threw a basic code on to light them up in different colors to ensure the hardware was wired right)

ok so fast led was a problem, i screwed around and done this

#include <esp_now.h>
#include <WiFi.h>
#include <esp_wifi.h>
#include <Adafruit_NeoPixel.h>

#define STRIP1_PIN 0
#define STRIP2_PIN 1
#define NUM_LEDS 4

// Initialize the safe Adafruit NeoPixel strips
Adafruit_NeoPixel strip1(NUM_LEDS, STRIP1_PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip2(NUM_LEDS, STRIP2_PIN, NEO_GRB + NEO_KHZ800);

bool ledsOn = false;
bool forceBlackout = false; 
bool printDiagnostics = false; 
int receivedLen = 0;
uint8_t receivedVal = 0;

uint8_t bright1 = 128, bright2 = 128;
uint32_t lastChange1 = 0, lastChange2 = 0;
uint16_t interval1 = 100, interval2 = 100;

void onReceive(const esp_now_recv_info_t* info, const uint8_t* data, int len)
{
    if (len < 1) return;

    receivedLen = len;
    receivedVal = *data;
    ledsOn = (receivedVal == 1);
    printDiagnostics = true; 

    if (!ledsOn) 
    {
        forceBlackout = true; 
    }
}

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

  // Start the pixel strips
  strip1.begin();
  strip2.begin();
  strip1.show(); 
  strip2.show();

  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  WiFi.setTxPower(WIFI_POWER_8_5dBm); 

  Serial.println("======================");
  Serial.print("Slave MAC Address: ");
  Serial.println(WiFi.macAddress());
  Serial.println("======================");

  if (esp_now_init() != ESP_OK) {
    Serial.println("ESP-NOW init failed");
    while (1);
  }

  esp_wifi_set_channel(1, WIFI_SECOND_CHAN_NONE);
  esp_now_register_recv_cb(onReceive);
}

void loop() {
  if (printDiagnostics) {
    Serial.printf("Packet received! len=%d data = %d\n", receivedLen, receivedVal);
    if (!ledsOn) Serial.println("LEDs flagged OFF");
    else Serial.println("LEDs flagged ON (Flicker animation running)");
    printDiagnostics = false; 
  }

  if (forceBlackout) {
    // Clear strips using NeoPixel commands
    for(int i=0; i<NUM_LEDS; i++) {
      strip1.setPixelColor(i, 0, 0, 0);
      strip2.setPixelColor(i, 0, 0, 0);
    }
    strip1.show();
    strip2.show();
    forceBlackout = false; 
  }

  if (!ledsOn) return;
  uint32_t now = millis();

  if (now - lastChange1 >= interval1) {
    bright1 = random(40, 255);
    interval1 = random(50, 151);
    lastChange1 = now;
    
    // Scale Red color based on random brightness
    uint8_t r = (bright1 * 255) / 255; 
    for(int i=0; i<NUM_LEDS; i++) strip1.setPixelColor(i, strip1.Color(r, 0, 0));
    strip1.show();
  }

  if (now - lastChange2 >= interval2) {
    bright2 = random(40, 255);
    interval2 = random(50, 151);
    lastChange2 = now;
    
    // Scale Orange color (255, 165, 0) based on random brightness
    uint8_t r = (bright2 * 255) / 255;
    uint8_t g = (bright2 * 165) / 255;
    for(int i=0; i<NUM_LEDS; i++) strip2.setPixelColor(i, strip2.Color(r, g, 0));
    strip2.show();
  }
}

and it came to life

Assuming you meant to say fastled...

Yes, it does seem like that.

I seem to remember there is a library for ws2812 led strips that's designed to work specifically with ESP chips. I think it might use hardware acceleration to send data to the strip, freeing up the CPU somewhat. Might be worth looking into.

I have never used ESPnow. But I have encountered difficulties with Fastled on ESP8266 boards on my own projects. Switching to Adafruit Neopixel library fixed them, so may be worth you trying that also.