【问题标题】:Arduino BLE Raspberry reading dataArduino BLE Raspberry 读取数据
【发布时间】:2016-03-07 03:46:43
【问题描述】:

尝试通过 BLE 从 Redbear Blend Micro Arduino 板向 Raspberry Pi (Raspian) bluez 5.37 发送数据。

我正在使用nRF8001 HelloWorld.ino sketch

如果在 Android 上运行 Redbear BLE 控制器应用程序,我可以收到“Hello World”。

通过 RPI,我可以使用 gatttool 并连接到 Blend Micro。

问题:

  1. 我怎样才能知道不同的句柄代表什么?
  2. 如何从 gatttool 读取“hello world”?

我的最终目的是从我的 dht11 湿度传感器读取数据,并使用 d3js over websockets 显示在仪表板上。我让链条可以在串行 USB 上正常工作,所以“只”需要让蓝牙正常工作。对于 Python 代码,我尝试使用 pexpect 和 gatttool 尽可能地简化。

提前致谢。

pi@raspberrypi:~ $ sudo gatttool -b EC:EA:FA:D8:F9:77 -t random -I [EC:EA:FA:D8:F9:77][LE]> connect Attempting to connect to EC:EA:FA:D8:F9:77 Connection successful [EC:EA:FA:D8:F9:77][LE]> primary attr handle: 0x0001, end grp handle: 0x0007 uuid: 00001800-0000-1000-8000-00805f9b34fb attr handle: 0x0008, end grp handle: 0x000b uuid: 00001801-0000-1000-8000-00805f9b34fb attr handle: 0x000c, end grp handle: 0x0011 uuid: 713d0000-503e-4c75-ba94-3148f18d941e attr handle: 0x0012, end grp handle: 0xffff uuid: 0000180a-0000-1000-8000-00805f9b34fb [EC:EA:FA:D8:F9:77][LE]> char-desc handle: 0x0001, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x0002, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb handle: 0x0004, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0005, uuid: 00002a01-0000-1000-8000-00805f9b34fb handle: 0x0006, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0007, uuid: 00002a04-0000-1000-8000-00805f9b34fb handle: 0x0008, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x0009, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x000a, uuid: 00002a05-0000-1000-8000-00805f9b34fb handle: 0x000b, uuid: 00002902-0000-1000-8000-00805f9b34fb handle: 0x000c, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x000d, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x000e, uuid: 713d0003-503e-4c75-ba94-3148f18d941e handle: 0x000f, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0010, uuid: 713d0002-503e-4c75-ba94-3148f18d941e handle: 0x0011, uuid: 00002902-0000-1000-8000-00805f9b34fb handle: 0x0012, uuid: 00002800-0000-1000-8000-00805f9b34fb handle: 0x0013, uuid: 00002803-0000-1000-8000-00805f9b34fb handle: 0x0014, uuid: 00002a27-0000-1000-8000-00805f9b34fb

【问题讨论】:

    标签: arduino raspberry-pi raspberry-pi2 bluetooth-lowenergy


    【解决方案1】:

    能够通过读取句柄 3 来读取设备名称。 char-read-hand 0x00003

    并且还从句柄 11 请求数据。 字符写入请求 0x0011 0100

    仍在试图弄清楚所有句柄代表什么。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-01
      • 2013-08-21
      相关资源
      最近更新 更多