SimpleEspNowConnection Compilation Error

Hi, just installed the library "SimpleEspNowConnection", opened the example "SimpleEspNowConnectionClient.ino", choose Board "ESP32 Dev Module" and pressed compile.
The (unchanged) example then gives me the following error code:

c:\Sketches\libraries\SimpleEspNowConnection\src\SimpleEspNowConnection.cpp: In static member function 'static void SimpleEspNowConnection::pairingTickerClient()':
c:\Sketches\libraries\SimpleEspNowConnection\src\SimpleEspNowConnection.cpp:353:74: error: cannot convert 'esp_interface_t' to 'wifi_interface_t'
  esp_wifi_set_mac(ESP_IF_WIFI_STA, &simpleEspNowConnection->_myAddress[0]);
                                                                          ^
In file included from c:\Sketches\libraries\SimpleEspNowConnection\src\SimpleEspNowConnection.h:28,
                 from c:\Sketches\libraries\SimpleEspNowConnection\src\SimpleEspNowConnection.cpp:14:
C:\Users\XYZ\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/esp_wifi/include/esp_wifi.h:680:45: note:   initializing argument 1 of 'esp_err_t esp_wifi_set_mac(wifi_interface_t, const uint8_t*)'
 esp_err_t esp_wifi_set_mac(wifi_interface_t ifx, const uint8_t mac[6]);
                            ~~~~~~~~~~~~~~~~~^~~
c:\Sketches\libraries\SimpleEspNowConnection\src\SimpleEspNowConnection.cpp: In member function 'bool SimpleEspNowConnection::startPairing(int)':
c:\Sketches\libraries\SimpleEspNowConnection\src\SimpleEspNowConnection.cpp:417:52: error: cannot convert 'esp_interface_t' to 'wifi_interface_t'
   esp_wifi_set_mac(ESP_IF_WIFI_STA, &_pairingMac[0]);
                                                    ^
In file included from c:\Sketches\libraries\SimpleEspNowConnection\src\SimpleEspNowConnection.h:28,
                 from c:\Sketches\libraries\SimpleEspNowConnection\src\SimpleEspNowConnection.cpp:14:
C:\Users\XYZ\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/esp_wifi/include/esp_wifi.h:680:45: note:   initializing argument 1 of 'esp_err_t esp_wifi_set_mac(wifi_interface_t, const uint8_t*)'
 esp_err_t esp_wifi_set_mac(wifi_interface_t ifx, const uint8_t mac[6]);
                            ~~~~~~~~~~~~~~~~~^~~
c:\Sketches\libraries\SimpleEspNowConnection\src\SimpleEspNowConnection.cpp: In static member function 'static void SimpleEspNowConnection::onReceiveData(const uint8_t*, const uint8_t*, int)':
c:\Sketches\libraries\SimpleEspNowConnection\src\SimpleEspNowConnection.cpp:658:77: error: cannot convert 'esp_interface_t' to 'wifi_interface_t'
     esp_wifi_set_mac(ESP_IF_WIFI_STA, &simpleEspNowConnection->_myAddress[0]);
                                                                             ^
In file included from c:\Sketches\libraries\SimpleEspNowConnection\src\SimpleEspNowConnection.h:28,
                 from c:\Sketches\libraries\SimpleEspNowConnection\src\SimpleEspNowConnection.cpp:14:
C:\Users\XYZ\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14/tools/sdk/esp32/include/esp_wifi/include/esp_wifi.h:680:45: note:   initializing argument 1 of 'esp_err_t esp_wifi_set_mac(wifi_interface_t, const uint8_t*)'
 esp_err_t esp_wifi_set_mac(wifi_interface_t ifx, const uint8_t mac[6]);
                            ~~~~~~~~~~~~~~~~~^~~

exit status 1

Compilation error: exit status 1

Am i doing something wrong, i have no clue ...

Seems to be a pretty old demo-code.
esspressif did change variable types in the API multiple times
here is a code-version which does compile using
ESP32 core version 2.0.14
with additional download-URL
https://espressif.github.io/arduino-esp32/package_esp32_index.json

