You are reading a single comment by @dashxdr and its replies. Click here to read the full conversation.
  • First of all, BLE is work in progress. From time to time changes are uploaded.
    At same time, esp-idf is changed very often.
    Since this is my hobby only, please don't expect a full blown up implementation soon.
    Your problem seems to be one of those changes in esp-idf. Sequence of calls during setup (and params for release ??) changed.
    You could try this

    void jsble_init(){
    	esp_err_t ret;
        
    	ret = esp_bt_controller_mem_release(ESP_BT_MOD­E_CLASSIC_BT);
    	if(ret) {jsWarn("mem release failed:%x\n",ret); return;}
    	
    	esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
        ret = esp_bt_controller_init(&bt_cfg);if(ret) {jsWarn("initialize controller failed:%x\n",ret); return;}
    
    	ret = esp_bt_controller_enable(ESP_BT_MODE_BLE­);if(ret) {jsWarn("enable controller failed:%x\n",ret); return;}
    	
    	ret = esp_bluedroid_init();if (ret) {jsWarn("init bluetooth failed:%x\n",ret);return;}
        
    	ret = esp_bluedroid_enable();if (ret) {jsWarn("enable bluetooth failed:%x\n",ret);return;}
    	
    	ret = esp_ble_gap_register_callback(gap_event_­handler);if (ret){jsWarn("gap register error:%x\n", ret);return;}
    
    	ret = esp_ble_gatts_register_callback(gatts_ev­ent_handler);if(ret){jsWarn("gatts register error:%x\n", ret);return;}
    
    
  • ret = esp_bt_controller_mem_release(ESP_BT_MOD­E_CLASSIC_BT);
     if(ret) {jsWarn("mem release failed:%x\n",ret); return;}
    

    This version does work. I left the ret = esp_ble_gatt_set_local_mtu(500); section in place at the end.

    Thanks--
    Dave

About

Avatar for dashxdr @dashxdr started