ESP32 ESP-NOW OPTION.MAC Station mode

Recurrent H/W and software problems
Post Reply
EasyRider
Posts: 28
Joined: Sat Jun 05, 2021 1:27 am
Has thanked: 7 times
Been thanked: 2 times

ESP32 ESP-NOW OPTION.MAC Station mode

Post by EasyRider »

Running ESP32 with 1.48.22 firmware.

Connected via local wifi router in station mode for editing etc., have multiple annex esp32 modules.

Playing with ESP-NOW.
When using OPTION.MAC command to set custom mac address on Esp32, it disconnects from wifi router and obviously loose editing connection.

Is there a work arround of being able to assign custom mac address and still be able to connect to local wifi router?

If connected directly to ESP32 in AP mode, no problem with changing mac address.

Regards Easy
EasyRider
Posts: 28
Joined: Sat Jun 05, 2021 1:27 am
Has thanked: 7 times
Been thanked: 2 times

Re: ESP32 ESP-NOW OPTION.MAC Station mode

Post by EasyRider »

Further Searching.

I am no expert in wifi networking, relatively basic knowledge.

By changing mac address on esp32 in STA mode, wifi router should reassing new IP address to esp32.
I did observe the change of ip address to esp32 by looking at wifi router connection list, however was not able to connect to new ip address.
Shortly after esp32 dissapered from wifi routers connections?
By resetting esp32, things go back to initial factory mac, but I want custom mac address that I can assign for esp-now communication and would like to be connected to local wifi router at the same time for developing software on multiple esp32 modules at the same time.

SOLVED

Solutioin that works is to connect to wifi router using command wifi.apmode.

From Annex manual
For stand alone configuration or for ESP-NOW applications, there is another command that puts the module in AP mode.

This command is WIFI.APMODE SSID$, password$ [, channel].

The result is immediate and the status can be checked using the function WIFI.MODE (see below).

The channel is optional and is 1 by default.
Post Reply