Page 1 of 1

[WiFi] different interface's MACs

Posted: Mon Oct 14, 2019 12:37 am
by Dumbledore
I'm setting up an AP. I decided to check the MAC addresses of my board:

Code: Select all

esp_wifi_get_mac(WIFI_MODE_NULL, mac1);
esp_wifi_get_mac(WIFI_MODE_STA, mac2);
esp_wifi_get_mac(WIFI_MODE_AP, mac3);
and for some reason this produces

Code: Select all

I (736) wifi softAP: MAC NULL: 24:0A:C4:0C:4F:34
I (736) wifi softAP: MAC STA: 24:0A:C4:0C:4F:35
E (746) wifi: esp_wifi_get_mac 1502 ifx=2 wrong
ESP_ERROR_CHECK failed: esp_err_t 0x3004 (ESP_ERR_WIFI_IF) at 0x4008b41c
I (746) wifi softAP: MAC AP: 80:F8:01:80:20:00
Does this mean that there's only a NULL and a STA MAC, no AP MAC? If the AP sends a frame, which of both will be the transmitter (in case I need to filter for a specific MAC)?

Re: [WiFi] different interface's MACs

Posted: Mon Oct 14, 2019 2:29 am
by WiFive
You are passing a mode enum to the function instead of an interface enum.

Re: [WiFi] different interface's MACs

Posted: Mon Oct 14, 2019 10:00 am
by Dumbledore
Ah, I see. So the first one is the STA MAC and the second one is the AP MAC from which packets to connected STAs will be send, right?

Also, possibly a dumb question, but will basic APs, as in the esp-idf/examples directory, automatically do "AP work" as responding with ACKs and/or CTSs when necessary or do we need to implement the specific behaviour by ourselves? Because right now, when I send a random frame to the AP, it's not returning any frames.