2016-03-02 14:25:52 +01:00
|
|
|
node-red-node-physical-web
|
|
|
|
==========================
|
2015-11-23 16:24:26 +01:00
|
|
|
|
2016-03-02 14:25:52 +01:00
|
|
|
Nodes to allow Node-RED to act as an Eddystone BLE beacon.
|
2015-11-23 16:24:26 +01:00
|
|
|
|
2016-03-02 22:57:53 +01:00
|
|
|
Prerequisites
|
|
|
|
-------------
|
|
|
|
|
|
|
|
You will need a suitable Bluetooth Low Energy (BLE) stack and drivers for your hardware
|
|
|
|
- for example Bluez 5.2.x or better.
|
|
|
|
|
|
|
|
#### Raspberry Pi
|
|
|
|
|
|
|
|
Install Bluetooth drivers and bluez stack, and set executeable by non-root user
|
|
|
|
|
|
|
|
sudo apt-get install libbluetooth-dev libudev-dev pi-bluetooth
|
|
|
|
sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
|
|
|
|
|
|
|
|
#### Linux / OSX / Windows
|
|
|
|
|
|
|
|
Follow **just** the pre-reqs for [noble here](https://github.com/sandeepmistry/noble).
|
|
|
|
|
2016-03-02 14:25:52 +01:00
|
|
|
Install
|
|
|
|
-------
|
2015-11-23 16:24:26 +01:00
|
|
|
|
2016-03-02 14:25:52 +01:00
|
|
|
Run the following command in your Node-RED user directory - typically `~/.node-red`
|
|
|
|
|
2016-03-02 22:57:53 +01:00
|
|
|
npm i node-red-node-physical-web
|
2016-03-02 14:25:52 +01:00
|
|
|
|
|
|
|
Then on Linux follow these instructions:
|
2015-11-23 16:24:26 +01:00
|
|
|
|
|
|
|
https://github.com/sandeepmistry/bleno#running-on-linux
|
|
|
|
|
|
|
|
|
2016-03-02 14:25:52 +01:00
|
|
|
Usage
|
|
|
|
-----
|
2015-11-23 16:24:26 +01:00
|
|
|
|
2016-03-02 14:25:52 +01:00
|
|
|
### Physical-Web Out
|
2015-11-23 16:24:26 +01:00
|
|
|
|
2016-03-02 14:25:52 +01:00
|
|
|
A node to allow Node-RED to act as an Eddystone beacon broadcasting URLs
|
2015-11-23 16:24:26 +01:00
|
|
|
|
2016-03-02 14:25:52 +01:00
|
|
|
The config window lets you set the initial URL, announcement power and period for the Eddystone.
|
2015-11-23 16:24:26 +01:00
|
|
|
|
2016-03-02 22:57:53 +01:00
|
|
|
Any messages received will update the advertised URL from the `msg.payload`
|
2015-11-23 16:24:26 +01:00
|
|
|
|
2016-03-02 22:57:53 +01:00
|
|
|
### Physical-Web In
|
2015-11-23 16:24:26 +01:00
|
|
|
|
|
|
|
A node to scan for local Eddystones and output information about discovered URLs and TLM data.
|
|
|
|
|
|
|
|
Two types of messages will be emitted:
|
|
|
|
|
2016-03-02 14:25:52 +01:00
|
|
|
- **URL**
|
2015-11-23 16:24:26 +01:00
|
|
|
- *type* - Eddystone type
|
|
|
|
- *txPower* - Received power at 0m in dBm
|
|
|
|
- *url* - The URL the beacon is broadcasting
|
|
|
|
- *tlm* - TLM data, if the device is interleaving broadcasts
|
|
|
|
- *rssi* - RSSI of the beacon
|
|
|
|
- *distance* - Estimated distance to the beacon
|
2016-03-02 14:25:52 +01:00
|
|
|
|
|
|
|
- **UID**
|
2015-11-23 16:24:26 +01:00
|
|
|
- *type* - Eddystone type
|
|
|
|
- *txPower* - Received power at 0m in dBm
|
2016-03-02 14:25:52 +01:00
|
|
|
- *namespace* - 10-byte ID of namespace
|
|
|
|
- *instance* - 6-byte ID instance
|
2015-11-23 16:24:26 +01:00
|
|
|
- *tlm* - TLM data, if the device is interleaving broadcasts
|
|
|
|
- *rssi* - RSSI of the beacon
|
|
|
|
- *distance* - Estimated distance to the beacon
|
|
|
|
|
|
|
|
Where the tlm data will be in the following format
|
|
|
|
|
2016-03-02 14:25:52 +01:00
|
|
|
- **tlm**
|
2015-12-01 17:17:44 +01:00
|
|
|
- *version* - TLM version
|
2015-11-23 16:24:26 +01:00
|
|
|
- *vbatt* - Battery Voltage
|
|
|
|
- *temp* - Temperature
|
|
|
|
- *advCnt* - Advertising PDU count
|
|
|
|
- *secCnt* - Time since power on or reboot
|
|
|
|
- *rssi* - RSSI of the beacon
|
|
|
|
- *distance* - Estimated distance to the beacon
|