Error code scan wifi networks

Hello everyone,

I would like to verify that a beacon that I have configured is transmitting correctly. For that, I modified the code of kalanda that you can find on this link esp8266-sniffer/main.cpp at 65cef8dae9cc0940440b9fcd41eeddece3c72067 · kalanda/esp8266-sniffer · GitHub and I used 2 cards esp8266mod as transmitter and receiver.

The code allows to scan of the wifi networks and display the frame emitted by the beacon in the terminal.

Here is my code and the table I used to configure my beacon frame:
code :

#include <Arduino.h>
#include <time.h>

extern "C" {
#include <user_interface.h>
}

#define DATA_LENGTH           121

#define TYPE_MANAGEMENT       0x00
#define TYPE_CONTROL          0x01
#define TYPE_DATA             0x02
#define SUBTYPE_PROBE_REQUEST 0x04

struct RxControl {
  signed rssi: 8; // signal intensity of packet
  unsigned rate: 4;
  unsigned is_group: 1;
  unsigned: 1;
  unsigned sig_mode: 2; // 0:is 11n packet; 1:is not 11n packet;
  unsigned legacy_length: 12; // if not 11n packet, shows length of packet.
  unsigned damatch0: 1;
  unsigned damatch1: 1;
  unsigned bssidmatch0: 1;
  unsigned bssidmatch1: 1;
  unsigned MCS: 7; // if is 11n packet, shows the modulation and code used (range from 0 to 76)
  unsigned CWB: 1; // if is 11n packet, shows if is HT40 packet or not
  unsigned HT_length: 16; // if is 11n packet, shows length of packet.
  unsigned Smoothing: 1;
  unsigned Not_Sounding: 1;
  unsigned: 1;
  unsigned Aggregation: 1;
  unsigned STBC: 2;
  unsigned FEC_CODING: 1; // if is 11n packet, shows if is LDPC packet or not.
  unsigned SGI: 1;
  unsigned rxend_state: 8;
  unsigned ampdu_cnt: 8;
  unsigned channel: 4; //which channel this packet in.
  unsigned: 12;
};

struct SnifferPacket {
  struct RxControl rx_ctrl;
  uint8_t data[DATA_LENGTH];
  uint16_t cnt;
  uint16_t len;
};


static void showMetadata(SnifferPacket *snifferPacket) {

  unsigned int frameControl = ((unsigned int)snifferPacket->data[1] << 8) + snifferPacket->data[0];

  uint8_t version      = (frameControl & 0b0000000000000011) >> 0;
  uint8_t frameType    = (frameControl & 0b0000000000001100) >> 2;
  uint8_t frameSubType = (frameControl & 0b0000000011110000) >> 4;
  uint8_t toDS         = (frameControl & 0b0000000100000000) >> 8;
  uint8_t fromDS       = (frameControl & 0b0000001000000000) >> 9;

  // Only look for probe request packets
  if (frameType != TYPE_MANAGEMENT || frameSubType != SUBTYPE_PROBE_REQUEST)
    return;



  //    Serial.print("  RSSI: ");
  //    Serial.print(snifferPacket->rx_ctrl.rssi, DEC);


  // vérification de la trame est une taille minimal de 30 octets 
  //if (int(snifferPacket->data[42]) > 30) {
   
    // vérification du OUI/CID
    if (snifferPacket->data[38] == 0x6A && snifferPacket->data[39] && 0x5C && snifferPacket->data[40] == 0x35 ) {
      Serial.print("  Ch: ");
      Serial.print(wifi_get_channel());

      
//      Serial.print("  taille: ");
//      Serial.print(snifferPacket->data[42],DEC);
//
//      Serial.print("  1:");
//      Serial.print(snifferPacket->data[44],DEC);

      //Serial.print("  SSID: ");
      //printDataSpan(39,20, snifferPacket->data);
      
      Serial.print(",2:");
      printDataSpan(47, 30, snifferPacket->data);

      Serial.print(",3:");
      printDataSpan(78, 3, snifferPacket->data);

//      Serial.print(",4: ");
//      printDataHEX(84, 4, snifferPacket->data);
//
//      Serial.print("  5: ");
//      printDataSpan(90, 4, snifferPacket->data);
//
//      Serial.print("  6: ");
//      printDataSpan(96, 2, snifferPacket->data);
//
//      Serial.print("  7: ");
//      printDataSpan(100, 2, snifferPacket->data);
//
//      Serial.print("  8: ");
//      printDataSpan(104, 4, snifferPacket->data);
//      
//      Serial.print("  9: ");
//      printDataSpan(110, 4, snifferPacket->data);
//
//      Serial.print("  10: ");
//      Serial.print(snifferPacket->data[116],DEC);
//
//      Serial.print("  11: ");
//      printDataSpan(119, 2, snifferPacket->data);

      Serial.println();
    }
  //}
}

