简体   繁体   English

Python 在 Windows 上使用 gattlib 进行 BLE 扫描 10

[英]Python using gattlib for BLE Scanning on Windows 10

I want to create a BLE Connection between my Laptop (Windows 10) and a BLE Device which will be the Master.我想在我的笔记本电脑 (Windows 10) 和将成为主设备的 BLE 设备之间创建一个 BLE 连接。 I installed Bluez and I can detect Bluetooth devices like my Smartphone but no device that only supports BLE.我安装了 Bluez,我可以检测到蓝牙设备,例如我的智能手机,但没有检测到仅支持 BLE 的设备。 I want to download gattlib with pip install gattlib but I got an OSError: Not supported OS which brings me to the conclusion that I can't do it this way on Windows 10. Is there any other possibility than installing Linux on my Laptop?我想通过pip install gattlib下载 gattlib,但我得到了一个OSError: Not supported OS这让我得出结论,我不能在 Windows 上这样做 10. 除了在我的笔记本电脑上安装 Linux 之外,还有其他可能性吗?

gattlib is controlling bluez via dbus, bluez is linux only, so gattlib can't be used on windows. gattlib is basically wrapper for the dbus api of bluez in python. gattlib通过dbus控制bluez,bluez只有linux,所以gattlib不能用在windows上。gattlib基本上是python中bluez的dbus api的包装器。
use vm instead and mount your bt adapter to the vm in order to control it with bluez.请改用 vm 并将 bt 适配器安装到 vm,以便使用 bluez 控制它。 wsl isn't supporting bluez right now Windows 11 and Android - BluetoothAdapter return null wsl 现在不支持 bluez Windows 11 和 Android - 蓝牙适配器返回 null

The operating you are using is not compatible.您使用的操作不兼容。 Gattlib only work with linux due to it relying on bluez whcih work on linux only. Gattlib 仅适用于 linux,因为它依赖于仅适用于 linux 的 bluez。 What you can do is using WSL on windows.您可以做的是在 Windows 上使用WSL

As far as I know, gattlib is designed for linux and debian system so you can use another one.据我所知,gattlib 是为 linux 和 debian 系统设计的,因此您可以使用另一个系统。 Another side, if you are using a Python version greater than 3.9, you can directly Bluetooth RFCOMM Support for Windows 10.另一方面,如果你使用的是Python版本大于3.9,可以直接蓝牙RFCOMM支持Windows 10。

I think you can find a solution by using "vmware" or "virtualbox" programs.我认为您可以通过使用“vmware”或“virtualbox”程序找到解决方案。 i tested for you enter image description here我为您测试过在此处输入图片描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM