C++ Qt very slow

Hi everyone, i'm using the C++ library with QT. I still have some problem in the integration since i needed to remove "delete new_task" [threadpool.cpp line 38] line for working but this is maybe my problem. After that anyway the setup takes about 10 seconds, saying that the initialization is OK, and after 10 seconds that is not. Anyway i tried to use some of the features such as led, battery reading and sensor fusion streaming. The problem i have is that the process is very slow... The data i see respond 2 to 3 seconds later than the device movement. Is anyone experiencing that? Is the initialization not correct?I've used the same application with another sensor and streamed data at more than 60 hertz.
I've tried both android and Mac OS.
Ivan C. 

Attached a log 


p, li { white-space: pre-wrap; }



p, li { white-space: pre-wrap; }

Connecting to: "{b23a9bc3-418c-4a92-af36-53e4220e1377}"

created and connection done energy

Connected, Discovering Serivices

Service "{0000180a-0000-1000-8000-00805f9b34fb}"

Service "{0000180f-0000-1000-8000-00805f9b34fb}"

Service "{326a9000-85cb-9195-d9dd-464cfbbae75a}"

creating metaware service "{0000180a-0000-1000-8000-00805f9b34fb}"

DISCOVERED SERVICE... "{0000180a-0000-1000-8000-00805f9b34fb}"

creating metaware service "{326a9000-85cb-9195-d9dd-464cfbbae75a}"

DISCOVERED SERVICE... "{326a9000-85cb-9195-d9dd-464cfbbae75a}"

DISCOVERED SERVICE... "{326a9000-85cb-9195-d9dd-464cfbbae75a}"

DISCOVERED SERVICE... "{0000180a-0000-1000-8000-00805f9b34fb}"

Connected to MetaWare!

INITIALIZING....

MetaWear Created

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

board initialized

OKKKKKK

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Success Writing Characteristic: "{326a9001-85cb-9195-d9dd-464cfbbae75a}"

Error initializing board: 0

Comments

  • It looks like whatever Bluetooth stack you are using is either not well implemented or not properly configured for low latency communication.  You can try lowering the max connection interval to 7.5ms upon connection.
  • edited December 2016
    It was in fact that, thanks, now the rate is much higher ... about 100 Hz, nevertheless i still experience a sort of delay from the movement to the response...  looking better it looks like when i move rapidly the device the stream is interrupted for a while and then it restarts giving a exponetial like behaviour.
  • Can you quantify this "delay" you are seeing?  For example, what are the relative time offsets between consecutive data points?  Also, what does a graph on say and Android or iOS device look like when the same motion is applied?

    The graph does not provide any conclusive evidence as I have no idea what the graph is supposed to represent.  If you are graph is simply values vs. index, then when data n and n+1 arrive does not matter as the x-axis does not account for time.
  • Hi hello, thanks for comments, and sorry for the missing axis...  the instants when the graph start changing is an abrupt rotation of ninety degree in one axis. The delay is about 80 points which correspond to about 1 second. I mean the response in terms of "something happens" is immediate but the correct value arrives after about 1 second. The android app downloaded from the store is much more responsive, maybe i'm missing some setting on the sensor. Thanks for help anyway. I. 

  • You can try further tweaking the connection parameters, such as slave latency, however this all boils down to QT's Bluetooth stack.  If your device can run Windows 10, it would be interesting to see if the UWP Bluetooth stack also has the same responsiveness issues you are seeing.
  • Uhm, i'll try, although i've already used the QT bt stack and streamed with another sensor at more that 60Hz. Let's see if i can solve this. Thanks anyway!
  • Ok, solved, apparently setting ACC range to 8G crates the delay, setting it to 4G or 2G is working smoothly.
    Maybe useful info for others.
    Thanks a lot. 

This discussion has been closed.