Page 1 of 1

How to uniquely identify SensorTags

Posted: 00:52, 28 Apr 2016
by TaniaMac
Hi

I am developing an app that connects to two SensorTags and am now looking for a way to know and control which of the SensorTags is connected (rather than first the nearest device, and then the second one). Is there a way to read the Unique IDs for each SensorTag (like the UUID when connecting to the TI SensorTag App) to determine which is connected? Or to specify a unique ID and connect only to that SensorTag?

... I have worked on this further and see that the SensorTag app displays the "System ID" which seems unique to each SensorTag. It is available in the Device Information Service as far as I can see. I have tried to read from this but keep getting errors

Code: Select all

   instance.SYSTEM_ID = '00002a23-0000-1000-8000-00805f9b34fb'
...
   instance.device.readServiceCharacteristic(
      instance.DEVICEINFO_SERVICE,
      instance.SYSTEM_ID,
      function(data)
      {
              console.log('BLE readServiceCharacteristic error: ' + evothings.ble.fromUtf8(data));
      },
      function(errorCode)
      {
            console.log('BLE readServiceCharacteristic error: ' + errorCode);
      })



I get the following error:

Code: Select all

 LOG: Error in Success callbackId: BLE177953074 : URIError: URI error
LOG: [ERR] URIError: URI error [hyper/4ddea4ba-dbc2-4286-a12f-ba9740f727bb/ad64a6c5-587c-4575-a256-6e13b06b7839/cordova.js: 314]


This code works for any of the other Device Info characteristics (Manufacturer name, software revision etc).

Any help understanding why the System ID is not available, or how to get is appreciated.

Thanks in advance

Thanks in advance

Re: How to uniquely identify SensorTags

Posted: 04:22, 03 May 2016
by TaniaMac
For anyone looking - the solution was in the format of the data recieved. Converting the data using fromUtf8 failes. Instead, the solution was to convert to Uint8Array and manipulate the data from there (converting each byte to a hex string).

Re: How to uniquely identify SensorTags

Posted: 13:43, 16 May 2016
by alex
There you go, thanks for getting back to share!

best

Alex