ArduinoBLE: change address ("MAC" address XX:XX:XX:XX:XX:XX)


i would like to change the BLE adresse (eg: XX:XX:XX:XX:XX:XX) of my BLE Device (Portenta H7). I'm using the ArduinoBLE Library, but there is only a way to read the address (BLE.address()). How can I change it?


Usually you cannot change it as it's a hardware address that should be unique worldwide. Why do you think you need to change it?

Hi, I need to change it, because I use a lot of Portentas in a close distance. The problem was that all BLE Chips had the same address (AA:AA:AA:AA:AA:AA). In my case, I have connected all these Portentas to one Android tablet and the tablet wasn't able to differentiate between the connected devices (data was send to the wrong Portenta etc.).
The solution is to update to the newest Portenta Core (2.1.0 in my case) and newest ArduinoBLE-version and use this Patch.
A worldwide unique hardware address with only 6x 2 characters should be impossible :wink:

Thanks and regards,

That means this hardware doesn't have the MAC address hard wired. But I didn't find any documentation of how to change it.

I don't think so. That makes about 3 x 10^14 addresses or about 3000 addresses per human being on this world.

Because it might provide a little bit more information of value to others interested in this subject, I'll add a link to the developer's response to @aoxfox's issue about same in the ArduinoBLE library's issue tracker: