This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Two adapter_t instances subscribed to nitifications but only one BLE_GATTC_EVT_HVX event

We are trying to use more than one nRF52840 dongles simultanuously on the same PC and within the same process using the pc-ble-driver library (pc-ble-driver library version 4.1.1; SoftDevice S140 version 6.1.1).

So far i am able to connect with both dongles:I can create 2 different adapter_t instances, that i use to distinguish which dongle a event has originated from similar to the way the pc-ble-driver-py and *-js libraries do it, i am able to connect to peer-devices, discover services/characteristics, read/write to characteristics etc., but when i connect to the same peer device with both dongles and subscribe to a characteristic supporting notification i only get one BLE_GATTC_EVT_HVX event, and only for the dongle/connection that subscribed first. When i unsubscribe the connection that does get the notification event, the notification events suddenly get raised for the second one still listening.

I would have expected to get 2 BLE_GATTC_EVT_HVX events; one for each peer connection that has set the characteristics CCCD. Is this normal behaviour or am i doing something wrong?

Thank you.

Parents
  • Hello,

    i am able to connect to peer-devices, discover services/characteristics, read/write to characteristics etc., but when i connect to the same peer device with both dongles and subscribe to a characteristic supporting notification i only get one BLE_GATTC_EVT_HVX event, and only for the dongle/connection that subscribed first. When i unsubscribe the connection that does get the notification event, the notification events suddenly get raised for the second one still listening.

    That does sound strange.
    Could you elaborate how you have verified that the two devices have established the connection to the peripheral, and enabled CCCD?

    I would have expected to get 2 BLE_GATTC_EVT_HVX events; one for each peer connection that has set the characteristics CCCD. Is this normal behaviour or am i doing something wrong?

    I too would have expected this, if the communication is going as expected.
    Are you familiar with the nRF Sniffer tool? It would be very helpful to see a sniffer trace of the on-air communication between the devices when this happens. Please make sure to select your peripheral device in the device selection drop-down menu before you begin the test - this will make the sniffer follow into the connection.

    With a sniffer trace we will be able to rule out the possibility of something being wrong in the BLE communication.

    Looking forward to resolving this issue together!

    Best regards,
    Karl

  • Thanks for looking into it.

    From the behavior of the notification events, i would assume that CCCD is enabled for both connections. This is what i have done and which effects i have seen:

    1. Connect with the first adapter and set CCCD to on -> notification events begin to arrive for adapter one
    2. Connect with the second adapter and set CCCD to on -> notifications still arrive for adapter one but not adapter two
    3. Set CCCD to off for the first adapter -> notifications begin to arrive for adapter two

    Sadly i don't have a third nRF Dongle right now (your Sniffer app works on the nRF52 Dongle right). I will try to order one in the next days and get back to you as soon as i have a sniffer trace.

    Best regards
    Alfred

  • Hello Alfred,

    Alfred Martin said:
    Thanks for looking into it.

    No problem at all, I am happy to help!

    Alfred Martin said:
    i would assume that CCCD is enabled for both connections. This is what i have done and which effects i have seen:

    Thank you for elaborating.
    I too would think this looks all right, but it is hard to say anything for certain without seeing a sniffer trace. 

    Alfred Martin said:
    Sadly i don't have a third nRF Dongle right now (your Sniffer app works on the nRF52 Dongle right). I will try to order one in the next days and get back to you as soon as i have a sniffer trace.

    Do you have access to either a nRF52 DK, nRF52840 DK, nRF51 DK, or nRF51 Dongle? These too could function as sniffers - thought the nRF51's may not sniff the 2 Mb PHY.
    Yes, as of version 3.1 the sniffer tool works for the nRF52840 Dongle as well.

    Please let me know if you do not have any other hardware that could function as a sniffer while you conduct the test - then we may look into other ways to confirm that the communication is happening as expected.

    Best regards,
    Karl

Reply
  • Hello Alfred,

    Alfred Martin said:
    Thanks for looking into it.

    No problem at all, I am happy to help!

    Alfred Martin said:
    i would assume that CCCD is enabled for both connections. This is what i have done and which effects i have seen:

    Thank you for elaborating.
    I too would think this looks all right, but it is hard to say anything for certain without seeing a sniffer trace. 

    Alfred Martin said:
    Sadly i don't have a third nRF Dongle right now (your Sniffer app works on the nRF52 Dongle right). I will try to order one in the next days and get back to you as soon as i have a sniffer trace.

    Do you have access to either a nRF52 DK, nRF52840 DK, nRF51 DK, or nRF51 Dongle? These too could function as sniffers - thought the nRF51's may not sniff the 2 Mb PHY.
    Yes, as of version 3.1 the sniffer tool works for the nRF52840 Dongle as well.

    Please let me know if you do not have any other hardware that could function as a sniffer while you conduct the test - then we may look into other ways to confirm that the communication is happening as expected.

    Best regards,
    Karl

Children
No Data
Related