Is there any possible way to sedn the data from peripheral device(nrf52832 dev kit) to nrf52840 dongle which is connected to Bluetooth-less desktop

Hello,

In my project, i want to send the data from the ble device nrf52832 dev kit to the nrf52840 dongle which is connected to a Bluetooth-less desktop. Some desktop doesn't have inbuilt Bluetooth and for that, i used an nrf52840 dongle with the help of nrf connect desktop app i flashed the dongle(here i don't have any example or source file, firmware flashed directly by the app), and when I connect it to desktop & scan the peripheral devices with Bluetooth low energy option in nrf connect app. even I can connect the peripheral devices.

Now the issue is how can I send the data from the nrf52832 dev kit to nrf dongle because there is no source file I couldn't add code to receive the data. i tried ble_app_blinky and ble_app_blinky_c examples to send the button state data from peripheral to central so can i use the same for nrf52832 and dongle.??

if so, using the dongle can we connect it to PC and send the data to pc.??

please let me know how can i implement this.

Thank You. 

  • Hi Sagarnayakm,

    Sorry for late response, it was a long holiday last week in Norway. 
    Have you got any progress in debugging ? 


    As I mentioned, don't test on the dongle. 
    What you need to do is to make the DK - DK works first before you move to the dongle. 
    With the DK you can step into the code. 

    My suggestion is that you start with ble_app_uart_c . Try to port the USB library in and the goal is to print out something on the USB CDC virtual UART port by using app_usbd_cdc_acm_write(). Don't do anything with BLE. 

    If you can print out some dummy log on the USB COM port in the ble_app_uart_c  then you can move to the next step to integrate that with the NUS profile. 

    I can't test your code here because I need the whole project, not just main.c 


  • Hello,

    Yes, I have tested with the dev kit as well as the dongle and I can able to send the data from the peripheral to the central but here once I send the data from the peri-central data is received perfectly, and after this, the next data is sent and if that data less size of first one then it replaces the older data.

    for example first data "hello" then next data "hi" so in the serial monitor "it receives like this "hillo". so it's not printing in the next line.

    1. here I have one more doubt, I want to add NUS service to the ble_app_hids_keyboard example and I have added it successfully without any errors but the device is not advertising after this then I started debugging it throws me err_code 4 for nus_init(). so what will be the issue?

    2. so can we add hid example to the merged one(ble_app_uart_c & ble_usbd ).?? because however, i want to print the data in notepads of connected devices like mobile/laptops.

    Thank You.

  • Hi Sagarnayakm, 

    Could you please confirm that now you can output to USB instead of UART in the ble_app_uart_c code ?
    Regarding your question number 1, could you show how you print the data out using app_usbd_cdc_acm_write() ? 
    If you have a look at usbd_ble_uart example code you can find this: 

            uint16_t length = p_evt->params.rx_data.length;
            if (length + sizeof(ENDLINE_STRING) < BLE_NUS_MAX_DATA_LEN)
            {
                memcpy(m_nus_data_array + length, ENDLINE_STRING, sizeof(ENDLINE_STRING));
                length += sizeof(ENDLINE_STRING);
            }
    
            // Send data through CDC ACM
            ret_code_t ret = app_usbd_cdc_acm_write(&m_app_cdc_acm,
                                                    m_nus_data_array,
                                                    length);

    This is how we add the line break and new line in (endline). 

    Regarding  your 2nd question, I'm not so sure why you want to have HIDs here. Are you planning to have the HIDs keyboard to "type" the text into the mobile/laptop ? 

  • Regarding  your 2nd question, I'm not so sure why you want to have HIDs here. Are you planning to have the HIDs keyboard to "type" the text into the mobile/laptop ? 

    Regarding this, yes my peripheral device contains(ble_app_uart + ble_app_hids_keyboard) and I want to connect this device to my dongle. 

    As I did with dev kits nrf52832(ble_app_uart) and nrf52840 with (ble_app_uart_c). once nrf52840 is powered up peripheral device gets connected and I can able to send the data from peri to central.

    now I just change the peripheral device with my custom board having (ble_app_uart + ble_app_hids_keyboard)  name "Nordic_keyborad" --> "Nordic_UART" to connect with y dongle but its not connecting, advertising continuously.

    Regarding your question number 1, could you show how you print the data out using app_usbd_cdc_acm_write() ? 

    this  is how i am sending it USB dongle.

      

Related