Closed ghost closed 5 years ago
Hi, sorry I just noticed your msg now. Let me try and check since I never used Raspberry PI to check BLE data stream, I thinkl is a nice idea!
Please can you let me know if you are using the following SDK on the Raspberry Pi? https://github.com/STMicroelectronics-CentralLabs/BlueSTSDK_Python
Hi @teomaras76 ,
On Raspberry pi, I am not using any specific SDK, I am just using "gatttool" command from BlueZ. Very similar to the official ST tutorial mentioned here: http://iot.ee.ucla.edu/UCLA-STMicro/index.php/Home
Ok let me try to replicate your same environment in order to check and I will be back to you. It may take few days, please kindly wait.
Hi, I'm trying to replicate your test with two different sets in order to find where is the issue: SET 1) Raspberry PI 3B and Bluecoin evaluation board with FP-SNS-ALLMEMS1 FW package SET 2) Raspberry PI 3B and FCU001 evaluation board with official Github latest FW release I can connect successfull as you indicated in your description: pi@raspberrypi:~ $ sudo gatttool -b Board_MAC_ADDR -t random -I [EF:2F:D0:24:0D:B2][LE]> connect Attempting to connect to Board_MAC_ADDR Connection successful
Regarding next step is not very clear for me how you are proceeding.
Thanks
Hi @teomaras76 , I don't have SensorTile, however, I assume reading sensor data using Gatttool should be mostly similar in SensorTile and FCU boards. So I am following the official ST tutorial for SensorTile: https://drive.google.com/file/d/1JVyw8-XIxEEnwGrHeDo7190aznLs3eTf/view Section 3: Request Motion data using Gatttool Unfortunately, there is not such tutorial for FCU, and I hope this thread will help in that direction. By putting the printf in FCU firmware, I have found the "AccGyroMagCharHandle" to be equal to "1b". So in the next step, I want to use Gatttool to get information from this handle. In SensorTile, all we need to do is to enable the respective handle "handle #12" by issuing this command on RaspberryPi: "char-write-req 0012 0100" and the SensorTile starts streaming the data to PI. The FCU board is actually very similar, because I can see the motion data being transferred in live fashion from FCU to my Android phone. So there should be a way of getting the live motion data on raspberry pi as well, without modifying FCU firmware. So now, the questions are:
Thanks
Hi sorry for taking time. Here is the solution to your issue: correct handle for the ACCGYRMAG data is 0x001c so you need to write char-write-req 001d 0100 to see the RAW data scrolling. To check the UUID for the available characteristics you can check uuid_ble_service.h in the FW project of the FCU. I checked and it works with my RasPi, please try on your side too and let me know.
Matteo
Hi, thanks! this works. So I understand how based on uuids in uuid_ble_service.h you got to the handle 1c, However, how did you figure out handle 1d, and the fact that you have to write 100 to it?
Hi, I checked at first which UUID is associated with ACC/GYR/MAG sensor data:
After I checked which handle # is associated to this UUID using the gatttool. 100 must be written in order to enable that characteristics, 000 to disable (as in the UCLA guide). You can enable/disable in similar way using also BLE Scanner app on Android or iOS phones/tablets. I hope it's clear now.
Thanks for your help.
I am trying to read the ACC+GYRO+MAG data stream using bluez. So I connect to the FCU: pi@raspberrypi:~ $ sudo gatttool -b EF:2F:D0:24:0D:B2 -t random -I [EF:2F:D0:24:0D:B2][LE]> connect Attempting to connect to EF:2F:D0:24:0D:B2 Connection successful
I have put a printf in sensor_service.c to read the AccGyroMagCharHandle: ret = ACI_GATT_UPDATE_CHAR_VALUE(HWServW2STHandle, AccGyroMagCharHandle, 0, 2+332, buff); PRINTF("%u\n", AccGyroMagCharHandle);
From my PC serial terminal I can see successful connection, and that the handle value is 27 decimal (0x1b). However, when I try to read this handle, I always get 1 line of constant data: [EF:2F:D0:24:0D:B2][LE]> char-read-hnd 1b Characteristic value/descriptor: 10 1c 00 1b c5 d5 a5 02 00 36 ac e1 11 01 00 00 00 e0 00
I was hoping to get a stream of data, similar to sensortile as explained here: http://iot.ee.ucla.edu/UCLA-STMicro/index.php/Home
Can you please help me with the correct way of reading this data? Thanks