简体   繁体   English

如何在Python中使用BLE通知

[英]How can I use BLE notifications in Python

I am working with sensorTags and LightBlue Beans BLE devices, but can not find a way to interact with them using notifications. 我正在使用sensorTagssensorTags LightBlue Beans BLE设备,但是找不到使用通知与它们交互的方法。 I have tried several codes in python which implements read/writes but I need to speedup the access to the sensors data. 我在python中尝试了几种实现读/写的代码,但是我需要加快对传感器数据的访问。 Any suggestion? 有什么建议吗? I'm using a raspberry based platform and python. 我正在使用基于树莓派的平台和python。

You will have an easier time using Node.js, these are actively worked on. 使用Node.js将会使您的工作更加轻松,这些都已经投入使用。

For Central devices: https://github.com/sandeepmistry/noble 对于中央设备: https : //github.com/sandeepmistry/noble

For Peripheral devices: https://github.com/sandeepmistry/bleno 对于外围设备: https : //github.com/sandeepmistry/bleno

This Gist shows how to use python-dbus to read out scratch characteristics data: https://gist.github.com/jsiverskog/0afa43225bdbe8e803cb 该要点展示了如何使用python-dbus读取暂存特征数据: https : //gist.github.com/jsiverskog/0afa43225bdbe8e803cb

From my tests it seems to be quick to react on updates in the data (of course somewhat dependent on your actual implementation on the Bean). 从我的测试看来,对数据的更新做出反应似乎很快(当然,这在某种程度上取决于您在Bean上的实际实现)。 It should provide enough information to get you going. 它应该提供足够的信息来帮助您前进。

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

相关问题 如何在python中使用pygatt从BLE设备获取通知? - How to get notifications from BLE Device using pygatt in python? 如何在 Python 中收听 Windows 10 个通知? - How can I listen to Windows 10 notifications in Python? 如何在 Python 中获取系统托盘通知列表? - How can I get a list of the System Tray notifications in Python? 如何产生通知并从函数返回结果? (Python) - How can I yield notifications and return a result from a function? (Python) 我如何安排来自 python 的 expo 通知 - how can i schedule expo notifications from python Windows环境下如何使用python扫描BLE设备与通信 - How to use python to scan and communicate with BLE device under Windows environment 我应该如何使用这个十六进制数据向设备发送 ble 命令? - How should I use this hexadecimal data to send ble command to device? 我如何使用通知上有按钮的 python 发送 Windows 10 通知 - How can i can send windows 10 notifications with python that has a button on the notification 如何读取传入的 BLE 数据? [树莓派] - How can I read incoming BLE data? [Raspberry Pi] 如何在 selenium 中自动启用通知? - How can I automatically enable notifications in selenium?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM