-->
Page 1 of 1

Wrong MAC Address!

PostPosted: Wed Aug 08, 2018 5:01 am
by Trillium2
I have just started to investigate the possibility of using Esp-Now to pass data instead of using Mega2560s with ethernet and came across 2 sketches EspNowBroadcast and EspNowUnicast which I have not yet got my head around.

Whilst quickly checking through the codes I noticed that I had obviously entered a MAC address incorrectly as the serial monitor gives the MAC addresses of the host modules. I had copied the address from my router web interface into the code. When I checked the router again I found that the address I had entered into the code was the same but the serial monitor was display a different address.

both Modules exhibit the same error in the same (first) octet i.e. the code gives 0x5E and the router shows 0x5C. The code which obtains the address is,

Serial.println(WiFi.softAPmacAddress());

Can anyone suggest a way I can confirm which is correct?

Thanks

Re: Wrong MAC Address!

PostPosted: Wed Aug 08, 2018 5:35 am
by Pablo2048
ESP8266 has 2 MAC addresses - one for STA and one for AP (SoftAP). Your router probably gives you STA MAC address, given by WiFi.macAddress() whilst Your Serial.println... gives You SoftAP address (.softAPmacAddress() ).

Re: Wrong MAC Address!

PostPosted: Wed Aug 08, 2018 5:52 am
by Trillium2
Thanks pablo2048, It seems I learn something new each day (hopefully). So I assume both pieces of code will be using the soft address and therefore my problem lies elsewhere.

Ah well! Back to the code.

Many thanks for the solution.