Community news, upcoming events and general discussions
Threads: 28 Posts: 75
Get technical support from the community
Threads: 831 Posts: 4515
Threads: 15 Posts: 54
Tell us how to make XDK better!
Threads: 34 Posts: 112
Share and discuss community member projects
Threads: 32 Posts: 155
I'm working on a project for measurement of vibrations. For that I use the program "SendAccelerometerDataOverBle" and the smartphone app "BLE Scanner" (tried the "Alpwise BLE" before but it didn't work). Normally the sample rate in this program is 1Hz which is not sufficient for my project.
How can I change the sampling rate to 1kHz?
I have another question. I get the output in the Device Control, but don't know how to export data to an Excel File. How is this possible?
Thanks a lot for your help in advance.
Hello Marc, the frequency for sending in the example application SendAccelerometerDataOverBle can be set in the unmodified project's implementation file on line 50:
#define BLE_TX_FREQ UINT32_C(1000)
Modify this to UINT32_C(1) to set the transfer rate to 1kH. As for why the Alwipse BLE does not work, that is because the new API does not use Alpwise profiles, hence they are not recognized by the Alpwise App. BLE Scanner is a good alternative, that also lists the custom services of the XDK. As for how to export the data that is printed in the console, this is currently not possible, as there is no option for this in the Workbench. There are three ways to actually get the data. The first would be by redirecting the output manually from a terminal / command line interface (please refer to my answer in this thread for more information). The second option would be similar, but doing it with a python script, or a small application in any other preferred programming language. The third option would be to actually use an SD card and to store data on the SD card during runtime (you wouldn't have to print it to the console then, either). You may want to take a look at the demo Data Logger, available in the XDK's Demo Section In any case, it is not entirely simple, since you would have to construct the file manually. Please tell me if this was helpful, and do not hesitate to ask further questions Kind regards, Franjo
first of all thanks for your fast and detailed answer.
Unfortunately I got a problem with increasing the transfer rate.
I can change to 100ms with no problem, but if I increase further, I get some error which is called
"Failed to Enqueue BleAccelDataTransmit to Application Command Processor".
Is it possible to adjust a transfer rate of 1kHz?
Hello Marc, to explain the message
"Failed to Enqueue BleAccelDataTransmit to Application Command Processor"
I have to briefly explain the structure of how BleAccelDataTransmit is called. There is a structure called Command Processor. This basically allows to enqueue a function, which will subsequently be called internally by the Command Processor. But, this Command Processor only accepts a limited number of functions at the same time. Basically, the Application's Command Processor's queue is most likely full, which is why the error message appears in the console. This in turn means, that the functions that are already queued in the Command Processor are not worked off quickly enough. This is generally not an issue, since it is the same function over and over again, but this also means that the frequency cannot get higher. The limit for sending the BLE messages is basically somewhere at a period of 50ms with the example's implementation. I am not sure if this frequency limit can become greater by changing the code, but it would be worth a try. Please tell me if this was helpful, and do not hesitate to ask further questions. Kind regards, Franjo