// WARNING !! Trying to adapt this ESP32-code using ESP-NOW to a ESP8266 is a big hassle 
// as the ESP8266-ESP-NOW-library works very differently using other functions etc.
// for coding with an ESP8266 start with a code that is written for ESP8266 DON'T try to adapt an ESP32-code


//WiFiLib and Esp-NowLib espnowlib 
#include <WiFi.h>    // ESP32 needs "WiFi.h"     ESP8266 needs "ESP8266WiFi.h"
#include <esp_now.h> // ESP32 needs "esp_now.h"  ESP8266 needs "espnow.h" do you recognize the difference?

#define CHANNEL 0

boolean gb_SerialOutput_enabled = true;

using MacAdr = uint8_t[6];

// the code must know all receivers MAC-adresses that THIS boards wants to send data to
MacAdr ESP_NOW_MAC_adrOfRecv1  { 0x18, 0xFE, 0x34, 0xCF, 0x1F, 0xF4 };
//ESP_NOW_MAC_adrTimeRcv[] = { 0x18, 0xFE, 0x34, 0xCF, 0x1F, 0xF4 };
MacAdr ESP_NOW_MAC_adrOfRecv2  { 0x24, 0x0A, 0xC4, 0x02, 0xBC, 0x20 };
MacAdr ESP_NOW_MAC_adrOfRecv3  { 0x24, 0x6F, 0x28, 0x22, 0x62, 0xFC };

