Understanding DeviceID()


I am using multiple (currently 3) Electrons and httpClient to post some data to my personal web server. Simple data loggers. (I do understand there may be easier free resources available for this, but I am enjoying the challenge)

I have been giving each device a name in the code before flashing, but if I increase my number of devices that becomes a little tiring.

I would like to change the deviceName that I give me devices to the deviceID(), but it got me interested in wondering how the ID is actually created and I havent been able to find any information regarding that.

If I knew how they were constructed, potentially I could shorten the deviceID’s and still keep them unique for my small number of devices.

Does anyone have this information?

It’s the 96-bit factory programmed id that is unique on each STM32 chip.

You can always do incremental integer names like 1,2,3… or save them in the EEPROM.

Thanks for the very prompt response.

Is there no link in that 96bit string?

Whether its an Electron/Core/Photon?
Manufacturing week of assembly?

Ideally I want my Electrons logging the data to be as simply coded as possible. Ie if they already have a unique identifier - then use that. On my webserver it will convert the deviceID to where the module is physically located.

I suppose I mainly want to reduce the number of bits from 96 bits which is then displayed in decimal and converted to ASCII (more than 12bytes) down to something smaller, but if I cant then I suppose thats fine.

The device IDs should be treated as a globally unique identifier. You can’t shorten them, as they are not allocated sequentially and there are no bits in common across all allocated device IDs.

You may find a number of bits in common in any group of devices, but which bits are in common is not constant across all devices.

1 Like