-
Notifications
You must be signed in to change notification settings - Fork 51
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
Connection 'flaps' when Bean goes out of range and comes back into range #3
Comments
Hi Paul, thank you for the info. I'll look into the problem and have a fix shortly! |
Hi @paulw11 , I'm looking into this issue currently and having difficulty recreating or understanding the problem. Can you please explain what you mean by flapping? Is the bean repeatedly connecting/disconnection indefinitely? thank you |
Hi, Yes, I am auto reconnecting The code is available here - https://github.com/paulw11/BeanLock I have included part of the debug log below. The log starts from about the 2014-09-03 08:27:48.057 BeanLock[12582:60b] App Message Received: 2014-09-03 08:28:11.318 BeanLock[12582:60b] 2014-09-03 08:28:11.320 BeanLock[12582:60b] Error in didDisconnectBean: 2014-09-03 08:28:25.481 BeanLock[12582:60b] 2014-09-03 08:28:25.484 BeanLock[12582:60b] Reset validaton retry count 2014-09-03 08:28:25.844 BeanLock[12582:60b] 2014-09-03 08:28:25.848 BeanLock[12582:60b] Error in didDisconnectBean: 2014-09-03 08:28:25.989 BeanLock[12582:60b] Validation retry count=0 2014-09-03 08:28:25.991 BeanLock[12582:60b] CoreBluetooth[API MISUSE] 2014-09-03 08:28:31.044 BeanLock[12582:60b] 2014-09-03 08:28:31.046 BeanLock[12582:60b] Reset validaton retry count 2014-09-03 08:28:31.550 BeanLock[12582:60b] Validation retry count=0 2014-09-03 08:28:31.865 BeanLock[12582:60b] DevInfoProfile: Device 2014-09-03 08:28:31.867 BeanLock[12582:60b] OadProfile: OAD service found 2014-09-03 08:28:31.870 BeanLock[12582:60b] GattSerialProfile: GATT Serial 2014-09-03 08:28:31.873 BeanLock[12582:60b] BatteryProfile: Battery 2014-09-03 08:28:32.284 BeanLock[12582:60b] DevInfoProfile: Found all 2014-09-03 08:28:32.494 BeanLock[12582:60b] OadProfile: Found all OAD 2014-09-03 08:28:32.614 BeanLock[12582:60b] GattSerialProfile: Found all 2014-09-03 08:28:32.734 BeanLock[12582:60b] BatteryProfile: Found all 2014-09-03 08:28:32.794 BeanLock[12582:60b] DevInfoProfile: Device 2014-09-03 08:28:32.944 BeanLock[12582:60b] OadProfile: OAD Characteristic 2014-09-03 08:28:33.064 BeanLock[12582:60b] GattSerialProfile: Gatt Serial 2014-09-03 08:28:33.066 BeanLock[12582:60b] Stopped scanning. 2014-09-03 08:28:33.274 BeanLock[12582:60b] BatteryProfile: Battery 2014-09-03 08:28:33.333 BeanLock[12582:60b] BatteryProfile: Battery Level 2014-09-03 08:28:33.338 BeanLock[12582:60b] App Message Received: 2014-09-03 08:28:35.992 BeanLock[12582:60b] Validation retry count=1 2014-09-03 08:28:35.997 BeanLock[12582:60b] DevInfoProfile: Device 2014-09-03 08:28:35.999 BeanLock[12582:60b] DevInfoProfile: Found all 2014-09-03 08:28:36.001 BeanLock[12582:60b] OadProfile: OAD service found 2014-09-03 08:28:36.003 BeanLock[12582:60b] OadProfile: OAD 2014-09-03 08:28:36.005 BeanLock[12582:60b] GattSerialProfile: GATT Serial 2014-09-03 08:28:36.007 BeanLock[12582:60b] GattSerialProfile: Found all 2014-09-03 08:28:36.009 BeanLock[12582:60b] BatteryProfile: Battery 2014-09-03 08:28:36.011 BeanLock[12582:60b] BatteryProfile: Found all 2014-09-03 08:28:36.064 BeanLock[12582:60b] DevInfoProfile: Device 2014-09-03 08:28:36.124 BeanLock[12582:60b] BatteryProfile: Battery 2014-09-03 08:28:36.244 BeanLock[12582:60b] BatteryProfile: Battery Level 2014-09-03 08:28:45.995 BeanLock[12582:60b] Validation retry count=2 2014-09-03 08:28:45.997 BeanLock[12582:60b] Error: Error Domain=PTDBean
} 2014-09-03 08:28:46.000 BeanLock[12582:60b] Error in didConnectToBean: 2014-09-03 08:28:46.002 BeanLock[12582:60b] 2014-09-03 08:28:46.012 BeanLock[12582:60b] 2014-09-03 08:28:46.013 BeanLock[12582:60b] Reset validaton retry count 2014-09-03 08:28:46.516 BeanLock[12582:60b] Validation retry count=0 2014-09-03 08:28:46.521 BeanLock[12582:60b] DevInfoProfile: Device 2014-09-03 08:28:46.523 BeanLock[12582:60b] OadProfile: OAD service found 2014-09-03 08:28:46.525 BeanLock[12582:60b] GattSerialProfile: GATT Serial 2014-09-03 08:28:46.528 BeanLock[12582:60b] BatteryProfile: Battery 2014-09-03 08:28:46.532 BeanLock[12582:60b] DevInfoProfile: Found all 2014-09-03 08:28:46.534 BeanLock[12582:60b] OadProfile: Found all OAD 2014-09-03 08:28:46.537 BeanLock[12582:60b] GattSerialProfile: Found all 2014-09-03 08:28:46.539 BeanLock[12582:60b] BatteryProfile: Found all 2014-09-03 08:28:46.542 BeanLock[12582:60b] GattSerialProfile: Error 2014-09-03 08:28:46.544 BeanLock[12582:60b] BatteryProfile: Error trying 2014-09-03 08:28:46.545 BeanLock[12582:60b] GattSerialProfile: Error 2014-09-03 08:28:46.547 BeanLock[12582:60b] BatteryProfile: Error trying 2014-09-03 08:28:46.548 BeanLock[12582:60b] GattSerialProfile: Error 2014-09-03 08:28:46.550 BeanLock[12582:60b] BatteryProfile: Error trying 2014-09-03 08:28:46.757 BeanLock[12582:60b] 2014-09-03 08:28:46.759 BeanLock[12582:60b] Error in didDisconnectBean: 2014-09-03 08:28:48.085 BeanLock[12582:60b] 2014-09-03 08:28:48.087 BeanLock[12582:60b] Reset validaton retry count 2014-09-03 08:28:48.590 BeanLock[12582:60b] Validation retry count=0 2014-09-03 08:28:48.794 BeanLock[12582:60b] DevInfoProfile: Device 2014-09-03 08:28:48.797 BeanLock[12582:60b] OadProfile: OAD service found 2014-09-03 08:28:48.800 BeanLock[12582:60b] GattSerialProfile: GATT Serial 2014-09-03 08:28:48.802 BeanLock[12582:60b] BatteryProfile: Battery 2014-09-03 08:28:49.035 BeanLock[12582:60b] DevInfoProfile: Found all 2014-09-03 08:28:49.214 BeanLock[12582:60b] OadProfile: Found all OAD 2014-09-03 08:28:49.335 BeanLock[12582:60b] GattSerialProfile: Found all 2014-09-03 08:28:49.454 BeanLock[12582:60b] BatteryProfile: Found all 2014-09-03 08:28:49.514 BeanLock[12582:60b] DevInfoProfile: Device 2014-09-03 08:28:49.634 BeanLock[12582:60b] OadProfile: OAD Characteristic 2014-09-03 08:28:49.754 BeanLock[12582:60b] GattSerialProfile: Gatt Serial 2014-09-03 08:28:49.756 BeanLock[12582:60b] Stopped scanning. 2014-09-03 08:28:49.994 BeanLock[12582:60b] BatteryProfile: Battery 2014-09-03 08:28:50.054 BeanLock[12582:60b] BatteryProfile: Battery Level 2014-09-03 08:28:50.058 BeanLock[12582:60b] App Message Received: 2014-09-03 08:28:56.519 BeanLock[12582:60b] Validation retry count=1 2014-09-03 08:28:56.524 BeanLock[12582:60b] DevInfoProfile: Device 2014-09-03 08:28:56.526 BeanLock[12582:60b] DevInfoProfile: Found all 2014-09-03 08:28:56.528 BeanLock[12582:60b] OadProfile: OAD service found 2014-09-03 08:28:56.530 BeanLock[12582:60b] OadProfile: OAD 2014-09-03 08:28:56.532 BeanLock[12582:60b] GattSerialProfile: GATT Serial 2014-09-03 08:28:56.534 BeanLock[12582:60b] GattSerialProfile: Found all 2014-09-03 08:28:56.535 BeanLock[12582:60b] BatteryProfile: Battery 2014-09-03 08:28:56.538 BeanLock[12582:60b] BatteryProfile: Found all 2014-09-03 08:28:56.565 BeanLock[12582:60b] DevInfoProfile: Device 2014-09-03 08:28:56.624 BeanLock[12582:60b] BatteryProfile: Battery 2014-09-03 08:28:56.684 BeanLock[12582:60b] BatteryProfile: Battery Level 2014-09-03 08:29:06.522 BeanLock[12582:60b] Validation retry count=2 2014-09-03 08:29:06.524 BeanLock[12582:60b] Error: Error Domain=PTDBean
} 2014-09-03 08:29:06.527 BeanLock[12582:60b] Error in didConnectToBean: 2014-09-03 08:29:06.530 BeanLock[12582:60b] 2014-09-03 08:29:06.539 BeanLock[12582:60b] On Wed, Sep 3, 2014 at 3:23 AM, kamp0145 [email protected] wrote:
|
Hi, what's the status with this issue now? I have the exact same problem, setting PROFILE_VALIDATION_RETRY_TIMEOUT higher made a big difference (very glad i found this thread - thanks paul!), but it still happens occasionally |
@peterworth, we are in the process of reworking the connection process. So this issue will soon be resolved in the next major release. For now, does it help if you set PROFILE_VALIDATION_RETRIES to be 1 ? |
oad: fix logic, improve method signatures for app clients
I have found that if a Bean goes out of range while connected to a device and the device re-initiates a connection then when the device comes back into range, the connection will 'flap'. The bean disconnects with the didDisconnectBean: delegate method reporting -
Error: Error Domain=PTDBean Code=100 "Validation Failed. Retry count exceeded" UserInfo=0x17806bbc0 {NSLocalizedDescription=Validation Failed. Retry count exceeded} { NSLocalizedDescription = "Validation Failed. Retry count exceeded"; }
The bean then reconnects before disconnecting a short time later with the same message.
Increasing
PROFILE_VALIDATION_RETRY_TIMEOUT
to100.0f
inPTDBean.m
seems to resolve the issueThe text was updated successfully, but these errors were encountered: