is that possible to send the peripheral device data to bluetooth less desktop over ble

Hello,

In my project, I want to send the data from the ble device nrf52832 dev kit to a connected in-built Bluetooth desktop/PC. Some desktop doesn't have inbuilt Bluetooth and for that, so I used a third-party dongle(TP link dongle) that provides Bluetooth capability to Bluetooth-less desktop. I scanned the peripheral devices with a third-party dongle same as the in-built desktop/PC Bluetooth. next, successfully send the data from the peripheral device to the desktop/PC. but i want to develop a custom dongle to send/receive the data from peripherals devices as well as it provides Bluetooth capability to Bluetooth less desktop/PC.

I have tried the nrf52840 dongle and most of them say that it's not recommended for development and even it didn't provide any Bluetooth capability to the desktop as in-built. using nrf connect desktop app we can scan and connect the device but i need the same as the in-built Bluetooth.

So please let me know how can i achieve this.

Thank You. 

Parents
  • Hello,

    If you want a Bluetooth dongle for a bluetooth-less desktop/PC, it needs to contain a certain firmware. This firmware is Bluetooth HCI (Host Controller Interface) over USB. If the dongle doesn't contain this, then the computer will not be able to use it as a Bluetooth dongle. 

    However, if you want to add more functionality into this dongle, thus changing the FW to no longer be pure HCI, the computer will no longer see it as a Bluetooth dongle, so I don't think what you describe is possible.

    It is however possible to use a Bluetooth HCI dongle for what you want to, but it requires some sort of application running on your PC. But if I understand you correctly, you have already accomplished this?

    Best regards,

    Edvin

  • Hello,

    so I don't think what you describe is possible.

    So it's not possible to scan the peripheral devices and send the data from the peripheral to a central device that is connected to a Bluetooth-less desktop.

    But how TP link Bluetooth adapter can achieve this.? in their website they give some drivers for pc. will it work for all,?

    I didn't try hci example so can I try that once to get an idea? or its not suitable for my application.

    Thank You

  • What function returned the value that is checked in main.c line 862?

    BR,
    Edvin

  • Hello,

    nrf_drv_clock_init(); return this error.

    Thank You.

  • Hello hello..!!.

    That suggests that the clock is already initialized, wouldn't you agree? Try setting a breakpoint inside nrf_drv_clock_init() and see if it is reached before you reach line 862 in main.c. Is it reached? If so, you can just comment out nrf_drv_clock_init() on line 862 in main.c.

    Best regards,

    Edvin

  • Hello,

    Thanks for the reply,

    i added break point before nrf_drv_clock_init() and inside that also with some debugging prints,

    ret_code_t nrf_drv_clock_init(void)
    {
        ret_code_t err_code = NRF_SUCCESS;
        if (m_clock_cb.module_initialized)
        {
          
            printf("func\r\n");
            err_code = NRF_ERROR_MODULE_ALREADY_INITIALIZED;
            nrf_delay_ms(100);
        }
        else
        {
            m_clock_cb.p_hf_head      = NULL;
            m_clock_cb.hfclk_requests = 0;
            m_clock_cb.p_lf_head      = NULL;
            m_clock_cb.lfclk_requests = 0;
            err_code = nrfx_clock_init(clock_irq_handler);
    #ifdef SOFTDEVICE_PRESENT
            if (!nrf_sdh_is_enabled())
    #endif
            {
                nrfx_clock_enable();
            }
    
    #if CALIBRATION_SUPPORT
            m_clock_cb.cal_state = CAL_STATE_IDLE;
    #endif
    
            m_clock_cb.module_initialized = true;
        }
    
        if (nrf_wdt_started())
        {
            m_clock_cb.lfclk_on = true;
        }
    
        NRF_LOG_INFO("Function: %s, error code: %s.",
                     (uint32_t)__func__,
                     (uint32_t)NRF_LOG_ERROR_STRING_GET(err_code));
        printf("err_sagar:%d\r\n",err_code);
        nrf_delay_ms(100);
        return err_code;
    }

    so in main.c for ble_stack_init() it will enter to nrf_drv_clock_init()  and return err_code:0 then for nrf_drv_clock_init() in main.c again it will enter but return err_code:133.

    so this screenshot of serial port data,

    so I think commented out is the correct way, if not Please let me know, because if I am trying to send the counter val data continuously to print in Notepad on PC it's not working. 

    the same thing is working on usbd_hid_example,

     for (;;)
        {
            val+=1;       
            app_usbd_hid_kbd_key_control(&m_app_hid_kbd, val, 0);  // Release the key
    
            nrf_delay_ms(100);
    
            app_usbd_hid_kbd_key_control(&m_app_hid_kbd, val, 1);  // Press the key
    
            nrf_delay_ms(100);
                
            while (app_usbd_event_queue_process())
            {
                /* Nothing to do */
            }
            idle_state_handle();
    
        }
    
    }
    

    Thank You.

Reply
  • Hello,

    Thanks for the reply,

    i added break point before nrf_drv_clock_init() and inside that also with some debugging prints,

    ret_code_t nrf_drv_clock_init(void)
    {
        ret_code_t err_code = NRF_SUCCESS;
        if (m_clock_cb.module_initialized)
        {
          
            printf("func\r\n");
            err_code = NRF_ERROR_MODULE_ALREADY_INITIALIZED;
            nrf_delay_ms(100);
        }
        else
        {
            m_clock_cb.p_hf_head      = NULL;
            m_clock_cb.hfclk_requests = 0;
            m_clock_cb.p_lf_head      = NULL;
            m_clock_cb.lfclk_requests = 0;
            err_code = nrfx_clock_init(clock_irq_handler);
    #ifdef SOFTDEVICE_PRESENT
            if (!nrf_sdh_is_enabled())
    #endif
            {
                nrfx_clock_enable();
            }
    
    #if CALIBRATION_SUPPORT
            m_clock_cb.cal_state = CAL_STATE_IDLE;
    #endif
    
            m_clock_cb.module_initialized = true;
        }
    
        if (nrf_wdt_started())
        {
            m_clock_cb.lfclk_on = true;
        }
    
        NRF_LOG_INFO("Function: %s, error code: %s.",
                     (uint32_t)__func__,
                     (uint32_t)NRF_LOG_ERROR_STRING_GET(err_code));
        printf("err_sagar:%d\r\n",err_code);
        nrf_delay_ms(100);
        return err_code;
    }

    so in main.c for ble_stack_init() it will enter to nrf_drv_clock_init()  and return err_code:0 then for nrf_drv_clock_init() in main.c again it will enter but return err_code:133.

    so this screenshot of serial port data,

    so I think commented out is the correct way, if not Please let me know, because if I am trying to send the counter val data continuously to print in Notepad on PC it's not working. 

    the same thing is working on usbd_hid_example,

     for (;;)
        {
            val+=1;       
            app_usbd_hid_kbd_key_control(&m_app_hid_kbd, val, 0);  // Release the key
    
            nrf_delay_ms(100);
    
            app_usbd_hid_kbd_key_control(&m_app_hid_kbd, val, 1);  // Press the key
    
            nrf_delay_ms(100);
                
            while (app_usbd_event_queue_process())
            {
                /* Nothing to do */
            }
            idle_state_handle();
    
        }
    
    }
    

    Thank You.

Children
Related