MAC Detector With Neopixel

Hello all,

i would like o make a mac adress detector with neopixels(ws2812b etc)
i tried to combine two different codes but i failed, can anyone help me?

My goal is when i came to home, half of the neopixel strip will be on or animate, and when my wife came other half will do same or different animation.

im using nodemcu board for this.
my code is:

      /* 
  Friend Detector by Ricardo Oliveira, forked by Skickar 9/30/2018
  
  A Node MCU microcontroller + mini bread board + 4 pin RGB LED to detect when devices belonging to a target are nearby.
  
  
  The function of this code is to read nearby Wi-Fi traffic in the form of packets. These packets are compared
  to a list of MAC addresses we wish to track, and if the MAC address of a packet matches one on the list, we turn 
  on a colored LED that is linked to the user owning the device. For example, when my roommate comes home, the 
  transmissions from his phone will be detected and cause the blue LED to turn on until his phone is no longer detected. 
  It can detect more than one phone at a time, meaning if my phone (red) and my roommate's phone (blue) are both home, 
  the LED will show purple. */
  #include "Adafruit_NeoPixel.h"
  #include "./esppl_functions.h"
  #ifdef __AVR__
    #include <avr/power.h>
  #endif
  #define PIN            D6
  #define NUMPIXELS      16
  Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
  /*  Define you friend's list size here
   How many MAC addresses are you tracking?
   */
  #define LIST_SIZE 2
  /*
   * This is your friend's MAC address list
   Format it by taking the mac address aa:bb:cc:dd:ee:ff 
   and converting it to 0xaa,0xbb,0xcc,0xdd,0xee,0xff
   */
  uint8_t friendmac[LIST_SIZE][ESPPL_MAC_LEN] = {
     {0x12, 0x34, 0x56, 0x78, 0x90, 0x12}
    ,{0x98, 0x76, 0x54, 0x32, 0x10, 0x98}
    };
  /*
   * This is your friend's name list
   * put them in the same order as the MAC addresses
   */
  String friendname[LIST_SIZE] = {
     "Target 1"
    ,"Target 2"
    };
  
  // start variables package - Skickar 2018 hardware LED for NodeMCU on mini breadboard //
  void setup() { 
   #if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
    clock_prescale_set(clock_div_1);
  #endif
    // END of Trinket-specific code.
  
    pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
  
    Serial.begin(115200);
    esppl_init(cb);
  }
  
  /* You cannot use a time delay here to keep the LED on, so will need to use ratio of 
  detected packets to overall packets to keep LED on for longer. If you try to use a 
  delay to keep the light on for long enough to be useful, the watchdog timer kills the 
  process and it dies */
  int cooldown = 0; /* This variable will be a cooldown timer to keep the LED on for longer, we'll set it to 1000 if we
  detect a packet from a device with a MAC address on the list, and then keep the LED on till we get 1000 packets that 
  are NOT from any device on the list. */
  
     
  
  /* end exparimental variable package */
  
  bool maccmp(uint8_t *mac1, uint8_t *mac2) {
    for (int i=0; i < ESPPL_MAC_LEN; i++) {
      if (mac1[i] != mac2[i]) {
        return false;
      }
    }
    return true;
  }
  
  void cb(esppl_frame_info *info) {
    for (int i=0; i<LIST_SIZE; i++) {
      if (maccmp(info->sourceaddr, friendmac[i]) || maccmp(info->receiveraddr, friendmac[i])) {
        Serial.printf("\n%s is here! :)", friendname[i].c_str());
        cooldown = 1000; // here we set it to 1000 if we detect a packet that matches our list
        
        if (i == 1){
          {
  for(int i=0;i<8;i++){ //The first half of the strip
    pixels.setPixelColor(i, pixels.Color(255,0,0)); //Set the LEDs red (Assume RGB and not GRB)
    }
          }
        }
      
          
          else {
           for(int k=8;k<16;k++){ //The second half of the strip
    pixels.setPixelColor(k, pixels.Color(0,0,255)); //Set the LEDs blue (Assume RGB and not GRB)
    
    }
    }
      }
        else { // this is for if the packet does not match any we are tracking
          if (cooldown > 0) {
            cooldown--; } //subtract one from the cooldown timer if the value of "cooldown" is more than one
            else { // If the timer is at zero, then run the turnoff function to turn off any LED's that are on.
          
          pixels.clear(); } } } }
  
  
  void loop() { // I didn't write this part but it sure looks fancy.
    esppl_sniffing_start();
    while (true) {
      for (int i = ESPPL_CHANNEL_MIN; i <= ESPPL_CHANNEL_MAX; i++ ) {
        esppl_set_channel(i);
        while (esppl_process_frames()) {
          //
        }
      }
    }  
  pixels.show(); 
  }

Welcome to the Forum. Please read these two posts:

General Guidance and How to use the Forum
and
Read this before posting a programming question ...
You may also find useful information that would answer your question here:
Useful links - check here for reference posts / tutorials

It is important to provide as much of the information that is needed to solve your problem as you can, in your first posts. The forum link above has guidelines for posting in a standard way that makes it easiest for people to provide you with useful answers. Making an effort to do this will greatly increase the number and quality of helpful responses that you get.

In this case, the problem is that you have posted code without using code tags. The code tags make the code look

like this

when posting source code files. It makes it easier to read, and can be copied with a single mouse click. Also, if you don't do it, some of the character sequences in the code can be misinterpred by the forum code as italics or funny emoticons. The "Code: [Select]" feature allows someone to select the entire sketch so it can be easily copied and pasted into the IDE for testing or review.

If you have already posted without using code tags, open your message and select "modify" from the pull down menu labelled, "More", at the lower right corner of the message. Highlight your code by selecting it (it turns blue), and then click on the "</>" icon at the upper left hand corner. Click on the "Save" button. Code tags can also be inserted manually in the forum text using the code and /code metatags.

I made some changes and it worked but when my phone's wifi is off it detects Mac adress and leds are on. When i open or close my wifi it can't detect immediately and leds are stucks.

#include "Adafruit_NeoPixel.h"
#include "./esppl_functions.h"
#ifdef __AVR__
  #include <avr/power.h>
#endif
#define PIN            D6
#define NUMPIXELS      16
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

#define LIST_SIZE 2

uint8_t friendmac[LIST_SIZE][ESPPL_MAC_LEN] = {
   {0x48, 0x3F, 0xE9, 0x05, 0x96, 0x9F}
  ,{0xF4, 0x31, 0xC3, 0xAA, 0x66, 0x30}
  };

String friendname[LIST_SIZE] = {
   "Target 1"
  ,"Target 2"
  };


void setup() { 
 #if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
  clock_prescale_set(clock_div_1);
#endif


  pixels.begin(); 
  pixels.show(); 

  Serial.begin(115200);
  esppl_init(cb);
}


int cooldown = 0;



bool maccmp(uint8_t *mac1, uint8_t *mac2) {
  for (int i=0; i < ESPPL_MAC_LEN; i++) {
    if (mac1[i] != mac2[i]) {
      return false;
    }
  }
  return true;
}

void cb(esppl_frame_info *info) {
  for (int i=0; i<LIST_SIZE; i++) {
    if (maccmp(info->sourceaddr, friendmac[i]) || maccmp(info->receiveraddr, friendmac[i])) {
      Serial.printf("\n%s is here! :)", friendname[i].c_str());
      cooldown = 1000; 
      
      if (i == 1){
        {
for(int j=0;j<8;j++){ 
  pixels.setPixelColor(j, pixels.Color(255,0,0)); 
  pixels.show();
  }
        }
      }
    
        
        else {
         for(int k=8;k<16;k++){ 
  pixels.setPixelColor(k, pixels.Color(0,0,255)); 
  pixels.show();
  }
  }
    }
      else { 
        if (cooldown > 0) {
          cooldown--; } 
          else { 
        for(int j=0;j<16;j++){ 
         pixels.setPixelColor(j, pixels.Color(0,0,0)); 
        pixels.show();
        
        }} } } }


void loop() { 
  esppl_sniffing_start();
  while (true) {
    for (int i = ESPPL_CHANNEL_MIN; i <= ESPPL_CHANNEL_MAX; i++ ) {
      esppl_set_channel(i);
      while (esppl_process_frames()) {
       
      }
    }
  }  
  
pixels.begin(); 
}