Advertise with mac address incremented by 2?


Hi all,

When I start the ESP32 in BLE peripheral mode, it advertises using the mac address incremented by 2.
Where is this done? How can I control this behavior?
I think, this is not a good practice, because a unique id is unique and who can guarantee, that the device with an address incremented by 2 does not exist in the same environment, which would lead to a collision …

Kind regards


Is this an Espressif problem or specifically a MOS problem?
If it’s an Espressif problem it might be better to look for an answer somewhere with more specific ESP32 support discussion


mOS in this case is mostly a wrapper around the ESP32 SDK
However, have you tried disabling the random MAC address option that is designed just for the opposite reason you describe ? Some people don’t want their devices to be tracked or easily found.
bt.random_address = false
I’ve seen fixed and I’ve seen random addresses, but I’ve yet to see incremented by 2. If you don’t solve it please post your code so someone can try to help.


Hi Scaprile,

Yes, I do disable the random_address in mos.yaml already .
I get the device address using ‘device_get_mac_address’ and when I let the device advertise as BLE peripheral, it does it with an address that is incremented by 2!
I think, a small sketch will show the same behaviour …
Do you have an idea?

Thanks and kind regards


I guess what you are saying is that you observe the device MAC address, which is not the device BLE address but the WiFi station address, and then you somehow somewhere see a BLE MAC which is off by +2.
Well, I do see 30AEA4807A9A on a device which I know is 30AEA4807A98 but that is comparing apples to oranges. Both are different MAC addresses belonging to different interfaces and you need to know how the manufacturer (the owner of the OUI in the public MAC), Espressif, assigns the variable portion of this public address space.
30AEA4 is Espressif’s OUI and they manage how they assign addresses. They explain how they do it here: they assign their chips every 4th number and then distribute those values among the four possible interfaces (WiFi station, WiFi softap, Bluetooth and Ethernet) by adding 0, 1, 2 or 3 (in that order); so a BLE address is effectively a WiFi station address +2.