Hi,
I'm trying to incorporate pc-ble-driver-js into NodeJS based server.
For some reason, after connecting to a peripheral with a custom service, although the connection get established correctly, notifications do not work and the connection will auto terminate after 30 seconds or so.
I've create a sample project (based on the `heart_rate_collector.js` example) which scan and connects to `ble_app_uart` from the `nrf5_sdk` examples.
The code is present at pc-ble-driver-js-test should run out of the box by issuing:
nvm use 12 yarn install node central.js <comport> v5
It will connect, subscribe for the TX event - but will not receive notifications and will disconnect for some reason after 30 seconds (look in the log for `connectionTime`)
I've verified subscription works by adding the following to `nus_data_handler` in `main.c`
else if (p_evt->type == BLE_NUS_EVT_COMM_STARTED) { NRF_LOG_INFO("BLE_NUS_EVT_COMM_STARTED"); } else if (p_evt->type == BLE_NUS_EVT_COMM_STOPPED) { NRF_LOG_INFO("BLE_NUS_EVT_COMM_STOPPED"); }
Few additional notes:
I've tested it on Windows10 and macOS Catalina with NodeJS v10 and v12 (v14 is not supported by the pc-ble-driver-js).
Needless to say, the same firmware on the nRF52840 works fine with the nRF Connect Bluetooth Low Energy Application (which programs the connectivity firmware)
Is there anything special done on the pc-nrfconnect-ble code to keep the connection alive? Some undocumented API?
Update 1: this is the link for the issue on GitHub How do i maintain connect after called connect method? #249
Update 2: Modified testing code to see if the suggestion in Connecting to device using pc-ble-driver-py causes disconnect after 60 seconds helps in any way. No matter which `FIRST_CONN_PARAMS_UPDATE_DELAY` or `NEXT_CONN_PARAMS_UPDATE_DELAY` values I put in - I'm still getting 30 seconds. which might indicate the disconnect is coming from somewhere else maybe?