Skip to content

Commit 9b070f1

Browse files
author
dbaba
committed
Merge branch 'develop' of github.com:CANDY-LINE/node-red-contrib-generic-ble into develop
2 parents ce8e05c + 1fdaabf commit 9b070f1

File tree

6 files changed

+25
-13
lines changed

6 files changed

+25
-13
lines changed

README.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ node-red-contrib-generic-ble
33

44
A Node-RED node for providing access to generic BLE peripheral devices via GATT.
55

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.
78

89
Supported operations are as follows:
910

1011
- Read
1112
- Write
1213
- Write without Response
13-
- Notify
14+
- Notify (Subscribing the Notify event)
1415

1516
In this version, the node status values are as follows:
1617

@@ -21,40 +22,51 @@ In this version, the node status values are as follows:
2122
- `disconnecting` when the configured BLE peripheral device is being disconnecting
2223
- `error` when unexpected error occurs
2324

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+
2429
# How to use
2530

2631
## How to configure a new BLE peripheral device
2732

2833
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.
2934

30-
![ble in node](images/ble1.png)
35+
![ble out node](images/ble1.png)
3136

32-
Then the new config node dialog appears like this.
37+
Then the new config node dialog appears as shown below.
3338

34-
![ble config node](images/ble2.png)
39+
The `BLE Scanning` shows whether or not BLE scanning is going on. In order to start BLE scanning, check it (`2`).
3540

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+
![ble config node](images/ble2.png)
3942

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.
4144

4245
![ble config node](images/ble3.png)
4346

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.
4548

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.
4750

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.
4954

5055
![ble config node](images/ble4.png)
5156

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+
![ble config node](images/ble5.png)
5363

5464
## How to translate gatttool command into flow
5565

5666
In this example, we show how to describe `gatttool` commands for characteristic value write and read with Generic BLE nodes.
5767

68+
**NOTICE: As of BlueZ 5, gatttool is deprecated. gatttool will be removed in the future relesase.**
69+
5870
### Characteristics Value Write
5971

6072
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`).

images/ble1.png

-1.26 KB
Loading

images/ble2.png

-8.68 KB
Loading

images/ble3.png

-51.2 KB
Loading

images/ble4.png

113 KB
Loading

images/ble5.png

72.7 KB
Loading

0 commit comments

Comments
 (0)