Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52832 dk fails to connect JDY-23 BLE 5.0 module

Hi. 

I have some trouble to use a sensor based on JDY-23 module with nrf52832 dk

(JDY-23 datasheet : ://fcc.report/FCC-ID/2AXM8-JDY-23/4936741.pdf)

We tried to connect the module by using nrf52832 dk and nrf_urt_c example of 15.3 SDK

All scanning method I tried; by MAC address, name, shortened name failed

even if I tried another dk board with ble_blinky example and it was successful

 I doubt whether the sensor is genuine ble5.0 or not 

and the "unknown service" especially having 0xFFE0 is SPP profile

Thanks to nrfConenct app, I captured the informations of the sensor

Could you give me some advice?

Thanks

Juno

Here is the code

(I tried scanning by MAC address, device name, shortened device name but nrf52 dk seems cannot find the jdy-23 sensor

whereas nordic blinky was connected right away)

static void scan_init(void)
{
    ret_code_t          err_code;
    nrf_ble_scan_init_t init_scan;
    memset(&init_scan, 0, sizeof(init_scan));
    init_scan.connect_if_match = true;
    init_scan.conn_cfg_tag     = APP_BLE_CONN_CFG_TAG;
    err_code = nrf_ble_scan_init(&m_scan, &init_scan, scan_evt_handler);
    APP_ERROR_CHECK(err_code);
    //err_code = nrf_ble_scan_filter_set(&m_scan, SCAN_UUID_FILTER, &m_nus_uuid); //210729 juno
   	static char const m_target_device_name[] = "21SOCAR00009";
    //static char const m_target_device_name[] =	"Nordic_Blinky";
//			static nrf_ble_scan_short_name_t m_bs_str =
//		{
//			.p_short_name = "21SOCAR00002",
//			.short_name_min_len = 12
//		};
	  //static char const test_periph_addr[] = {0x3D, 0x05, 0xD1, 0x2F, 0x11, 0x20};
		//static char const test_periph_addr[] = {0x1A, 0x4C, 0xB3, 0x07, 0xC5, 0xD2};
    //err_code = nrf_ble_scan_filter_set(&m_scan, SCAN_ADDR_FILTER, test_periph_addr);
//    err_code = nrf_ble_scan_filter_set(&m_scan, SCAN_SHORT_NAME_FILTER, &m_bs_str);
//    NRF_LOG_INFO("filter_set_error=%d",err_code);
//		APP_ERROR_CHECK(err_code);
    err_code = nrf_ble_scan_filter_set(&m_scan,SCAN_NAME_FILTER, &m_target_device_name);
	  //err_code = nrf_ble_scan_filter_set(&m_scan,SCAN_SHORT_NAME_FILTER, &m_target_device_name);
	  NRF_LOG_INFO("filter_set_error=%d",err_code);
    //APP_ERROR_CHECK(err_code);
    //err_code = nrf_ble_scan_filters_enable(&m_scan, NRF_BLE_SCAN_UUID_FILTER, false);
    err_code = nrf_ble_scan_filters_enable(&m_scan, NRF_BLE_SCAN_ALL_FILTER, false);
    //err_code = nrf_ble_scan_filters_enable(&m_scan, NRF_BLE_SCAN_SHORT_NAME_FILTER, false);
		NRF_LOG_INFO("filter_enable_error=%d",err_code);  
  	APP_ERROR_CHECK(err_code);
}

  • Hi

    This module, as most other modules, does not seem to have the optional external 32.768kHz LF crystal that's used by default in our SDK. What example are you trying to run on the module anyway? In order to use the internal RC oscillator in a given application instead, please edit the following configs to these values in your project's sdk_config.h header file.

    // <h> Clock - SoftDevice clock configuration
    
    //==========================================================
    // <o> NRF_SDH_CLOCK_LF_SRC  - SoftDevice clock source.
     
    // <0=> NRF_CLOCK_LF_SRC_RC 
    // <1=> NRF_CLOCK_LF_SRC_XTAL 
    // <2=> NRF_CLOCK_LF_SRC_SYNTH 
    
    #ifndef NRF_SDH_CLOCK_LF_SRC
    #define NRF_SDH_CLOCK_LF_SRC 0
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. 
    #ifndef NRF_SDH_CLOCK_LF_RC_CTIV
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. 
    // <i> How often (in number of calibration intervals) the RC oscillator shall be calibrated
    // <i>  if the temperature has not changed.
    
    #ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_ACCURACY  - External clock accuracy used in the LL to compute timing.
     
    // <0=> NRF_CLOCK_LF_ACCURACY_250_PPM 
    // <1=> NRF_CLOCK_LF_ACCURACY_500_PPM 
    // <2=> NRF_CLOCK_LF_ACCURACY_150_PPM 
    // <3=> NRF_CLOCK_LF_ACCURACY_100_PPM 
    // <4=> NRF_CLOCK_LF_ACCURACY_75_PPM 
    // <5=> NRF_CLOCK_LF_ACCURACY_50_PPM 
    // <6=> NRF_CLOCK_LF_ACCURACY_30_PPM 
    // <7=> NRF_CLOCK_LF_ACCURACY_20_PPM 
    // <8=> NRF_CLOCK_LF_ACCURACY_10_PPM 
    // <9=> NRF_CLOCK_LF_ACCURACY_5_PPM 
    // <10=> NRF_CLOCK_LF_ACCURACY_2_PPM 
    // <11=> NRF_CLOCK_LF_ACCURACY_1_PPM 
    
    #ifndef NRF_SDH_CLOCK_LF_ACCURACY
    #define NRF_SDH_CLOCK_LF_ACCURACY 1
    #endif

    Best regards,

    Simon

Related