What is the best way to go about mass programming a fleet of beacons all with unique UUIDs? Do you really have to program them one by one?
What is the best way to go about mass programming a fleet of beacons all with unique UUIDs? Do you really have to program them one by one?
If you want to have UUIDs really unique then yes. Alternatively you could hard-code some UUID "base" into the FW and the rest take from S/N stored in FICR area (which isn't guaranteed t be 100% unique but it's randomly generated 8-byte string and so far no one has spotted any collisions;) You can either place that string into part of 128-bit UUID directly or do some hashing/concealing before...
I'm sorry. Same UUID, but unique major/minor, although I think this answer still answers my question.
I was surprised by different UUID, that wouldn't work with GATT Clients much;) If you are fine to have major minor random then either generate them on first boot (in large sample of hundreds of thousands of beacons you should arrive to pretty much equal distro;) or steal few bytes from that FICR S/N...
If you don't want to hard code anything, there are the Factory Information Configuration Registers. One of those registers store a Device Address randomly generated during the manufacturing process.
You can access that via NRF_FICR->DEVICEADDR[0]
and NRF_FICR->DEVICEADDR[1]
.
You can read more about this Device Address here: devzone.nordicsemi.com/.../
There is also a Device ID stored in those registers, as discussed in this question. devzone.nordicsemi.com/.../
Here is a code snippet of how I use the Device Address registers in my code for unique ID.
scanrsp_manuf_data[2] = NRF_FICR->DEVICEADDR[0] & 0x000000FF;
scanrsp_manuf_data[3] = (NRF_FICR->DEVICEADDR[0] >> 8) & 0x000000FF;
scanrsp_manuf_data[4] = (NRF_FICR->DEVICEADDR[0] >> 16) & 0x000000FF;
scanrsp_manuf_data[5] = (NRF_FICR->DEVICEADDR[0] >> 24) & 0x000000FF;
scanrsp_manuf_data[6] = NRF_FICR->DEVICEADDR[1] & 0x000000FF;
scanrsp_manuf_data[7] = ((NRF_FICR->DEVICEADDR[1] | 0x0000C000) >> 8) & 0x000000FF;
(always good to hear the same twice;)