I followed this great tutorial to setup the ESPNow protocol. It ran smoothly.
ESPNow Tutorial
ESP-NOW Sender Code Explanation
Purpose:
Send a small data packet to another ESP32 using ESP-NOW.
Key Steps:
Includes esp_now.h and WiFi.h so the ESP32 can use ESP-NOW and Wi-Fi features.
Defines a struct to organize the data being sent (e.g., an integer and a float).
You manually set the MAC address of the device you want to send data to.
• Sets ESP32 to Wi-Fi Station mode.
• Starts ESP-NOW.
• Registers the receiver as a peer using its MAC address.
• Sets a callback to check if the message was successfully sent.