Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By Trillium2
#77624 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
User avatar
By Pablo2048
#77625 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() ).
User avatar
By Trillium2
#77626 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.