扫描附近的BLE设备python程序

时间:2019-06-10 12:39:19

标签: python bluetooth-lowenergy raspberry-pi3 iot beacon

扫描树莓派的信标

我尝试使用pybluez包发现错误的gatlib错误。当在RPI3中安装的gatlib再次显示相同的错误

from bluetooth.ble import DiscoveryService

service = DiscoveryService()
devices = service.discover(2)

for address, name in devices.items():
    print("name: {}, address: {}".format(name, address))
  

程序中未找到gatlib模块。

1 个答案:

答案 0 :(得分:0)

pip install gattlib应该可以工作

对于python3,请使用pip3

确保已安装诸如libbluetooth-dev,pkg-config,glib-2.0,lib-boost-python-dev,libboost-thread-dev之类的依赖项。

gattlib模块中必需的依赖项:Link

相关问题