This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem receiving data from 2 sensors at the same time

Hi, I am trying to transmit data via Bluetooth from two sensors at the same time to a dongle that will send the data to the computer via USB, I am able to connect the two sensors correctly, but when I pair the second sensor, I stop receiving the first sensor data.

In the ble_nus_c_evt_handler function, I verified that I stop receiving information from sensor 1 and only receive information from sensor 2, disconnecting sensor 2 I check that it no longer receives BLE_NUS_C_EVT_NUS_TX_EVT events, and then unpairing sensor 1, I receive the BLE_NUS_C_EVT_DISCONNECTED event.
It was also verified using a sniffer, that sensor 1 continues to normally send data via Bluetooth to the dongle.

Could you help me with this problem?

Dongle information:
Hardware: PCA10059
Softdevice: s140 nrf52 7.2.0
SDK: 17.0.2

BLE Settings:
NRF_BLE_SCAN_SCAN_INTERVAL 160
NRF_BLE_SCAN_SCAN_WINDOW 80
NRF_BLE_SCAN_SCAN_DURATION 0

NRF_SDH_BLE_GAP_DATA_LENGTH 251
NRF_SDH_BLE_CENTRAL_LINK_COUNT 4
NRF_SDH_BLE_TOTAL_LINK_COUNT 4
NRF_SDH_BLE_GAP_EVENT_LENGTH 6
NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247

APP_BLE_CONN_CFG_TAG 1
APP_BLE_OBSERVER_PRIO 3

MIN_CONNECTION_INTERVAL_C MSEC_TO_UNITS(7.5, UNIT_1_25_MS)
MAX_CONNECTION_INTERVAL_C MSEC_TO_UNITS(15, UNIT_1_25_MS) 
SLAVE_LATENCY_C 0
SUPERVISION_TIMEOUT_C MSEC_TO_UNITS(4000, UNIT_10_MS) 

MAX_CONN_PARAMS_UPDATE_COUNT 6 
FIRST_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(5000) 
NEXT_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(30000)

NUS_SERVICE_UUID_TYPE BLE_UUID_TYPE_BLE 

Parents
  • Hello,

    What you want to do is possible, but I guess there are some issues with the implementation if you stop seeing messages from the first device after connecting to the second.

    First, I would recommend that you use a DK instead of a dongle, so that you have the possibility to debug your application.

    I don't know anything about your implementation. I guess you started by looking at the ble_app_uart_central example and modified it to support two connections?

    I suggest you look into the ble_app_multilink_central example, and try to replace the LBS_C service with the NUS_C service. Notice how this example uses arrays with connection handles to handle the multiple connections both in discovery and enabling notifications. I believe it does require some changes in the nus_c.c file. 

    Best regards,

    Edvin

Reply
  • Hello,

    What you want to do is possible, but I guess there are some issues with the implementation if you stop seeing messages from the first device after connecting to the second.

    First, I would recommend that you use a DK instead of a dongle, so that you have the possibility to debug your application.

    I don't know anything about your implementation. I guess you started by looking at the ble_app_uart_central example and modified it to support two connections?

    I suggest you look into the ble_app_multilink_central example, and try to replace the LBS_C service with the NUS_C service. Notice how this example uses arrays with connection handles to handle the multiple connections both in discovery and enabling notifications. I believe it does require some changes in the nus_c.c file. 

    Best regards,

    Edvin

Children
No Data
Related