Xdk BLE problem read data
Risposta
09/07/19 12.16
Hi Community,

 

I have to develop a Java application that run inside Eclipse Kura [1] that retrieves sensor data from the XDK. The XDK is setup with the XDK Virtual Demo firmware and I’m trying to connect to the device through BLE and retrieve the sensor values using the services and characteristics UUIDs presented in [2].

 

So, I write 0x01 on the UUID Start Sensor Sampling and Notifications and get notifications for High and Low Prioroity Array. What I receive is as follows:

 

Notification handle = 0x0034 value: 3c d4 7f 3f 76 11 00 3c 0b fc 62 3c f3 bb 06 3d 00 00 00 00 

Notification handle = 0x0036 value: 02 e7 ff f6 ff c5 ff f7 17 02 00 00 00 00 00 00 00 00 00 00 

Notification handle = 0x0034 value: 3c d4 7f 3f 76 11 00 3c 0b fc 62 3c f3 bb 06 3d 00 00 00 00 

Notification handle = 0x0036 value: 01 60 ab 03 00 a5 a8 7f 01 00 09 73 00 00 28 00 00 00 00 00 

 

I can read the Low Priority Array (0x0036), but the High Priority Array (0x0034) is wrong. The right data are:

 

Notification handle = 0x0034 value: 13 00 0d 00 fb 03 c2 ff 46 00 e2 ff 00 00 00 00 00 00 00 00 

Notification handle = 0x0036 value: 02 ea ff f6 ff c5 ff 0e 18 02 00 00 00 00 00 00 00 00 00 00

Notification handle = 0x0034 value: 15 00 0b 00 01 04 0e 00 e2 ff f2 ff 00 00 00 00 00 00 00 00 

Notification handle = 0x0036 value: 01 a0 b6 03 00 a5 a8 7f 01 00 d0 70 00 00 28 00 00 00 00 00 

 

As you can see, the data for the accelerometer and the gyroscope are different (I retrieve the latter set of values connecting to the device with the smartphone app). 

Bad data: 3c d4 7f 3f 76 11 00 3c 0b fc 62 3c f3 bb 06 3d 00 00 00 00

Good data: 13 00 0d 00 fb 03 c2 ff 46 00 e2 ff 00 00 00 00 00 00 00 00 

 

How should I interpret them? Why I don't get the same values? Is there any initialization messages that my application has to send to the XDK to correctly configure it before read data?

 

Thank you in advance.

 

[1] https://www.eclipse.org/kura/

[2] http://xdk.bosch-connectivity.com/xdk_docs/html/_x_d_k__v_i_r_t_u_a_l__x_d_k__a_p_p__u_s_e_r__g_u_i_d_e.html

0 (0 Voti)
RE: Xdk BLE problem read data
Risposta
10/07/19 14.20 come risposta a Pasquale Naclerio.

Hi comunity 

I solved the problem, the documentation is not complete. Control XDK Service is missing on Characteristic: 55b741d5-7ada-11e4-82f8-0800200c9a66.

This Characteristic is used to enable or disable the Rotations Quaternions. 

if you write 0x00 then enable Accelemoter and Gyroscope, else you write 0x01 then enable Rotaton Quaternions. 

You will recive High Priority Array, if enable Accelemoter and Gyroscope then the interpretation of the data is written on the documentation.

Bat if enable Rotation Quaternions  then the interpretation of the data is:

Bytes Data Attribute -Type
0, 1, 2, & 3

Rotation Quaternion M

float
3, 4, 5 & 6 Rotation Quaternion X float
7, 8, 9 & 10 Rotation Quaternion Y float
11, 12, 13 & 14 Rotation Quaternion Z float

 

Thanks and I hope I was helpful

Pasquale Naclerio

0 (0 Voti)