MacAdr SendersOwnMacAdress     { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
void SetupOwnMacAdress(){
  memcpy (SendersOwnMacAdress, ESP_NOW_MAC_adrOfRecv3, sizeof(SendersOwnMacAdress) );
}

esp_now_peer_info_t peerInfo;

void RegisterPeer(const MacAdr &MyMac_Adress_array) {
  memcpy(peerInfo.peer_addr, MyMac_Adress_array, sizeof(peerInfo.peer_addr) );
  peerInfo.channel = 0;  
  peerInfo.encrypt = false;

  if (esp_now_add_peer(&peerInfo) != ESP_OK)
  { if (gb_SerialOutput_enabled)
      { Serial.println("Failed to add peer"); }
    return;
  }  
}

//nbt nonblockingtimer 
boolean TimePeriodIsOver (unsigned long &expireTime, unsigned long TimePeriod) {
  unsigned long currentMillis  = millis();
  if ( currentMillis - expireTime >= TimePeriod )
  {
    expireTime = currentMillis; // set new expireTime
    return true;                // more time than TimePeriod) has elapsed since last time if-condition was true
  } 
  else return false;            // not expired
}

unsigned long BlinkTimer = 0;
const int     OnBoardLED = 2;

unsigned long SendDataTimer = 0;

// pslib pstringlib
//#include <PString.h> // the use of PString avoids code-malfunction like Strings can do
#include <SafeString.h>
char    TestESP_CmdStr_AoC[64];
//PString TestESP_CmdStr_PS(TestESP_CmdStr_AoC, sizeof(TestESP_CmdStr_AoC) );
createSafeString(TestESP_CmdStr_PS,64);

// pfndt
void PrintFileNameDateTime() {
  Serial.print("Code running comes from file ");  Serial.println(__FILE__);
  Serial.print("compiled ");  Serial.print(__DATE__);  Serial.print(" ");  Serial.println(__TIME__);
}

// pma pwma
void PrintWiFiMacAdress() {
  char MacAdr_AoC[18];  //suffix _AoC for easier remembering variable-type is ArrayOfChar
  char HexByteDigits[3];

  for (uint8_t i = 0; i < 18; i = i + 1){
    MacAdr_AoC[i] = WiFi.macAddress()[i];
  }
  MacAdr_AoC[17] = 0; // zero to terminate the string
  Serial.print("ESP Board Wifi.macAddress:  ");
  Serial.println(MacAdr_AoC);

  Serial.println();
  Serial.println("copy the line below and replace the '#' with variablename of your choice");
  Serial.println();
  Serial.print("uint8_t #[] = { ");
  for (uint8_t i = 0; i < 16; i = i + 3)
  {
    HexByteDigits[0] = MacAdr_AoC[i];
    HexByteDigits[1] = MacAdr_AoC[i + 1];
    HexByteDigits[2] = 0; // zero for terminating the string
    Serial.print("0x");
    Serial.print(HexByteDigits);
    if (i < 14) Serial.print(", ");
  }
  Serial.println(" };");
  Serial.println();
}

// espnowmsg espnowbytes enbytes espstruc
// Structure example to send data. Must match the receiver structure
typedef struct MyESP_NOW_Data_type {
  char  MyESP_NOW_SenderID_AoC[16];
  char  MyESP_NOW_StatusMsg_AoC[64];
  int   MyESP_NOW_Int;
  float MyESP_NOW_Float;
} MyESP_Data_type;

MyESP_NOW_Data_type ESP_Data_Received;
MyESP_NOW_Data_type ESP_Data_ToSend;


// Init ESP Now with restart in case something went wrong
void InitESPNow() {
  if (gb_SerialOutput_enabled)
  { if (esp_now_init() == ESP_OK) 
    { Serial.println("ESPNow Init Success"); }
    else 
    { Serial.println("ESPNow Init Failed");
      ESP.restart(); //there was an error try again through restarting the board
    }
  }  
}


void ESP_NOW_Setup() {
  WiFi.mode(WIFI_STA); //Set device in STA mode to begin with
  WiFi.disconnect();   // for strange reasons WiFi.disconnect(); is nescessary to make ESP-NOW work
  if (gb_SerialOutput_enabled)
    { Serial.println("WiFi.mode(WIFI_STA WiFi.disconnect() done");}

  InitESPNow();   // Init ESPNow with a fallback logic
  esp_now_register_send_cb(OnDataSent);
  
  esp_now_register_recv_cb(OnDataRecv);

  RegisterPeer(ESP_NOW_MAC_adrOfRecv1);
  RegisterPeer(ESP_NOW_MAC_adrOfRecv2);
  RegisterPeer(ESP_NOW_MAC_adrOfRecv3);
}


void PrintESP_Status(esp_err_t result) {
  Serial.print("Send Status: ");

  if (result == ESP_OK)
    { Serial.println("sended"); }
  else if (result == ESP_ERR_ESPNOW_NOT_INIT)
    { Serial.println("Master ESPNOW not Init."); }
  else if (result == ESP_ERR_ESPNOW_ARG)
    { Serial.println("Master Invalid Argument"); }
  else if (result == ESP_ERR_ESPNOW_INTERNAL)
    { Serial.println("Master Internal Error");}
  else if (result == ESP_ERR_ESPNOW_NO_MEM)
    { Serial.println("Master ESP_ERR_ESPNOW_NO_MEM"); }
  else if (result == ESP_ERR_ESPNOW_NOT_FOUND)
    { Serial.println("Master Peer not found."); }
  else 
    {Serial.println("Master Not sure what happened"); }
}

void SendData() {
  if (gb_SerialOutput_enabled)
    { Serial.println("sendData() Start");}
  esp_err_t result;  

  result = 1;
  if(memcmp(ESP_NOW_MAC_adrOfRecv1, SendersOwnMacAdress, sizeof(SendersOwnMacAdress) ) != 0) { // if MAC-Adess is not the own MAC-Adress
    result = esp_now_send(ESP_NOW_MAC_adrOfRecv1, (uint8_t *) &ESP_Data_ToSend, sizeof(ESP_Data_ToSend));
    // if sending has finished function OnDataSent is called  
  }

  /*
  if(memcmp(ESP_NOW_MAC_adrOfRecv2, SendersOwnMacAdress, sizeof(SendersOwnMacAdress) ) != 0) {
    result = esp_now_send(ESP_NOW_MAC_adrOfRecv2, (uint8_t *) &ESP_Data_ToSend, sizeof(ESP_Data_ToSend));
    // if sending has finished function OnDataSent is called
  }

  if(memcmp(ESP_NOW_MAC_adrOfRecv3, SendersOwnMacAdress, sizeof(SendersOwnMacAdress) ) != 0) {
    result = esp_now_send(ESP_NOW_MAC_adrOfRecv3, (uint8_t *) &ESP_Data_ToSend, sizeof(ESP_Data_ToSend));
    // if sending has finished function OnDataSent is called  
  }
  */
  Serial.println(result);
}


// callback-function that is executed when data was send to another ESP32-board
// parameter status contains info about the success or fail of the transmission
void OnDataSent(const uint8_t *Receivers_mac_addr, esp_now_send_status_t status) {
  char Receivers_macStr[18];
  snprintf(Receivers_macStr, sizeof(Receivers_macStr), "%02x:%02x:%02x:%02x:%02x:%02x",Receivers_mac_addr[0], Receivers_mac_addr[1], Receivers_mac_addr[2], Receivers_mac_addr[3], Receivers_mac_addr[4], Receivers_mac_addr[5]);

  if (gb_SerialOutput_enabled)
  {  
    Serial.print("callback-OnDataSent ");
    Serial.print("ESP32-Board Last Packet Sent to: ");
    Serial.println(Receivers_macStr);
    Serial.print("ESP32-Board1 Last Packet Send Status: ");
    Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Failed");
    Serial.println();
    Serial.println();
  }  
}

// callback-function that is executed when a ESP-NOW-Message is received
void OnDataRecv(const uint8_t *Senders_mac_addr, const uint8_t *receivedBytes, int NoOfreceivedBytes) {
  memcpy(&ESP_Data_Received, receivedBytes, sizeof(ESP_Data_Received));

  Serial.println("callback-OnDataRecv ");
  char Senders_macStr[18]; //MAC-Adress of sender
  snprintf(Senders_macStr, sizeof(Senders_macStr), "%02x:%02x:%02x:%02x:%02x:%02x", Senders_mac_addr[0], Senders_mac_addr[1], Senders_mac_addr[2], Senders_mac_addr[3], Senders_mac_addr[4], Senders_mac_addr[5]);
  Serial.print("received from MAC-Adress");
  Serial.println(Senders_macStr);

  Serial.println("receievd data:"); 
  Serial.print("SenderID #");
  Serial.print(ESP_Data_Received.MyESP_NOW_SenderID_AoC);
  Serial.println("#");

  Serial.print("StatusMsg #");
  Serial.print(ESP_Data_Received.MyESP_NOW_StatusMsg_AoC);
  Serial.println("#");
  
  Serial.print("Integer:");
  Serial.print(ESP_Data_Received.MyESP_NOW_Int);
  Serial.println();
  
  Serial.print("Float:");
  Serial.print(ESP_Data_Received.MyESP_NOW_Float);
  Serial.println();

  Serial.println();
  Serial.println();
}


void SetupMessageToSend() {
                                                                                                            //1
  if(memcmp(ESP_NOW_MAC_adrOfRecv1, SendersOwnMacAdress, sizeof(SendersOwnMacAdress) ) == 0) { // if MAC-Adess1 IS the own MAC-Adress
    memcpy(ESP_Data_ToSend.MyESP_NOW_SenderID_AoC,  "ESP32-Board1111",  sizeof(ESP_Data_ToSend.MyESP_NOW_SenderID_AoC) );
    memcpy(ESP_Data_ToSend.MyESP_NOW_StatusMsg_AoC, " I am Board No 1", sizeof(ESP_Data_ToSend.MyESP_NOW_StatusMsg_AoC) );
    ESP_Data_ToSend.MyESP_NOW_Int = ESP_Data_ToSend.MyESP_NOW_Int + 1;
    ESP_Data_ToSend.MyESP_NOW_Float = 111.111; 
  }
                                                                                                            //2 
  if(memcmp(ESP_NOW_MAC_adrOfRecv2, SendersOwnMacAdress, sizeof(SendersOwnMacAdress) ) == 0) { // if MAC-Adess2 IS the own MAC-Adress
    memcpy(ESP_Data_ToSend.MyESP_NOW_SenderID_AoC,  "ESP32-Board2222",  sizeof(ESP_Data_ToSend.MyESP_NOW_SenderID_AoC) );
    memcpy(ESP_Data_ToSend.MyESP_NOW_StatusMsg_AoC, " I am Board No 2", sizeof(ESP_Data_ToSend.MyESP_NOW_StatusMsg_AoC) );
    ESP_Data_ToSend.MyESP_NOW_Int = ESP_Data_ToSend.MyESP_NOW_Int + 2;
    ESP_Data_ToSend.MyESP_NOW_Float = 222.222; 
  }
                                                                                                            //3
  if(memcmp(ESP_NOW_MAC_adrOfRecv3, SendersOwnMacAdress, sizeof(SendersOwnMacAdress) ) == 0) { // if MAC-Adess3 IS the own MAC-Adress
    memcpy(ESP_Data_ToSend.MyESP_NOW_SenderID_AoC,  "ESP32-Board3333",  sizeof(ESP_Data_ToSend.MyESP_NOW_SenderID_AoC) );
    memcpy(ESP_Data_ToSend.MyESP_NOW_StatusMsg_AoC, " I am Board No 3", sizeof(ESP_Data_ToSend.MyESP_NOW_StatusMsg_AoC) );
    ESP_Data_ToSend.MyESP_NOW_Int = ESP_Data_ToSend.MyESP_NOW_Int + 3;
    ESP_Data_ToSend.MyESP_NOW_Float = 333.333; 
  }  
}


void setup() {
  Serial.begin(115200);
  if (gb_SerialOutput_enabled)
    { PrintFileNameDateTime(); }
    
  ESP_NOW_Setup();
  if (gb_SerialOutput_enabled)
    { PrintWiFiMacAdress(); }

  pinMode(OnBoardLED,OUTPUT);
}

void loop()
{
  if ( TimePeriodIsOver(BlinkTimer,500) ) {
    digitalWrite (OnBoardLED, !digitalRead(OnBoardLED) );
  }

  if ( TimePeriodIsOver(SendDataTimer,2000) ) {
    SetupMessageToSend();
    SendData();
  }  
}

Thanks, what you say makes sense to me, will give it a try tomorrow.
So i can't trust those lib-examples ...
So in future i should use the github instead of the Arduino-Library-Installation.

I compiled this example code
C:......packages\esp32\hardware\esp32\2.0.14\libraries\ESP32\examples\ESPNow\ESPNow_MultiSlave_Master\ESPNow_MultiSlave_Master.ino


and it compiled just fine.

/**
   ESPNOW - Basic communication - Master
   Date: 26th September 2017
   Author: Arvind Ravulavaru <https://github.com/arvindr21>
   Purpose: ESPNow Communication between a Master ESP32 and multiple ESP32 Slaves
   Description: This sketch consists of the code for the Master module.
   Resources: (A bit outdated)
   a. https://espressif.com/sites/default/files/documentation/esp-now_user_guide_en.pdf
   b. http://www.esploradores.com/practica-6-conexion-esp-now/

   << This Device Master >>

   Flow: Master
   Step 1 : ESPNow Init on Master and set it in STA mode
   Step 2 : Start scanning for Slave ESP32 (we have added a prefix of `slave` to the SSID of slave for an easy setup)
   Step 3 : Once found, add Slave as peer
   Step 4 : Register for send callback
   Step 5 : Start Transmitting data from Master to Slave(s)

   Flow: Slave
   Step 1 : ESPNow Init on Slave
   Step 2 : Update the SSID of Slave with a prefix of `slave`
   Step 3 : Set Slave in AP mode
   Step 4 : Register for receive callback and wait for data
   Step 5 : Once data arrives, print it in the serial monitor

   Note: Master and Slave have been defined to easily understand the setup.
         Based on the ESPNOW API, there is no concept of Master and Slave.
         Any devices can act as master or salve.


  // Sample Serial log with 1 master & 2 slaves
      Found 12 devices 
      1: Slave:24:0A:C4:81:CF:A4 [24:0A:C4:81:CF:A5] (-44)
      3: Slave:30:AE:A4:02:6D:CC [30:AE:A4:02:6D:CD] (-55)
      2 Slave(s) found, processing..
      Processing: 24:A:C4:81:CF:A5 Status: Already Paired
      Processing: 30:AE:A4:2:6D:CD Status: Already Paired
      Sending: 9
      Send Status: Success
      Last Packet Sent to: 24:0a:c4:81:cf:a5
      Last Packet Send Status: Delivery Success
      Send Status: Success
      Last Packet Sent to: 30:ae:a4:02:6d:cd
      Last Packet Send Status: Delivery Success

*/

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

// Global copy of slave
#define NUMSLAVES 20
esp_now_peer_info_t slaves[NUMSLAVES] = {};
int SlaveCnt = 0;

#define CHANNEL 3
#define PRINTSCANRESULTS 0

// Init ESP Now with fallback
void InitESPNow() {
  WiFi.disconnect();
  if (esp_now_init() == ESP_OK) {
    Serial.println("ESPNow Init Success");
  }
  else {
    Serial.println("ESPNow Init Failed");
    // Retry InitESPNow, add a counte and then restart?
    // InitESPNow();
    // or Simply Restart
    ESP.restart();
  }
}

// Scan for slaves in AP mode
void ScanForSlave() {
  int8_t scanResults = WiFi.scanNetworks();
  //reset slaves
  memset(slaves, 0, sizeof(slaves));
  SlaveCnt = 0;
  Serial.println("");
  if (scanResults == 0) {
    Serial.println("No WiFi devices in AP Mode found");
  } else {
    Serial.print("Found "); Serial.print(scanResults); Serial.println(" devices ");
    for (int i = 0; i < scanResults; ++i) {
      // Print SSID and RSSI for each device found
      String SSID = WiFi.SSID(i);
      int32_t RSSI = WiFi.RSSI(i);
      String BSSIDstr = WiFi.BSSIDstr(i);

      if (PRINTSCANRESULTS) {
        Serial.print(i + 1); Serial.print(": "); Serial.print(SSID); Serial.print(" ["); Serial.print(BSSIDstr); Serial.print("]"); Serial.print(" ("); Serial.print(RSSI); Serial.print(")"); Serial.println("");
      }
      delay(10);
      // Check if the current device starts with `Slave`
      if (SSID.indexOf("Slave") == 0) {
        // SSID of interest
        Serial.print(i + 1); Serial.print(": "); Serial.print(SSID); Serial.print(" ["); Serial.print(BSSIDstr); Serial.print("]"); Serial.print(" ("); Serial.print(RSSI); Serial.print(")"); Serial.println("");
        // Get BSSID => Mac Address of the Slave
        int mac[6];

        if ( 6 == sscanf(BSSIDstr.c_str(), "%x:%x:%x:%x:%x:%x",  &mac[0], &mac[1], &mac[2], &mac[3], &mac[4], &mac[5] ) ) {
          for (int ii = 0; ii < 6; ++ii ) {
            slaves[SlaveCnt].peer_addr[ii] = (uint8_t) mac[ii];
          }
        }
        slaves[SlaveCnt].channel = CHANNEL; // pick a channel
        slaves[SlaveCnt].encrypt = 0; // no encryption
        SlaveCnt++;
      }
    }
  }

  if (SlaveCnt > 0) {
    Serial.print(SlaveCnt); Serial.println(" Slave(s) found, processing..");
  } else {
    Serial.println("No Slave Found, trying again.");
  }

  // clean up ram
  WiFi.scanDelete();
}

// Check if the slave is already paired with the master.
// If not, pair the slave with master
void manageSlave() {
  if (SlaveCnt > 0) {
    for (int i = 0; i < SlaveCnt; i++) {
      Serial.print("Processing: ");
      for (int ii = 0; ii < 6; ++ii ) {
        Serial.print((uint8_t) slaves[i].peer_addr[ii], HEX);
        if (ii != 5) Serial.print(":");
      }
      Serial.print(" Status: ");
      // check if the peer exists
      bool exists = esp_now_is_peer_exist(slaves[i].peer_addr);
      if (exists) {
        // Slave already paired.
        Serial.println("Already Paired");
      } else {
        // Slave not paired, attempt pair
        esp_err_t addStatus = esp_now_add_peer(&slaves[i]);
        if (addStatus == ESP_OK) {
          // Pair success
          Serial.println("Pair success");
        } else if (addStatus == ESP_ERR_ESPNOW_NOT_INIT) {
          // How did we get so far!!
          Serial.println("ESPNOW Not Init");
        } else if (addStatus == ESP_ERR_ESPNOW_ARG) {
          Serial.println("Add Peer - Invalid Argument");
        } else if (addStatus == ESP_ERR_ESPNOW_FULL) {
          Serial.println("Peer list full");
        } else if (addStatus == ESP_ERR_ESPNOW_NO_MEM) {
          Serial.println("Out of memory");
        } else if (addStatus == ESP_ERR_ESPNOW_EXIST) {
          Serial.println("Peer Exists");
        } else {
          Serial.println("Not sure what happened");
        }
        delay(100);
      }
    }
  } else {
    // No slave found to process
    Serial.println("No Slave found to process");
  }
}


uint8_t data = 0;
// send data
void sendData() {
  data++;
  for (int i = 0; i < SlaveCnt; i++) {
    const uint8_t *peer_addr = slaves[i].peer_addr;
    if (i == 0) { // print only for first slave
      Serial.print("Sending: ");
      Serial.println(data);
    }
    esp_err_t result = esp_now_send(peer_addr, &data, sizeof(data));
    Serial.print("Send Status: ");
    if (result == ESP_OK) {
      Serial.println("Success");
    } else if (result == ESP_ERR_ESPNOW_NOT_INIT) {
      // How did we get so far!!
      Serial.println("ESPNOW not Init.");
    } else if (result == ESP_ERR_ESPNOW_ARG) {
      Serial.println("Invalid Argument");
    } else if (result == ESP_ERR_ESPNOW_INTERNAL) {
      Serial.println("Internal Error");
    } else if (result == ESP_ERR_ESPNOW_NO_MEM) {
      Serial.println("ESP_ERR_ESPNOW_NO_MEM");
    } else if (result == ESP_ERR_ESPNOW_NOT_FOUND) {
      Serial.println("Peer not found.");
    } else {
      Serial.println("Not sure what happened");
    }
    delay(100);
  }
}

// callback when data is sent from Master to Slave
void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) {
  char macStr[18];
  snprintf(macStr, sizeof(macStr), "%02x:%02x:%02x:%02x:%02x:%02x",
           mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);
  Serial.print("Last Packet Sent to: "); Serial.println(macStr);
  Serial.print("Last Packet Send Status: "); Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" : "Delivery Fail");
}

