Monitoring FTMS characteristics failed

Hi, i'm new in webos ,
I tried to retrieve data from my indoor bike using com.webos.service.bluetooth2 . I'm already connected to it using gatt/connect and this is the data i get from gatt/getServices

{"adapterAddress":"18:58:80:9b:37:07","returnValue":true,"address":"1c:36:39:33:3b:12","services":[{"includes":[],"characteristics":[{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":true,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002a00-0000-1000-8000-00805f9b34fb","instanceId":"003","permissions":{},"value":{"bytes":[]},"descriptors":[]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":true,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002a01-0000-1000-8000-00805f9b34fb","instanceId":"005","permissions":{},"value":{"bytes":[]},"descriptors":[]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002a04-0000-1000-8000-00805f9b34fb","instanceId":"007","permissions":{},"value":{"bytes":[]},"descriptors":[]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002ac9-0000-1000-8000-00805f9b34fb","instanceId":"009","permissions":{},"value":{"bytes":[]},"descriptors":[]}],"service":"00001800-0000-1000-8000-00805f9b34fb","type":"primary"},{"includes":[],"characteristics":[{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":true},"characteristic":"00002a05-0000-1000-8000-00805f9b34fb","instanceId":"012","permissions":{},"value":{"bytes":[]},"descriptors":[{"instanceId":"013","descriptor":"00002902-0000-1000-8000-00805f9b34fb","permissions":{},"value":{"bytes":[]}}]}],"service":"00001801-0000-1000-8000-00805f9b34fb","type":"primary"},{"includes":[],"characteristics":[{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002a29-0000-1000-8000-00805f9b34fb","instanceId":"016","permissions":{},"value":{"bytes":[]},"descriptors":[]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002a24-0000-1000-8000-00805f9b34fb","instanceId":"018","permissions":{},"value":{"bytes":[]},"descriptors":[]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002a25-0000-1000-8000-00805f9b34fb","instanceId":"020","permissions":{},"value":{"bytes":[]},"descriptors":[]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002a27-0000-1000-8000-00805f9b34fb","instanceId":"022","permissions":{},"value":{"bytes":[]},"descriptors":[]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002a26-0000-1000-8000-00805f9b34fb","instanceId":"024","permissions":{},"value":{"bytes":[]},"descriptors":[]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002a28-0000-1000-8000-00805f9b34fb","instanceId":"026","permissions":{},"value":{"bytes":[]},"descriptors":[]}],"service":"0000180a-0000-1000-8000-00805f9b34fb","type":"primary"},{"includes":[],"characteristics":[{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":false,"notify":true,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002a37-0000-1000-8000-00805f9b34fb","instanceId":"029","permissions":{},"value":{"bytes":[]},"descriptors":[{"instanceId":"030","descriptor":"00002902-0000-1000-8000-00805f9b34fb","permissions":{},"value":{"bytes":[]}}]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002a38-0000-1000-8000-00805f9b34fb","instanceId":"032","permissions":{},"value":{"bytes":[]},"descriptors":[]}],"service":"0000180d-0000-1000-8000-00805f9b34fb","type":"primary"},{"includes":[],"characteristics":[{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002acc-0000-1000-8000-00805f9b34fb","instanceId":"035","permissions":{},"value":{"bytes":[]},"descriptors":[]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":false,"notify":true,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002ad2-0000-1000-8000-00805f9b34fb","instanceId":"037","permissions":{},"value":{"bytes":[]},"descriptors":[{"instanceId":"038","descriptor":"00002902-0000-1000-8000-00805f9b34fb","permissions":{},"value":{"bytes":[]}}]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":true,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002ad3-0000-1000-8000-00805f9b34fb","instanceId":"040","permissions":{},"value":{"bytes":[]},"descriptors":[{"instanceId":"041","descriptor":"00002902-0000-1000-8000-00805f9b34fb","permissions":{},"value":{"bytes":[]}}]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002ad6-0000-1000-8000-00805f9b34fb","instanceId":"043","permissions":{},"value":{"bytes":[]},"descriptors":[]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002ad8-0000-1000-8000-00805f9b34fb","instanceId":"045","permissions":{},"value":{"bytes":[]},"descriptors":[]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":true,"read":false,"notify":false,"broadcast":false,"writeWithoutResponse":true,"indicate":true},"characteristic":"00002ad9-0000-1000-8000-00805f9b34fb","instanceId":"047","permissions":{},"value":{"bytes":[]},"descriptors":[{"instanceId":"048","descriptor":"00002902-0000-1000-8000-00805f9b34fb","permissions":{},"value":{"bytes":[]}}]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":false,"notify":true,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"00002ada-0000-1000-8000-00805f9b34fb","instanceId":"050","permissions":{},"value":{"bytes":[]},"descriptors":[{"instanceId":"051","descriptor":"00002902-0000-1000-8000-00805f9b34fb","permissions":{},"value":{"bytes":[]}}]}],"service":"00001826-0000-1000-8000-00805f9b34fb","type":"primary"},{"includes":[],"characteristics":[{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":true,"read":false,"notify":false,"broadcast":false,"writeWithoutResponse":true,"indicate":false},"characteristic":"49535343-8841-43f4-a8d4-ecbe34729bb3","instanceId":"054","permissions":{},"value":{"bytes":[]},"descriptors":[]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":false,"notify":true,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"49535343-1e4d-4bd9-ba61-23c647249616","instanceId":"056","permissions":{},"value":{"bytes":[]},"descriptors":[{"instanceId":"057","descriptor":"00002902-0000-1000-8000-00805f9b34fb","permissions":{},"value":{"bytes":[]}}]}],"service":"49535343-fe7d-4ae5-8fa9-9fafd205e455","type":"primary"},{"includes":[],"characteristics":[{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"02f00000-0000-0000-0000-00000000ff03","instanceId":"060","permissions":{},"value":{"bytes":[]},"descriptors":[]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":true,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"02f00000-0000-0000-0000-00000000ff02","instanceId":"062","permissions":{},"value":{"bytes":[]},"descriptors":[{"instanceId":"064","descriptor":"00002901-0000-1000-8000-00805f9b34fb","permissions":{},"value":{"bytes":[]}},{"instanceId":"063","descriptor":"00002902-0000-1000-8000-00805f9b34fb","permissions":{},"value":{"bytes":[]}}]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":false,"read":true,"notify":false,"broadcast":false,"writeWithoutResponse":false,"indicate":false},"characteristic":"02f00000-0000-0000-0000-00000000ff00","instanceId":"066","permissions":{},"value":{"bytes":[]},"descriptors":[]},{"properties":{"authenticatedSignedWrites":false,"extendedProperties":false,"write":true,"read":false,"notify":false,"broadcast":false,"writeWithoutResponse":true,"indicate":false},"characteristic":"02f00000-0000-0000-0000-00000000ff01","instanceId":"068","permissions":{},"value":{"bytes":[]},"descriptors":[]}],"service":"02f00000-0000-0000-0000-00000000fe00","type":"primary"}]}

then i used gatt/monitorCharacteristics with parameters below

parameters: {
    clientId,
    subscribe: true,
    service: "00001826-0000-1000-8000-00805f9b34fb",
    characteristics: ["00002ad2-0000-1000-8000-00805f9b34fb"]
 },

then i got error GATT monitor characteristic failed for characteristic: 00002ad2-0000-1000-8000-00805f9b34fb

Is there any process i need to do to make the monitoring succeed before i tried to monitor?

Hi @Necrometal, welcome to the forum.

Could you check the 'Generic Attribute Profile (GATT)' in the following guide.

If you suffer the same problem, please let me know the whole steps you've done.

I also share the steps that dev. team was done.

luna commands to verify the gatt services:

  1. prepare 2 WebOS support devices

  2. test device support S/W(gatt profile, le) and H/W(BT dongle etc)

  3. power on (server, 1st test device)

    luna-send -f -n 1 palm://com.webos.service.bluetooth2/adapter/setState '{"powered":true}'
    
  4. set device name (server)

    luna-send -f -n 1 palm://com.webos.service.bluetooth2/adapter/setState '{"name": "test_device_conn_01"}'
    
  5. openServer (server)

    luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/openServer '{}'
    
    {
    
      "adapterAddress": "00:00:9a:1d:89:5d",
      "serverId":"001",
      "returnValue": true
    }
    
  6. addservice (server): "serverId" must set same as gatt/openServer result

     luna-send -f -n 1 luna://com.webos.service.bluetooth2/gatt/addService '{"serverId":"001", "service":"0000feb8-0000-1000-8000-00805f9b34fb","type":"primary","includes":[], "characteristics":[{"characteristic":"00002ab7-0000-1000-8000-00805f9b34fb","properties":{"broadcast":false,"read":true,"indicate":true,"write":true,"notify":true},"permissions":{"read":true,"write":true}, "value":{"bytes":[]},"descriptors":[{"descriptor":"00002ab7-0000-1000-8000-00805f9b34fb","value":{"bytes":[0]}}]}]}'
    
  7. startAdvertising (server)

     luna-send -i -f luna://com.webos.service.bluetooth2/le/startAdvertising '{"subscribe":true,"advertiseData":{"manufacturerData":[11,22,33,44],"proprietaryData":[{"type":27,"data":[55,66,77,88]}],"includeTxPower":true,"services":[{"uuid":"FEB8","data":[7,8,9,0]}],"includeName":false},"scanResponse":{"includeName":true}}'
    
  8. power on (client,2nd test device, in client ssh)

     luna-send -f -n 1 palm://com.webos.service.bluetooth2/adapter/setState '{"powered":true}'
    
  9. StartDiscovery for discover devices (client)

     luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/startDiscovery {}
    
  10. find server (client)

Note : some times shorted name added to the advertise data/ scan response data (eg: test_devic) due to changes made in the bluez5 stack as per BLUETOOTH CORE SPECIFICATION Version 5.3

so provide shorter name in grep (e.g.: grep "test_devic" -A 20)

 luna-send -n 1 -f luna://com.webos.service.bluetooth2/device/getStatus {} | grep "test_device_conn_01" -A 20
  1. connect remote device (client)
 luna-send -i -f luna://com.webos.service.bluetooth2/gatt/connect '{"address":"b8:27:eb:ec:0d:5c", "subscribe":true}'
  1. discover services and get services(client)
luna-send -n 1 -f luna://com.webos.service.bluetooth2/gatt/discoverServices '{"address":"b8:27:eb:ec:0d:5c"}' 

luna-send -n 1 -f luna://com.webos.service.bluetooth2/gatt/getServices '{"address":"b8:27:eb:ec:0d:5c"}' 

{ 
 "adapterAddress": "b8:27:eb:05:4a:be", 
 "address": "b8:27:eb:ec:0d:5c", 
 "returnValue": true, 
 "services": [ 
     { 
         "characteristics": [ 
             { 
                 "permissions": { 
                 }, 
                 "properties": { 
                     "notify": false, 
                     "read": true, 
                     "writeWithoutResponse": false, 
                     "indicate": true, 
                     "authenticatedSignedWrites": false, 
                     "write": true, 
                     "broadcast": false, 
                     "extendedProperties": false 
                 }, 
                 "characteristic": "00002ab7-0000-1000-8000-00805f9b34fb", 
                 "value": { 
                     "bytes": [ 
                     ] 
                 }, 
                 "instanceId": "021", 
                 "descriptors": [ 
                     { 
                         "permissions": { 
                         }, 
                         "value": { 
                             "bytes": [ 
                             ] 
                         }, 
                         "descriptor": "00002ab7-0000-1000-8000-00805f9b34fb", 
                         "instanceId": "022" 
                     } 
                 ] 
             } 
         ], 
         "service": "0000feb8-0000-1000-8000-00805f9b34fb", 
         "type": "primary", 
         "includes": [ 
         ] 
     } 
 ] 
}

step 13.Monitoring specific characteristics

Shell 1 on client side(test device2).

 luna-send -f -i luna://com.webos.service.bluetooth2/gatt/monitorCharacteristics '{"clientId": "001","service":"0000feb8-0000-1000-8000-00805f9b34fb", "characteristics":["00002ab7-0000-1000-8000-00805f9b34fb"], "subscribe":true}'

Bellow ls2 return should be

{
"address": "68:76:4f:ec:10:6f",
"subscribed": true,
"adapterAddress": "a0:6f:aa:4d:7b:11",
"returnValue": true
}

Shell 2 on client side(test device2).

 luna-send -n 1 -f luna://com.webos.service.bluetooth2/gatt/writeCharacteristicValue '{"service":"0000feb8-0000-1000-8000-00805f9b34fb","characteristic":"00002ab7-0000-1000-8000-00805f9b34fb","clientId":"001","value":{"bytes":[11,22,33]}}'

Bellow ls2 return should be

{
"adapterAddress": "a0:6f:aa:4d:7b:11",
"address": "68:76:4f:ec:10:6f",
"returnValue": true
}

monitorCharacteristics subscription return should be

{
"changed": {
"characteristic":"00002ab7-0000-1000-8000-00805f9b34fb",

"value": {"bytes": [11,22,33]}
},

"address": "68:76:4f:ec:10:6f",
"subscribed": true,
"adapterAddress": "a0:6f:aa:4d:7b:11",
"returnValue": true

}

I already found out what is wrong with what i did; i forgot to set gatt/writeDescriptorValue to allow me to retrieve the subscription data of my indoor bike :slight_smile:

1 Like