ts1 / BLEUnlock

Lock/unlock your Mac with your iPhone, Apple Watch, or any other Bluetooth LE devices
2.79k stars 167 forks source link

Bluetooth can't see any device #38

Open acrostich opened 3 years ago

acrostich commented 3 years ago

BLEunlock entered the state 'lost -50'. Device shows just 'Scanning' Using Bluetooth Explorer, a search for Low Energy Devices is empty.

There are many BLE devices around. A search on the phone used as the connected device displays a long list.

Turning Bluetooth off and back on fixes this issue. BLEunlock becomes active again (though that doesn't generate any log message in the event log, it could be helpful to log transitions to Active state).

This has happened a few times since I've installed BLEunlock. I do not know if this is caused by BLEunlock or whether it happened before and BLEunlock has made this behaviour visible.

ts1 commented 3 years ago

Try one or both of following:

acrostich commented 3 years ago

Thanks. Didn't know about Shift+Option for Bluetooth.

I'll see if it happens again and try either. I assume that Passive Mode takes more time to react that the Active Mode as you suggest using Active Mode unless it creates issues. Is that the case?

ts1 commented 3 years ago

Yes, the active mode is more responsive and accurate. But it sometimes confuses Bluetooth system for reasons I don't know.

acrostich commented 3 years ago

It hasn't happened for the past two days. BLEunlock has been working really well. Really useful app. The one change I did was to increase the No-signal timeout to 2 mins. Not sure if that was the solution or is a coincidence. If it happens to others you may want to try that.

acrostich commented 3 years ago

I was tempting fate. This morning it just happened again. While not seeing any device I tried putting BLEunlock in Passive mode, but it still didn't detect any device. I expected this as it sounds like the whole Bluetooth system is not in a working state. Resetting the Bluetooth module cleared the issue and BLEunlock immediately reconnected.

One additional information. The event I got is 'intruded -75'. That seems to indicate that the Bluetooth system crashed earlier when my phone was not close to my laptop. I had closed my laptop for the night. I now suspect that these crashes of the Bluetooth system happen when the laptop is asleep.

I do think it is related to the BLEunlock as although I didn't use BLE with my laptop before I did use Bluetooth so would have noticed such a crashed state of the Bluetooth system (unless they fixed themselves after a very long timeout of possibly hours). So I suspect some interaction with some BLE command and going to sleep is what is likely to cause the Bluetooth system to go in a state where it's not working.

ts1 commented 3 years ago

The intruded event may occur at the wrong time when the Mac wakes up from sleep. I'll fix it.

In your situation, I suggest that you enable Passive Mode.

rursache commented 3 years ago

Resetting the Bluetooth module also fixed it for me. Using a hackintosh with a Broadcom BCM94360 pcie card

acrostich commented 3 years ago

@rursache resetting the Bluetooth module was only a temporary fix for me. What has been a permanent fix (at least for the past two weeks so looks permanent) has been to switch to Passive mode, as per ts1's suggestion.

rursache commented 3 years ago

@acrostich i'll give it a few days to test without passive mode, mine being a PC it never goes into sleep so i might not have the issue you had. thanks for the tip tho!