Missmatch in mac address when it is called through Bssidstr()

I am using Nodemcu V3 as host an AP and an ESP 32 which receiver which receives nodemcu MAC address by using Bssidstr() .But the Problem is when i Print mac address of nodemcu it starts with 44 and when i print mac address of nodemcu via esp32 it starts with 46 .the rest of the mac address are correct

Code of Nodemcu

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
const char *ssid = "Test";
const char *password = "123456789";
void setup() {
  Serial.begin(115200);
  // WiFi.mode(WIFI_AP_STA);
  WiFi.softAP(ssid, password);
  Serial.println(" ");
  Serial.println(WiFi.macAddress());
}

void loop() {
  // put your main code here, to run repeatedly:
}

Code of ESP32

#include <WiFi.h>

const char* ssid = "Test";
const char* password = "123456789";

void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
  Serial.print("AP MAC address: ");
  Serial.println(WiFi.BSSIDstr());
}

void loop() {
  // put your main code here, to run repeatedly:
}

Output of the above code left side is Nodemcu and right side is ESP32

I want get same mac address of host on both Host and receiver side

1 Like

Weird

What do you see if you change the code or you AP to

 #include <ESP8266WiFi.h>

void setup(){
  Serial.begin(115200);
  Serial.println();
  Serial.print("AP‘s MAC Address:  ");
  Serial.println(WiFi.macAddress());
}
 
void loop() {}

Could you clarify what you are suggesting me to to

Run that code and see if it’s the same MAC address without activating the AP

The host with and without AP mac address in same that starts with 44

please don't post images of text again. Just copy the text and post it within code tags


OK that's weird; Not sure what's going on. What MAC address do you see if you connect with your PC / Mac ?

When i try collect nodemcu mac address using ESP32 it shows this value 46:17:93:13:FC:EB but the mac address show by host is 44:17:93:13:FC:EB .( Host is nodemcu and receiver is ESP32 )

yes - you said that already

I'm wondering what Mac address is seen if you connect from something else than the ESP32 (to see if this is the ESP32 getting that incorrectly)

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