indragiek / INDANCSClient

Objective-C Apple Notification Center Service Client
MIT License
252 stars 35 forks source link

iPhone disconnected with error #6

Closed victorkristof closed 9 years ago

victorkristof commented 9 years ago

Hello Indragie,

With some iPhones (got the problem with a 4S, a 5 and a 6), the Bluetooth devices enter a connect/disconnect loops:

Found device: Victor's iPhone
Victor's iPhone disconnected with error: Error Domain=CBErrorDomain Code=6 "The connection has timed out unexpectedly." UserInfo=0x60000006c040 {NSLocalizedDescription=The connection has timed out unexpectedly.}

This is repeated infinitely, with both Bluetooth icons (on the Mac and on the iPhone) blinking, indicating that the connection is indeed established for a few milliseconds.

I tried unpairing, turn off and on the Bluetooth, rebooting, resetting the iPhone. Nothing changes.

Any idea what is happening there ?

I'm running both INDANCSMac (on a MacBook Pro 15'' mid-2014, OS X 10.10) and INDANCSiPhone (on an iPhone 4S, 5 and 6, iOS 8.1.3) applications.

indragiek commented 9 years ago

@vicow It's pretty hard to tell what could be going wrong, unfortunately (as the error isn't too specific). I know the Apple engineer who works on the Core Bluetooth stack, so I'll ping him and get back to you if I have any more information.

indragiek commented 9 years ago

@vicow https://twitter.com/RenaudLienhart/status/570976310350073856

indragiek commented 9 years ago

This probably isn't super practical for your case though. The one thing I found that helped when I experienced this was reducing the interference on the 2.4GHz band by swapping out my router with one that supported a 5GHz band.

victorkristof commented 9 years ago

Cool, thanks a lot !

I also realized that it actually works well if the iPhone is my own one (same AppleID on the computer, Handoff enabled). With "external" devices, it doesn't work.

victorkristof commented 9 years ago

Ok, I'll try that then, thanks.

Still weird that it works with my own iPhone. By the way, my iPhone is never asked to be paired with my computer (and doesn't appear in the Bluetooth table in System preferences), which is the case with other iOS devices.

indragiek commented 9 years ago

Might be possible to pull logs for it as well: https://twitter.com/RenaudLienhart/status/570977497044508672

victorkristof commented 9 years ago

Unfortunately no BTServer crash logs... Tried to find them via Xcode's Devices window and View Device Logs. Could they be somewhere else ?

indragiek commented 9 years ago

Probably not a crash then. Hard to say what this could be, Bluetooth is pretty finicky.

victorkristof commented 9 years ago

I tried at home (i.e., not at the office downtown with tons of connected devices) and it worked perfectly. It worked also very well early this morning, before everybody arrived. Probably a lot of interferences... But yeah, this Bluetooth technology is not really reliable haha.

Thanks again and brillant work ;)