/**
   Callback for promiscuous mode
**/
static void ICACHE_FLASH_ATTR sniffer_callback(uint8_t *queue, uint16_t length) {
  struct SnifferPacket *snifferPacket = (struct SnifferPacket*) queue;
  showMetadata(snifferPacket);
}

// Fonction pour écrire les données de la trame brut dans le port serial //
static void printDataSpan(uint16_t start, uint16_t size, uint8_t* data) {
  for (uint16_t i = start; i < DATA_LENGTH && i < start + size; i++) {
    Serial.write(data[i]);
  }
}
// Fonction similaire a printDataSpan permettant d'afficher les données de la trame en héxadécimal //
static void printDataHEX(uint16_t start, uint16_t size, uint8_t* data) {
  for (uint16_t i = start; i < DATA_LENGTH && i < start + size; i++) {
    Serial.print(data[i],HEX);
  }
}


#define CHANNEL_HOP_INTERVAL_MS   1000
static os_timer_t channelHop_timer;

/**
   Callback for channel hoping
*/
void channelHop()
{
  // hoping channels 1-13
    uint8 new_channel = wifi_get_channel() + 1;
    if (new_channel > 13) {
      new_channel = 1;
    }
  wifi_set_channel(new_channel);
}



#define DISABLE 0
#define ENABLE  1

void setup() {
  // set the WiFi chip to "promiscuous" mode aka monitor mode
  Serial.begin(9600);
  delay(10);
  wifi_set_opmode(STATION_MODE);
  wifi_set_channel(6);
  wifi_promiscuous_enable(DISABLE);
  delay(10);
  wifi_set_promiscuous_rx_cb(sniffer_callback);
  delay(10);
  wifi_promiscuous_enable(ENABLE);

  // setup the channel hoping callback timer
  //os_timer_disarm(&channelHop_timer);
  //os_timer_setfn(&channelHop_timer, (os_timer_func_t *) channelHop, NULL);
  //os_timer_arm(&channelHop_timer, CHANNEL_HOP_INTERVAL_MS, 1);
}

void loop() {
  delay(1);
}

Beacon frame:


uint8_t beaconPacket[121] = 
{
  0x80, 0x00, 
  0x00, 0x00, 
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 
  0x00, 0xC0, 0xCA, 0xA7, 0x8B, 0x32,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
  0x00, 0x00, 
  0x83, 0x51, 0xf7, 0x8f, 0x0f, 0x00, 0x00, 0x00,
  0xE8, 0x03, 
  0x01, 0x00,
  0x03, 0x01, 0x06, // DS Parameter set, current channel 6 (= 0x06), // TODO: manually set it
  0x00, 0x20,  // SSID parameter 
  0xDD, 0x4E, 0x6A, 0x5C, 0x35, 0x01, //[00, 46] informations de trames beacon  // [37] 0x4E  taille du payload depuis après le 0x4E jusqu'a la fin
  0x01, 0x01, 0x01,                         // [47, 49] version du protocol
  0x02, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  'L', 'A', 'U', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // [50, 81] identifiant
  0x04, 0x04, 0x00, 0x00, 0x00, 0x00, // [82, 87] latitude actuelle
  0x05, 0x04, 0x00, 0x00, 0x00, 0x00, // [88, 93] longitude actuelle
  0x06, 0x02, 0x00, 0x00,             // [94, 97] altitude actuelle
  0x07, 0x02, 0x00, 0x00,             // [98, 101] hauteur actuelle = altitude actuelle - altitude depart
  0x08, 0x04, 0x00, 0x00, 0x00, 0x00, // [102, 107] latitude depart
  0x09, 0x04, 0x00, 0x00, 0x00, 0x00, // [108, 113] longitude depart
  0x0A, 0x01, 0x00,                   // [114, 116] vitesse horizontale
  0x0B, 0x02, 0x00, 0x00              // [117, 120] route vraie
};

However, when I go to the terminal of the IDE of Arduino nothing is displayed while I normally filtered the frames on the good bytes and the good channel. Can someone help me?