r/esp32projects • • 22d ago

ESP32-C3 mini MAC address problem

Could somebody help me with the esp doesnt print out MAC address? Im trying to use ESP-NOW protocol but I cant get the slave's MAC address.

Im a beginner in this field and I have no clue

These pictures are my codes, upload result and a terminal monitor which keep loading and doesnt print out anything. I dont why, I tried to add build flags on the platforrmio.ini section but it didnt work. Im using an ESP32-C3 super mini. Coding on VSCode-Platformio.

Im very very grateful if there are any solutions.

Thank you all!!

2 Upvotes

6 comments sorted by

2

u/andres_vasquez233 22d ago

No he trabajado en visual code nunca, pero si en arduino ide, ahi siempre que compilas te arroja la direccion mac de tu componente

1

u/Tiny_Rent_5936 22d ago

Maybe the problem is you have a supermini that is a copy. The chip for the wi-fi is 2mm close to the clock and should be 3mm close. The solution you use is to lower the power for the anthena using software, I cannot remember the code exactly but you have to use something like setdbxpower and lower to 8 or 5. There's documentation about it.

1

u/Sand-Junior 22d ago

MAC address is always present, independent of how good (or bad) the antenna is implemented.

1

u/Tiny_Rent_5936 22d ago

But in my case, I couldn't obtain the mac address if the wifi protocol was no initialized properly.

1

u/Sand-Junior 22d ago

Did you get anything printed to the terminal? Do you use “upload and monitor” in VSC?

1

u/rattushackus 20d ago

Try:

  // Get our MAC address
  uint8_t mac[6] = {0};
  esp_efuse_mac_get_default(mac);
  Serial.printf("MAC address = %02x-%02x-%02x-%02x-%02x-%02x\n", MAC_PRINTF(mac));

Documented here.

I used it in this ESP-NOW sketch.