espressif / ESP8266_RTOS_SDK

Latest ESP8266 SDK based on FreeRTOS, esp-idf style.
http://bbs.espressif.com
Apache License 2.0
3.35k stars 1.57k forks source link

ESP-NOW is not using custom MAC adddress (GIT8266O-867) #1289

Open mluessi opened 2 months ago

mluessi commented 2 months ago

Checklist

How often does this bug occurs?

always

Expected behavior

I'm trying to use ESP-NOW with a custom MAC address. The MAC address is set using esp_base_mac_addr_set before initializing WiFi and ESP-NOW. Reading the MAC address using esp_read_mac confirms that the custom MAC address has been set. However, ESP-NOW is still using the MAC address from the eFUSE (same as esp_efuse_mac_get_default) while I would expect it to use the custom MAC address.

Actual behavior (suspected bug)

ESP-NOW is using MAC from eFUSE instead of the MAC set by the user.

Error logs or terminal output

No response

Steps to reproduce the behavior

  1. Change MAC address using esp_base_mac_addr_set
  2. Configure WiFi and ESP-NOW (esp_wifi_init, esp_wifi_set_mode(WIFI_MODE_APSTA) , esp_now_init())
  3. Send data to a peer ESP-NOW (using esp_now_send))
  4. Check MAC address in receive callback of peer: The MAC address is the eFUSE MAC, not the custom MAC configured by the user.
  5. Also receiving data only works when the message is sent to the eFUSE MAC.

Project release version

ESP8266_RTOS_SDK Release v3.3

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

Linux

Operating system version

Arch

Shell

Bash

Additional context

No response