Arduino BLE覆盆子阅读数据

时间:2016-03-07 03:46:44

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

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

我正在使用nRF8001 HelloWorld.ino sketch

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

从RPI我可以使用gatttool并连接到Blend Micro。

问题:

  1. 如何找出不同句柄代表的内容?
  2. 我怎样才能阅读" hello world"来自gatttool?
  3. 我的最终目的是从我的dht11湿度传感器读取数据并使用d3js在websockets上显示在仪表板上。我使用串口USB连接工作正常,所以"只有#34;需要让蓝牙进入。对于Python代码,我试图使用pexpect和gatttool尽可能地使用vanilla。

    提前致谢。

    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

1 个答案:

答案 0 :(得分:0)

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

并请求句柄11的数据。 char-write-req 0x0011 0100

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

相关问题