void setup() {
  Serial.begin(115200);
  //Set device in STA mode to begin with
  WiFi.mode(WIFI_STA);
  Serial.println("ESPNow/Multi-Slave/Master Example");
  // This is the mac address of the Master in Station Mode
  Serial.print("STA MAC: "); Serial.println(WiFi.macAddress());
  // Init ESPNow with a fallback logic
  InitESPNow();
  // Once ESPNow is successfully Init, we will register for Send CB to
  // get the status of Trasnmitted packet
  esp_now_register_send_cb(OnDataSent);
}

void loop() {
  // In the loop we scan for slave
  ScanForSlave();
  // If Slave is found, it would be populate in `slave` variable
  // We will check if `slave` is defined and then we proceed further
  if (SlaveCnt > 0) { // check if slave channel is defined
    // `slave` is defined
    // Add slave as peer if it has not been added already
    manageSlave();
    // pair success or already paired
    // Send data to device
    sendData();
  } else {
    // No slave found to process
  }

  // wait for 3seconds to run the logic again
  delay(1000);
}

What arduino-IDE Version are you using?

Newest Version. I installed "SimpleEspNowConnection", didn't see (i looked for it!) the EspNow-SubDir, my eye just didn't catch it, thx to your Screenshot i now did see it. "Your" example compiles handily. So it was just a problem with the "SimpleEsp..."-Library (examples not updated!?).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.