0

There have been a few posts on this issue without any solutions announced.

Wanting to access internal movesense sensor data (ECG, Acc…) but without using the Android or iOS platforms ( as suggested by a movesense presentation https://www.movesense.com/wp-content/uploads/2018/11/2018-11-06-Using-Movesense-CustomGATTService.pdf ), I have failed to do so for at least 1 week. I can successfully create my own GATT characteristics and subscribe to them from outside the movesense device. This is easily done by augmenting the samples/custom_gattsvc_app with a few lines :

  1. Definition :
    const uint16_t myCharUUID16 = 0x2A58; // this new characteristic will appear in the service as the third one in the sample
  1. In CustomGATTSvcClient::configGattSvc() :
    WB_RES::GattProperty myCharProp = WB_RES::GattProperty::INDICATE;

    myChar.props = wb::MakeArray<WB_RES::GattProperty>( &myCharProp, 1);
    myChar.uuid = wb::MakeArray<uint8_t>( reinterpret_cast<const uint8_t*>(&myCharUUID16), 2);

    customGattSvc.chars = wb::MakeArray<WB_RES::GattChar>(characteristics, 3);  // 3 here since there are 3 characteristics now
  1. Accessing You can now see and subscribe with a BTLE client (bluetility…) to the new service even if it does not do anything for now.

The problems start here for me :

In CustomGATTSvcClient::onGetResult() I try to force a subscription to ECG or Acc since onGetResult() is called by CustomGATTSvcClient::onPostResult() once all the BT services are created :

int32_t sampleRate = 10;
asyncSubscribe(WB_RES::LOCAL::MEAS_ACC_SAMPLERATE(),AsyncRequestOptions::Empty, sampleRate);

I do not implement onSubscribeResult()

In onNotify() you should be able to intercept the call from the whiteboard with the new data every 1/10 second by

switch (resourceId.getConstId())     {     
case WB_RES::LOCAL::MEAS_ACC_SAMPLERATE::ID:     
{
    // To see a blinking LED on each new Acc data
    asyncPut(WB_RES::LOCAL::COMPONENT_LED(),AsyncRequestOptions::Empty, myFlippingBool);

    myFlippingBool = ! myFlippingBool;

}

What I have observed :

A. When I asyncSubscribe() the ECG or Acc, the sample’s WB_RES::LOCAL::MEAS_TEMP::LID is no longer called and no updates are dispatched to a BT client even after a successful subscription to the 0x2A1C characteristic. This means that all Notifications are disabled by a resource conflict ?

B. When subscribing ( as before ) or even by :

wb::Result result = getResource("Meas/Acc/10", mMyAccResourceId);
result = asyncSubscribe(mMyAccResourceId);

The onNotify() method is never called as the LED does not blink ( even directly after onNotify() implementation without the switch / case )

There is a lack of documentation on CustomGatt and it seems it blocks many people in integrating the sensor on other platforms ( Raspberry Pi or generic processors running a BT stack ). I have tried before to access the movesense platform with direct AT commands from a rudimentary microcontroller and a BT module without success (Movesense direct access to GATT endpoints ), so now I’m turning to a Raspberry solution + Qt without success.

Thank you for any example or answers to this question !

BillyFS2
  • 11
  • 4

1 Answers1

1

At least 10 Hz is not supported. What happens with Meas\Acc\13 ?

  • Thank you Jussi ! I didn't check the /Info to receive the allowed sampling speed. This is the same for the ECG Characteristic (125 / 128...). Anything else in these parameters is not allowed. I can now use the ECG and Acc functions in a CustomGATT service. – BillyFS2 Aug 19 '19 at 15:53
  • I also changed WB_RES::GattProperty measCharProp = WB_RES::GattProperty::NOTIFY; // INDICATE is slower; And used buffer size of 155 and notification every 10 ms – Jussi Virkkala Aug 20 '19 at 03:36