2010-11-16 101 views
2

我想開始開發一些工具,讓我通過藍牙在手機和計算機之間進行通信,並且我想使用Python。我安裝了python藍牙模塊(PyBluez),但它沒有檢測到我內置的BT適配器(我在東芝Satellite A300上)。PyBluez沒有檢測到內置的藍牙適配器

import bluetooth 
nearby_devices = bluetooth.discover_devices() 

print(nearby_devices) 

返回以下錯誤:

Traceback (most recent call last): 
    File "C:/Python26/bt.py", line 3, in <module> 
    nearby_devices = bluetooth.discover_devices() 
    File "C:\Python26\lib\site-packages\bluetooth\msbt.py", line 9, in discover_devices 
    return bt.discover_devices (flush_cache, lookup_names) 
IOError: No Bluetooth adapter detected 

任何幫助嗎?

+0

是的,肯定打開了,我可以通過東芝自己的BT堆棧將文件傳輸到我的筆記本電腦和手機。 – pdowling 2010-11-16 20:09:54

+1

我發佈了同樣的錯誤,但只有在沒有設備可被發現的情況下。當有設備發現它有效時,我不會收到錯誤。 – 2011-05-03 03:59:08

回答

2

PyBluez使用MS藍牙驅動程序堆棧和Widcom for Windows,對於使用BlueZ的Linux。如果您的筆記本電腦有不同的堆棧,則正常工作不正常。

1

您可以卸載驅動程序(如果可能的話),然後重新啓動Windows並讓它安裝默認驅動程序。 如果你管理它,PyBluez將會更好地工作。