NCS: Setting MAC address to static for Mesh; UUID last bytes are zeroes

1. Is it possible to set MAC address from random to static for Mesh in nRF Connect SDK? 

CONFIG_BT_PRIVACY=n and CONFIG_BT_SETTINGS=y seems does not change the behavior.

2. We have an issue with UUID, last bytes are zeroes in default configuration. Is it a bug or how to configure SDK to avoid this?

Parents Reply Children
  • Hi,

    You would have to change the code for bt_mesh_dk_prov_init() in dk_prov.c.

    In particular, you should fill the missing bytes of dev_uuid (bytes 8 through 15) before the following lines:

    	dev_uuid[6] = (dev_uuid[6] & BIT_MASK(4)) | BIT(6);
    	dev_uuid[8] = (dev_uuid[8] & BIT_MASK(6)) | BIT(7);

    Those two lines change some of the bits, for compliance with RFC-4122.

    Please note that the UUID should stay the same for the same device, so the UUID generation should be deterministic. My main suggestion would be to use the DEVICEADDR, from FICR, which is the 48 bit default Bluetooth MAC address of the SoC. The rest of the UUID consists of the device ID, which is also taken from FICR. That leaves two bytes still zero, which you can either leave zero or fill with some other fixed, read-from-persistent-memory or reproducible value.

    Regards,
    Terje

Related