Nordic UART 服务(NUS)
BLE NUS 组件提供基于 Nordic UART Service 的蓝牙低功耗 UART 接口。它可用于流式传输日志或启用与 ESPHome 的自定义双向通信。
# Example configuration entryble_nus: type: logs- type (可选, string):操作模式。取值为
logs或uart。logs流式传输 ESPHome 日志。uart提供双向通信。默认为logs。 - rx_buffer_size (可选, int):接收缓冲区的大小,以字节为单位。范围:160-8192。默认为
512。 仅对模式uart有效。 - tx_buffer_size (可选, int):发送缓冲区的大小,以字节为单位。范围:160-8192。默认为
512。 - debug (可选, mapping):用于调试 UART 集线器通信的选项,请参阅调试。
通过 BLE 连接并查看设备日志:
esphome logs d.yaml --device BLE或连接到特定的 BLE 地址:
esphome logs d.yaml --device 00:11:22:33:44:55uart 可以与 python BLE Serial 一起使用