-
Notifications
You must be signed in to change notification settings - Fork 217
BLE.scan(true) stopped after 10-15 minutes #202
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
Comments
Hi I had similar issue - it turns out to be problem when multiple devices advertise at the same time and there is collision resulting in disrupted package not detected in HCI.cpp
Deeper explonation: since then I have never encounter a freeze on my Arduino Nano 33 BLE again. (run several hours) |
Thank you for replying us. I have made a changes to it. I have checked it run around 3hours and stopped. After 2 hours, it is restarted automatically (I think so restarted with watchdog timer). My application is open a barricade when the bluetooth android device near nano 33 ble. Can you tell me any indication if the ble scan is stopped, so that i can reset the ble module with NVIC_SystemReset(). can you help me please |
Hi - sorry I do not use this library anymore (we have switched to Zaphyr OS)
then that to current millis on every loop and if it pass some threshold simply flush whole _recvBuffer and reset index. |
you code is good to fix this problem.but it's not flexible. In my condition.I have encountered with the packe start with I replace the following code with mine: // shift package one byte left - remove first invalid byte
for (int ii = 1; ii < _recvIndex; ii++)
{
_recvBuffer[ii - 1] = _recvBuffer[ii];
}
_recvIndex--; here is my code: int offset, cnt;
for(offset = 0;offset < _recvIndex; ++offset){
if(_recvBuffer[offset + 1] != HCI_EVENT_PKT && _recvBuffer[offset] == HCI_EVENT_PKT)
break;
}
if(offset){
for(cnt = offset;cnt < _recvIndex; ++cnt){
_recvBuffer[cnt - offset] = _recvBuffer[cnt];
}
}
_recvIndex -= offset; |
Hi, try this: |
Hello, I have used nano ble 33 module. I am connect to the peripheral device and getting data, while allows a scan with duplicates.
But the scan stops automatically 10-15 minutes. Can you suggest way for continous scan
#include<ArduinoBLE.h>
The text was updated successfully, but these errors were encountered: