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.

TIDC-CC2650STK-SENSORTAG: No data from MPU9250

Part Number: TIDC-CC2650STK-SENSORTAG
Other Parts Discussed in Thread: CC2650STK, CC2650, CC2540

Hi guys,

I'm running the SensorTag application from BLE SDK 2.1.1 on a CC2650 SensorTag board (CC2650STK). I'm using the onboard MPU9250 to advertise data to a custom Android app. I am successfully receiving this data using the SensorTag app provided by TI but for some reason I am receiving NULL data in my own custom app.

The data is advertised in the following callback in the SensorTag application:

void SensorTagMov_processSensorEvent(){

   ...

   // Send data

  Movement_setParameter(SENSOR_DATA, SENSOR_DATA_LEN, sensorData);

  ...

}

I can see that this callback is triggered when I select a characteristic in the SensorTag app but not in my own custom app. Furthermore, a toast message appears on my custom app displaying the message "GATT Error code: null"

Can anyone help me with this?

Cheers,

Tony

  • It seems like you have problem implementing the custom app. We do have android example code for you to take a look at.
    git.ti.com/sensortag-android
    Hope this helps.
  • Hi Christin,

    Thank you for the resource.

    The only difference I can see at the moment between my custom app and the example code is that I am using a string variable to store the received data:

    String data = intent.getStringExtra(BluetoothLeService.EXTRA_DATA);

    In the example code a byte array is used:

    byte[] value = intent.getByteArrayExtra(BluetoothLeService.EXTRA_DATA);

    I've tried swicthing from a string variable to a byte array but am still getting null data.

    Is there anything else I should check?

    Tony
  • Can you attach sniffer log? Are you sure the service discovery is done as sensortag app?
  • My Android app successfully connects to CC2650 SensorTag and discovers its services:

    The service I am interested in is "Movement Service". When I select the "Movement Data" characteristic from the list, the broadcast is successfully received by my Android app but the data array contains zero values when it should in fact be filled:

    I don't understand what you mean by log sniffer. Please clarify.

    Tony

  • Sniffer is a tool that can track packets over the air. You can use CC2540 dongle programmed with packet sniffer or even a high end product from frontline/Ellysis.
  • Hi Christin,

    I've taken a different approach to try and solve this problem:

    I've created a new service with a single characteristic. I have set the UUID for the service and characteristic as follows:

    #define JYRODATA_SERV_UUID   0x1850

    #define TEST_DATA_UUID              0x2A6D

    I am advertising a simple data string that contains the characters "Hello BLE".

    I'm using an Android app called "nRF Connect" to receive this data string as this app simply listens for any data and displays it with its associated service/characteristic UUID.

    I am successfully receiving this data string with the correct service UUID as shown in the green circle below, but for some reason the characteristic UUID is not the same as the UUID I have set in the firmware as shown in the red circle:

    Does this "0002FFE1-FFE0-0000-E394-000000022A6C" UUID mean anything to you? I have no idea where it is coming from.

    Tony