Thor77 / Blueproximity

Run a command once a bluetooth device is in/out of a range
GNU General Public License v2.0
66 stars 15 forks source link

Scanning for BT devices does not always work #27

Closed Thor77 closed 7 years ago

Thor77 commented 7 years ago

Scanning leads to this error:

Traceback (most recent call last): File "proximity.py", line 466, in cb_btnScan_clicked macs = self.proxi.get_device_list() File "proximity.py", line 735, in get_device_list nearby_devices = bluetooth.discover_devices() File "/usr/lib/python2.5/site-packages/bluetooth.py", line 277, in discover_devices raise BluetoothError("error communicating with local " bluetooth.BluetoothError: error communicating with local bluetooth adapter

if the already entered BT address is unreachable and not empty. It seems that the BT adapter is kind of in use trying to connect to that device and we are not to disturb it during that period. (Either that or there is actually a good function hidden somewhere that allows us to do exactly that.)

Thor77 commented 7 years ago

Logged In: YES user_id=114903 Originator: YES

Ok, could not make it work the way I wanted to because of long connection timeouts... Anyway the error is caught and presented to the user in an adequate form. So this is fixed. (By highno)

Thor77 commented 7 years ago

Logged In: YES user_id=114903 Originator: YES

Ok, I am now working on this bug. It seems that the error rises because if the mac is wrong or unreachable there is still a connect process running that must first hit its timeout before the device is clear to scan. I'll try to avoid that situation - look forward to version 1.2.5 - it will come without this 'feature'.

Bye and thanks, Lars (By highno)