Page 1 of 1

ESP NOW MAC address

Posted: Fri Aug 12, 2022 12:13 am
by jwinfieldnz
I have a project where I would like to know the sending MAC address. I am using this library https://github.com/yoursunny/WifiEspNow. At the beginning of the script I use WiFi.macAddress(); to get the MAC address but this is different to the MAC used in transmissions. This MAC address starts with 84 whereas the ESPNOW MAC address starts with 86. How would I get the correct MAC address for ESPNOW?

Re: ESP NOW MAC address

Posted: Mon Aug 22, 2022 2:48 pm
by OutOfLine
To put the mac in my_mac use

Code: Select all

#include "esp_system.h"
uint_8t my_mac[6];
esp_read_mac(my_mac, ESP_MAC_WIFI_STA);
Hope that helps