This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Services with non-Listed UUID in SensorTag cc2560

Other Parts Discussed in Thread: CC2560, CC2650, CC2650STK

Hello,

I am following this pdf: processors.wiki.ti.com/.../File:BLE_SensorTag_GATT_Server.pdf

to create an app for android that communicates with Sensor Tag cc2560. My sensor tag is running the CC2650 SensorTag image. 

However, when I use the "discoverServices" function, some UUIDs returned aren't listed in the pdf, such as "aa64" and "aa70". In addition, I can't find the "Accelerometer Service", that has UUID "aa10". 

Is there something wrong with my sensor tag? Or, is this .pdf with wrong values for UUIDs? 

Thanks,

Pedro

  • Hi Pedro,

    The pdf is probably for the older SensorTag(CC254x). One way to know is that the Device Name should be SensorTag 2.0 for CC2650STK.

    There are additional sensors as well on the CC26xx, will check if there is an updated pdf. You can also discover the characteristics by using other devices.

  • Hi Zahid,
    thanks for your reply. Could you pass me a link to the UUID information of the Sensor Tag 2.0? Couldn't find it.

    Thank you
  • Hi Pedro,

    We don't have this yet, but you can do this yourself, if you connect through Device Monitor you will have the interactive version (including all descriptions). You will just need a CC254x or CC26xx running HostTest project connected to the PC to use with the Device Monitor tool or BTOOL(a similar PC Tool).

  • Hi Zahid,
    Do you know when this document will be released? I already bought the debugger, but it's going to take at least 2 weeks to arrive here, so, no chances of using the method you suggest until then.
    Thank you,

    Pedro
  • Hello. The document (as well as much more sensor tag documentation) should be available on April 8th. In the meantime, I've attached a screenshot of the attribute table here. It looks like Device Monitor doesn't recognize two of the services but these (as well as the other UUID's) can be found in the code.

    From movementservice.h:

    // Service UUID
    #define MOVEMENT_SERV_UUID             0xAA80
    #define MOVEMENT_DATA_UUID             0xAA81
    #define MOVEMENT_CONF_UUID             0xAA82
    #define MOVEMENT_PERI_UUID             0xAA83

    From registerservice.h:

    // Service UUID
    #define REGISTER_SERV_UUID             0xAC00
    #define REGISTER_DATA_UUID             0xAC01
    #define REGISTER_ADDR_UUID             0xAC02
    #define REGISTER_DEV_UUID              0xAC03

  •  I forgot the screenshot...

  • Hi Tim, thank you for your answer! You helped me a lot!

  • Just checking... Is the documentation already available?
  • Hello Pedro. Unfortunately, the go live-date of the webpage has been pushed back to May 12th. In the meantime, please continue asking questions here and we will do our best to answer them.
  • Ok, I'm looking forward to get this documentation. Meanwhile I was testing the senorTag again with the "BLE Device Monitor" for Android. I can access the "OAD Service", as well as write and enable notifications from he "OAD Image Identify" characteristic. However, when I write anything to it (1 or 0 or any other value), a get a "FF:FF:FF:FF:FF:FF:FF:FF" notification. I don't believe it's the correct behavior. What should I write to get the corretct Image information from the Sensor Tag? Or is this app not capable of performing this function yet? Thank you.

    Pedro
  • Tim,

    Can you do a screenshot of a completed value list of CC2650STK? It seems like it is missing some sensors. Thank you!

    Tony
  • Hi Tony,

    Somo of the UUIDs of the sensors can be found in the .h files in

    [folder where you installed simplelink]\ti\simplelink\ble_cc26xx_2_00_00_42893\Projects\ble\Profiles\SensorProfile\CC26xx.

    There'll be one .h file for each sensor, containing its service UUID and its characteristics UUIDs.

    Hope I could be of any help.

    Pedro

  • Hello all. The sensor tag website is up: www.ti.com/.../sensortag2015;HQS=sensortag

    You can find the attribute tables under the "Teardown" tab at the bottom of the page.
  • Hi Tim, thank you for the update.

    Was the android source code in "Github" also updated? The code in GitHub describes the sensor's UUIDs differently from the table in the new sensor tag website: In the code, the movement sensors are in differente services, while in the new sensor tag they seem to be put together in one single service. Therefore, I am having some trouble enabling the movement sensors in the new sensor tag.
    Doing some tests, I discovered that a 2-byte data must be written to the " Movement Config Characteristic", otherwise I get a "Status = 13". But I cound't figure out what write exactly, I tested the common "01:00", but no success.
    How can I enable the movement sensors (At least the accelermeter)?

    Thank you,

    Pedro
  • You probably found the info on the Teardown section of the page Tim referenced above.

    0x3c is the handle for the Movement Config data.  I did an initial read from this handle and got "00 02", then I started playing and found:

    01 02 - enables gyro-z only

    02 02 - enables gyro-y only

    03 02 - enables gyro-z and gyro-y, etc, etc

    7F 02 - is what I eventually used to get all of them enabled.

    I still feel that the info on the page is incomplete though.  The info for handle 0x39(Movement Data) only defines 12 bytes, yet I get back 18 bytes.  The ones in bold are undefined in the web page (I believe.)

    Using gatttool I am seeing:

    handle = 0x0039 value: bf ff 6a 00 f0 ff 64 00 f0 ff 81 ef 92 fd 26 ff b4 fa

    Can anyone comment on this?

  • Maybe I misunderstood the functioning of the movement Sensor. In 2540 Keyfob, the accelerometer sends a notification whenecer it detects a movement. Does this movement sensor works this way too? Or do I have to keep reading its data continuously?
  • I've just ran some tests here. Using "byte {0x7f, 0x02}" I could enable all sensors in the movement. I have indeed to keep reading the sensor data instead of waiting for notifications as I expected before.

    I beliefe the last 6 bytes of data are from the compass, following the same logic of LSB and MSB of the gyro and acc data, this way we get 6 bytes for each sensor.

    Share if you discover anything else, please!

    Thank you
  • How are you able to decode the byte data to accelerometer data in some readable format.
    I'm doing something like this to get the data "int x = ((value[0] << 8) + value[1]) / 4096;"
    Can anyone please comment on this?

    Thanks
  • How are you able to decode the byte data to accelerometer data in some readable format.

    I'm doing something like this to get the data 

    int x = (value[0] << 8) + value[1];
    x /= 4096;

    Can anyone please comment on this?

    Thanks

  • I am developing an Android application, so I use the StringBuilder class in Java do get the data in HEX format.

  • I'm also developing an android application, but what i meant was how to convert data from bytecode to sensible data?
    Since the android source code provided is outdated.
    Thanks
  • Hi guys!

    Please, does anyone know whether the android source code had been updated or not?

    I have the same issues regarding the motion sensor set up and reading. =/

    Best Regards,

  • in iOS you can do that:

    let MovementServiceUUID = CBUUID(string: "F000AA80-0451-4000-B000-000000000000")

    let MovementDataUUID = CBUUID(string: "F000AA81-0451-4000-B000-000000000000")
    let MovementConfigUUID = CBUUID(string: "F000AA82-0451-4000-B000-000000000000")
    let MovementPeriodUUID = CBUUID(string: "F000AA83-0451-4000-B000-000000000000")

    to hability the services you have to:

    func peripheral(peripheral: CBPeripheral!, didDiscoverCharacteristicsForService service: CBService!, error: NSError!) {
    var enableValue = 1

    let enablyBytes = NSData(bytes: &enableValue, length: sizeof(UInt8))
    for charateristic in service.characteristics {
    let thisCharacteristic = charateristic as! CBCharacteristic
    println(" caracteristica: - \(charateristic.UUID)")
    if SensorTag.validDataCharacteristic(thisCharacteristic) {
    // Enable Sensor Notification
    self.peripheralSelected.setNotifyValue(true, forCharacteristic: thisCharacteristic)
    }

    if SensorTag.validConfigCharacteristic(thisCharacteristic) {
    // Enable Sensor
    if (thisCharacteristic.UUID == MovementConfigUUID){
    var endMarker = NSData(bytes: [0x7F, 0x02] as [UInt8], length: 2)
    self.peripheralSelected.writeValue(endMarker, forCharacteristic: thisCharacteristic, type: CBCharacteristicWriteType.WithResponse)
    }else{
    self.peripheralSelected.writeValue(enablyBytes, forCharacteristic: thisCharacteristic, type: CBCharacteristicWriteType.WithResponse)
    }
    }
    if thisCharacteristic.UUID == MovementPeriodUUID {
    let period = NSData(bytes: [0xA], length: sizeof(UInt8))
    self.peripheralSelected.writeValue(period, forCharacteristic: thisCharacteristic, type: CBCharacteristicWriteType.WithResponse)
    }
    }


    // Get data values when they are updated
    func peripheral(peripheral: CBPeripheral!, didUpdateValueForCharacteristic characteristic: CBCharacteristic!, error: NSError!) {

    if peripheral == nil || characteristic == nil {return}

    if characteristic.UUID == MovementDataUUID {
    let allValues = getMovementData(characteristic.value)

    self.gyroscopeX = allValues[0]
    self.gyroscopeY = allValues[1]
    self.gyroscopeZ = allValues[2]

    self.accelerometerX = allValues[3]
    self.accelerometerY = allValues[4]
    self.accelerometerZ = allValues[5]

    self.lblGirosValue.text = "X: \(self.gyroscopeX), Y: \(self.gyroscopeY), Z:\(self.gyroscopeZ)"

    self.lblAceleracaoValue.text = "X: \(self.accelerometerX), Y: \(self.accelerometerY), Z:\(self.accelerometerZ)"
    }
    }

    // Get Movement values
    class func getMovementData(value: NSData) -> [Double] {
    let dataFromSensor = dataToSignedBytes16(value)

    var gyroXVal = Double(dataFromSensor[0]) * (500.0 / 65536.0)
    var gyroYVal = Double(dataFromSensor[1]) * (500.0 / 65536.0) * -1
    var gyroZVal = Double(dataFromSensor[2]) * (500.0 / 65536.0)

    let accXVal = Double(dataFromSensor[3]) / 4096.0
    let accYVal = Double(dataFromSensor[4]) / 4096.0
    let accZVal = Double(dataFromSensor[5]) / 4096.0

    //Ficar printando os valores!!! Usar random para nao parar?
    return [gyroXVal, gyroYVal, gyroZVal, accXVal, accYVal, accZVal]
    }
  • Thank you for your repply Felipe!

    I've got  it working on android last week. =)

    "//ficar pintando os valores!!"  haha! Nice to know that other Brazilians are working with the SensorTag, 

    Please, add me on linkedin (if you are there so), and we can talk more about applications with it =)

    br.linkedin.com/.../958

    Best Regards!