You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-13Lines changed: 25 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,15 @@ node-red-contrib-generic-ble
3
3
4
4
A Node-RED node for providing access to generic BLE peripheral devices via GATT.
5
5
6
-
As of v4.0.0, this node is optmized for Linux with BlueZ 5.
6
+
As of v4.0.0, this node is optmized for Linux with BlueZ 5 D-Bus API (HCI socket is no longer used on Linux).
7
+
macOS and Windows should work as nothing is modified for these platforms.
7
8
8
9
Supported operations are as follows:
9
10
10
11
- Read
11
12
- Write
12
13
- Write without Response
13
-
- Notify
14
+
- Notify (Subscribing the Notify event)
14
15
15
16
In this version, the node status values are as follows:
16
17
@@ -21,40 +22,51 @@ In this version, the node status values are as follows:
21
22
-`disconnecting` when the configured BLE peripheral device is being disconnecting
22
23
-`error` when unexpected error occurs
23
24
25
+
Known issue for Linux BlueZ D-Bus API:
26
+
27
+
- It seems the local name in advertisement packet isn't transferred to `LocalName` property in org.bluez.Device1 BlueZ D-Bus API. With HCI socket implementaion, the local name was resolved. So the local name can be resolved on macOS and Windows.
28
+
24
29
# How to use
25
30
26
31
## How to configure a new BLE peripheral device
27
32
28
33
At first, drag either a `generic ble in` node or a `generic ble out` node to the workspace from the node palette and double-click the node. And you can find the following dialog. Here, click the pencil icon (`1`) to add a new BLE peripheral or edit the existing one.
29
34
30
-

35
+

31
36
32
-
Then the new config node dialog appears like this.
37
+
Then the new config node dialog appears as shown below.
33
38
34
-

39
+
The `BLE Scanning` shows whether or not BLE scanning is going on. In order to start BLE scanning, check it (`2`).
35
40
36
-
The `Scan Result` shows the scanned BLE peripherals. It can be empty when no peripherals are found.
37
-
38
-
In order for the dialog to list your device, turn BLE on prior to open the dialog. Close the dialog then re-open it if you'd like to get the latest scan result.
41
+

39
42
40
-
By default, you have to enter either MAC address or UUID manually to configure your BLE peripheral. However, by checking `Select from scan result`(`2`), you can choose the peripheral if it exists in the scan result.
43
+
As soon as you check it, `Scan Result` select box and `Apply` button appear. The scan results are automatically fufilled in the select box. The content will be refreshed every 10 seconds.
41
44
42
45

43
46
44
-
When you choose the peripheral, `GATT Characteristics` shows all characteristics discovered in it, and `Local Name`, `MAC` and `UUID`are automatically resolved as well.
47
+
Chosoe one of the listed devices and then click `Apply` to populate `Local Name`, `MAC` and `UUID`input text boxes. Clicking `Apply` button also triggers GATT characteristics discovery as well.
45
48
46
-
If you cannot find your peripheral in the `Scan Result`, you can reload the result by closing this dialog and re-opening it as described above.
49
+
The following picure shows the `Apply` button clicking result. `GATT Characteristics` has a characteristic list of the selected device. When you see `(not available)` message in the box, check if the device is NOT sleeping (a sleeping device fails to respond to connect request) and click `Apply` again.
47
50
48
-
Click `Add` (`3`) when the information on the dialog looks good.
51
+
`GATT Characteristics` must be populated as the node uses the list to verify if a given characteristic UUID is valid on performing `Read`, `Write` and `Subscribe` requests.
52
+
53
+
Click `Add` (`3`) to save the information when everything is ok.
49
54
50
55

51
56
52
-
Click `Done` (`4`) to finish the `ble in` node settings.
57
+
OK. Now back to `Generic BLE out` node.
58
+
Click `Done` (`4`) to finish the `Generic BLE out` node settings.
59
+
60
+
You can import an example flow from the menu icon(`三`) > Import > Examples > node-red-contrib-generic-ble > 01-read-write.
61
+
62
+

53
63
54
64
## How to translate gatttool command into flow
55
65
56
66
In this example, we show how to describe `gatttool` commands for characteristic value write and read with Generic BLE nodes.
57
67
68
+
**NOTICE: As of BlueZ 5, gatttool is deprecated. gatttool will be removed in the future relesase.**
69
+
58
70
### Characteristics Value Write
59
71
60
72
The following simple command line just issues a characteristic write request to the handle `0x0027`, which the BLE peripheral associates with the characteristic uuid `f000aa02-0451-4000-b000-000000000000`(uuids and handles can be listed by `gatttool -b 88:99:00:00:FF:FF --characteristics command`).
0 commit comments