Issues sending notifications when setting up the MCU as a central and peripheral.

Hey!

My current setup is using an Android tablet ---- BLE ----> MCU1 (nrf52840) ---- BLE----> MCU2 (nrf52832)

I'm setting the MCU1 to act as both a peripheral and central. The goal is for the MCU1 to pass along all messages from the tablet to MCU2 and all notifications from MCU2 to the tablet. The characteristics and services are all the same on both MCUs. The issue I'm facing is when I have a tablet connected to MCU1 and then MCU2 connects, the notifications being sent back from MCU2 do not work. I'm getting "NRF_ERROR_INVALID_STATE" while calling "sd_ble_gatts_hvx." However, if I have MCU1 and MCU2 connected, and then connect on the tablet, the notifications work fine.

Does anyone have any clues as to how I should go about debugging this issue?

Thanks for your help!

Vasav

Parents Reply
  • Hi,

    What is the value of the connection handle when you get this error? 

    The issue I'm facing is when I have a tablet connected to MCU1 and then MCU2 connects, the notifications being sent back from MCU2 do not work. I'm getting "NRF_ERROR_INVALID_STATE" while calling "sd_ble_gatts_hvx." However, if I have MCU1 and MCU2 connected, and then connect on the tablet, the notifications work fine.

    If I understand you correctly, it works fine if you first connect MCU1 and MCU2 and then connect MCU 1 and the tablet. But it doesn't work if you first connect MCU1 and the tablet before you connect MCU2 and MCU1?

    regards

    Jared 

Children
Related