-
Notifications
You must be signed in to change notification settings - Fork 207
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
MKR1010 BLE - Timeout issue #109
Comments
Hi @sprasadkrish ,
handle scan enable failures int ret = 0;
while (!ret) {
ret = BLE.scanForUuid("19b10000-e8f2-537e-4f6c-d104768a1214");
} substitute delays unsigned long timeRef = millis();
void loop()
{
// substitute the delay with a busy cycle that calls the BLE polling function
// delay(3000);
timeRef = millis();
while (millis() < timeRef + 3000) {
BLE.poll();
}
...
}
Regarding the first point I mentioned above, take a look at this #105 . This commit implements some functions useful for handling multiple peripherals/centrals. This commit can also be tried by checking out the arduinoBLE 'multi_connection' branch here https://github.com/arduino-libraries/ArduinoBLE/tree/multi-connection . |
Hi Paolo Calao ,
Thank you , As per your suggestion , I will modify the
sketches.
…On Mon, 31 Aug 2020 7:43 pm Paolo Calao, ***@***.***> wrote:
Hi @sprasadkrish <https://github.com/sprasadkrish> ,
There isn't any timeout limiting the maximum connection time. So, the
problem should reside in your sketches.
I can give you the following advice.
- Maintain two concurrent connections instead of disconnecting from
each a peripheral after a read.
- Catch and handle the cases in which arduinoBLE functions execution
fails (returning 0)
- Substitute the delay statement with a busy cycle that calls the BLE
polling function (see example below)
handle scan enable failures
int ret = 0;while (!ret) {
ret = BLE.scanForUuid("19b10000-e8f2-537e-4f6c-d104768a1214");
}
substitute delays
unsigned long timeRef = millis();void loop()
{
// substitute the delay with a busy cycle that calls the BLE polling function
// delay(3000);
timeRef = millis();
while (millis() < timeRef + 3000) {
BLE.poll();
}
...
}
Regarding the first point I mentioned above, take a look at this #105
<#105> . This commit
implements some functions useful for handling multiple
peripherals/centrals. This commit can also be tried by checking out the
arduinoBLE 'multi_connection' branch here
https://github.com/arduino-libraries/ArduinoBLE/tree/multi-connection .
Some examples can be found here #50
<#50>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#109 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOFHQSSOZ43GUU4KQQLT2X3SDOVXBANCNFSM4QH6Z7SA>
.
|
Hardware :MKR 1010WIFI ( for BLE)
Arduino lib : version 1.1.3
I am using one central and two peripherals for data receiving.
CentralBLE always receives data, based on a request to peripheralsBLE.
Example: CentralBLE request peripheralBLE-1, to send data, peripheralBEL-1 send data to CentralBLE similarly
peripheralBLE-2 also.
CentralBLE request peripheralBLE-2, to send data, peripheralBEL-2 send data to CentralBLE
Issue:
Central receive data up to 2 minutes , after two minutes , central disconnect peripheral and stop receiving data . There is any possible to increase the timeout of Central BLE , or possible to set NO TIMEOUT in CentralBLE(continues data transfer).
sketch :
CENTRAL_V11.0.txt
PERIPHERAL_1_V11.0.txt
PERIPHERAL_2_V11_0.txt
The text was updated successfully, but these errors were encountered: