Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLE crashes from Wifi issue #13

Open
wzaggle opened this issue Dec 18, 2017 · 1 comment
Open

BLE crashes from Wifi issue #13

wzaggle opened this issue Dec 18, 2017 · 1 comment

Comments

@wzaggle
Copy link

wzaggle commented Dec 18, 2017

System still crashes Ble search on some form of Wifi disconnect.

I (11552633) wifi: bcn_timout,ap_probe_send_start
I (11555134) wifi: ap_probe_send over, resett wifi status to disassoc
I (11555135) wifi: state: run -> init (1)
I (11555135) wifi: pm stop, total sleep time: 0/-1385824691

Then remaining heap starts to go down by 2948 bytes for each
esp_ble_gap_start_scanning(5);
and BLE search stops finding servers but no apparent errors.

Then eventual system restart from lack of memory.

@wzaggle
Copy link
Author

wzaggle commented Jan 2, 2018

I am using the Arduino IDE, and this delay of 1800 ms seemed to (sort of) fix it, following an Open event and prior to getting a battery service characteristic. More or Less delay does NOT work. Will now run for hours without crashing but eventually only sees one or two out of 10 BLE Servers. Also a small delay after getting ESP_GAP_BLE_SCAN_RESULT_EVT callback cured some of the other dual BLE/Wifi issues. And a delay of 4000ms following Wifi start allowed Wifi and BLE to both start if Wifi starts first. I am confident I have only relieved a symptom and not addressed the real issues. But offered this to those who are looking for the real problems.

case ESP_GATTC_OPEN_EVT:
conn_id = param->open.conn_id;
if (param->open.status == ESP_GATT_OK) {
delay(1800);
esp_ble_gattc_get_characteristic(appGattcIf, conn_id, &batt_service_id, NULL);
}
break;

Additional problems seem to occur when a DISCONNECT event callback happens before a CLOSE event callback, following a failed GET CHARACTERISTIC call. After this happens a system crash is soon to follow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant