Skip to content

WiFi.macAddress() returns 00:00:00:00:00:00 before WiFi.begin() #11285

Closed
@sans-ltd

Description

@sans-ltd

Board

ESP32-Mini 1U

Device Description

Hardware Configuration

Version

v3.1.1

IDE Name

VSCode

Operating System

Linux

Flash frequency

40Mhz

PSRAM enabled

no

Upload speed

115200

Description

  • When calling WiFi.macAddress() before WiFi.begin(), we cannot get the MAC address.
  • With Arduino 2, it worked because it used esp_read_mac() as fallback, if WiFi was not initialized yet.
  • If we call WiFi.begin(), our station does not work correctly, we cannot see the WiFi with another device. In Addition, the WiFiAccessPoint example also does not call WiFi.begin()
  • Reading the MAC address with esp_read_mac(mac, ESP_MAC_WIFI_STA) works fine though, without initializing the WiFi first.

Sketch

setup()
{
  auto mac = WiFi.macAddress();
  // mac is 00:00:00:00:00:00
  // do some magic to generate an SSID
  WiFi.softAP(name.c_str(), passwd.c_str());
  ...
}

Debug Message

-

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.0 migrationissue relates to migration from 2.X to 3.X versionStatus: Awaiting Responseawaiting a response from the author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions