MAC$(N)

If doesn't fit into any other category ....
Post Reply
BeanieBots
Posts: 325
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 173 times
Been thanked: 104 times

MAC$(N)

Post by BeanieBots »

From the help....
MAC$(0) returns the station mode mac address.
MAC$(1) returns the AP mode mac address.
I have device which gives:-
MAC$(0) = 2C:F4:32:A5:5F:0E
MAC$(1) = 2E:F4:32:A5:5F:0E
However, an IP scan shows a mac of 02:0F:B5:A5:5F:0E (it's in station mode).
Could somebody please explain?
User avatar
cicciocb
Site Admin
Posts: 1899
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 407 times
Been thanked: 1269 times
Contact:

Re: MAC$(N)

Post by cicciocb »

I suppose that this is for the ESP8266, right?
BeanieBots
Posts: 325
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 173 times
Been thanked: 104 times

Re: MAC$(N)

Post by BeanieBots »

Yes it is. Sorry, forgot to mention that.
The firmware is 1.44.2 by the way.
I am setting up a remote sensor to send over ESPNOW and found these three numbers for its MAC.
I get the AP/Station difference, but why a 3rd value from an IP scan? and what does it mean?
User avatar
cicciocb
Site Admin
Posts: 1899
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 407 times
Been thanked: 1269 times
Contact:

Re: MAC$(N)

Post by cicciocb »

The right address should be the one given by the scan.
Probably an error in the SDK

Edit :
I'm not really sure, the MAC address do not seems valid
https://dnschecker.org/mac-lookup.php?q ... %3A5F%3A0E

but the one given by Annex seems to be valid
https://dnschecker.org/mac-lookup.php?q ... %3A5F%3A0E
BeanieBots
Posts: 325
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 173 times
Been thanked: 104 times

Re: MAC$(N)

Post by BeanieBots »

Interesting.
I get consistant (3 values) results with several different 8266s. (including with firmware 1.42.3)
ESPNOW works if I use the address returned by mac$(0) when in ST mode and mac$(1) when in AP mode. (as expected)
The 3rd value does not work in either mode.
The 3rd value is returned by both the Tookit scan and also the scanner available at www.advanced-ip-scanner.com.

For the ESP32, all works as expected. Shame about having to use wifi.mode 3 when 8266 wants to send to ESP32 using ESPNOW.
Curiously, ESPNOW broadcast will send from 8266 to ESP32 in Station mode :?:

Thanks for the DNS lookup link. A very useful tool.
Post Reply