Forum Archive

using cb library to read out sensortag uuid

ProgrammingGo

Hi , I have a short question regarding reading out the UUID of the sensortag via peripheral.uuid using the cb library
I connected the sensortag with two different iphones and I saw that I have different uuid for the same sensortag. Why it is like this? The uuid should be the same when I connect to different Iphone, or did I understand it wrong?

ccc

Perhaps each iPhone is on-the-fly creating a UUID as the "public key" for each tag that it sees. This is easy to do with https://docs.python.org/3/library/uuid.html and it would keep the "hardware ID" of each tag out of the public data record. You would need to study up on the sensortag to see what they have for hardware IDs.

ProgrammingGo

Hi, yeah every iPhone is creating his own UUID for the sensortags. Thank you for the information.
I saw that they are several UUID types there, does it matter which I use?

ccc

Look at the UUIDs that are currently being generated and see if you can determine which type they are. You should avoid using a different type.

ProgrammingGo

@ccc Hi , I looked for that and it seems to be that randomly it will make up a device uuid. But my target is that I want a fix uuid which I can use with all types of smartphones.
See here what TI says: https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/p/277511/989118

and here : https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/t/481652

So does it mean I can choose all of the uuid types? But the difference is not clear between them?

JonB

You would just make up your ok own unique value. Don't use uuid

ProgrammingGo

@JonB , hi :). How do you mean making up my own uuid?

JonB

Just program your own characteristic, and hardcode each unit with a different value.

Alternatively, I think sensortag already has a serial number characteristic?

https://www.google.com/url?sa=t&source=web&rct=j&url=http://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/538/attr_5F00_cc2650-sensortag.html&ved=2ahUKEwjN1aTA26LgAhVjjlQKHVcMBNUQFjAAegQIAxAB&usg=AOvVaw2kmHZlvlht4o_bkdkJoS99

0x11 17 0x2803 GATT Characteristic Declaration 02:12:00:25:2A R Serial Number String

ProgrammingGo

@JonB yes you are right, the alternative is quite nice and there is this Serial number string, but when Iam reading it out it says N.A ---> not available and it seems to be the same for every sensor