-
Notifications
You must be signed in to change notification settings - Fork 15
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 library stack size #6
Comments
Usually its not needed, but you can start new task and start BLE from it. |
Where I can find a example how to start my own task and start the BLE from it ? |
Its common use. Just create normal task, let say somewhere on start your app, then move to it all BLE related functions, like init, start advertising or start scan etc. |
you mean the BLE lib checks of it runs on the main thread/task and if YES create its own but in NOT then continue running on the current one ? e.g. if it is started inside a RTOS task/thread the callback will be the same task/thread ? this is the current scenario - all called on the setup() function 👍 BLEDevice::init(String(BLE_NAME_PREFIX + String(GetSetupDeviceName()) + ")").c_str()); // Create the BLE Service // Create input BLE Characteristic bleCharacteristicInTransport->setCallbacks(new bleCharacteristicInTransportCallback()); // Create a BLE Descriptor // Create output BLE Characteristic // Create a BLE Descriptor // Start the service LOG64_SET(F("BLE: CONNECTED : START NOTIFY")); bleServer->getAdvertising()->setScanResponse(true); |
This looks like usual use case, in which default arduino stack should be enough. You can create new task in setup, and like i said earlier, move all BLE init stuff to new task. Callbacks will be called from new task, but global data can be accessible from other tasks too, also in loop. |
The issue is inside the callbacks - e.g. I want to change the callbacks task stack size.. |
Do you have logs? Do you track stack watermark? |
also I have some issue with the BLE lib - if I leave a mobile phone connected to the BLEServer for about 24h with constant small data exchange e.g. log messages - sometime after closing the app on the mobile phone the BLE server do not issue the void onDisconnect(BLEServer* pServer) callback and I need to restart the device to get the BLE working again as the bleServer->startAdvertising(); // restart advertising is called only after disconnect |
and if I enable the verbose from time to time the ESP32 restarts with the watchdog triggered from BLE [V][BLEServer.cpp:271] handleGATTServerEvent(): << handleGATTServerEvent |
Its either in your code or esp-idf bluetooth stack:
EDIT try to decrease log level to info or debug |
Any suggestion how I can increase the stack size in the BLE library (callbacks) ?
The text was updated successfully, but these errors were encountered: