简体   繁体   English

Python BlueZ 网布

[英]Python BlueZ Mesh

I have a Raspberry Pi 4 with the latest BlueZ (5.54) stack.我有一个带有最新 BlueZ (5.54) 堆栈的 Raspberry Pi 4。 My goal is to make a Python script which collects different sensor data (Air Quality and Temperature) via Bluetooth Mesh.我的目标是制作一个 Python 脚本,它通过蓝牙网状网络收集不同的传感器数据(空气质量和温度)。 I was googling many articles and forums but could not decide which one is the best solution.我在谷歌上搜索了许多文章和论坛,但无法确定哪一个是最佳解决方案。

Tried to find a suitable Python library like PyBluez but as I know it is not under active developement (no mesh).试图找到一个合适的 Python 库,如 PyBluez,但据我所知,它不在积极开发中(无网格)。

Another solution is to use the DBus API.另一种解决方案是使用 DBus API。

I would recommend going with the D-Bus API as this seems to be the focus of the developers我建议使用 D-Bus API,因为这似乎是开发人员关注的焦点

There are a number of D-Bus bindings for Python depending what you are looking for. Python 有许多 D-Bus 绑定,具体取决于您要查找的内容。 Many of them are listed at: https://wiki.python.org/moin/DbusExamples其中许多列在: https://wiki.python.org/moin/DbusExamples

And there are others, such as dbussy , which are based around the asyncio event loop which has been used for this example: https://github.com/SilvairGit/bluetooth-meshd-example/blob/master/meshd_example/client.py还有其他一些,例如dbussy ,它们基于已用于此示例的异步事件循环: https://github.com/SilvairGit/bluetooth-meshd-example/blob/master/meshd_example/client.py

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

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