Updated 2023-10-30 ! OK with Bookworm ! New simple install !
Having used Node-Red(NR) on Raspberry Pi before, the first application was this dashboard. Tested and works with with Node.js V18 !
Installing
Update OS
Always start updating with sudo apt update && sudo apt full-upgrade -y && sudo apt clean
NodeRed install ?
Check Bluetooth
Check the interface with
hciconfig
Installing necessary SW
Dependencies
sudo apt install libbluetooth-dev libudev-dev
Grant the node binary "cap_net_raw" privileges, so it can start/stop BLE advertising, with command
sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)
cd ~/.node-red
npm install @abandonware/noble
npm install @abandonware/noble
Via the NR GUI install node-red-contrib-ble-sense.
Restart NR!!!
sudo systemctl restart nodered
and check the installed Node via the NR GUI. It will appear in the Node list below "BLE Sense", named BLE Scanner.Remarks
Received data
Please note that you can receive several broadcasts from the same sensor during the 5 seconds of scan.
Received data
Please note that you can receive several broadcasts from the same sensor during the 5 seconds of scan.
More than one Ruuvi Tag ?
The flow works for ONE tag ! If you want to receive several tags distinguish on the value mac which is the individual MAC id. A switch node could be one way to handle it ?!
The flow works for ONE tag ! If you want to receive several tags distinguish on the value mac which is the individual MAC id. A switch node could be one way to handle it ?!
Error
If you get, after for example an upgrade, "Unable to start BLE scan" in the RPi syslog run the "setcap" command mentioned above.
If you get, after for example an upgrade, "Unable to start BLE scan" in the RPi syslog run the "setcap" command mentioned above.
Check this post to get som more info at errors.
Ruuvi station app
With the iOS app you now can update the firmware in the Ruuvi TAG.
With the iOS app you now can update the firmware in the Ruuvi TAG.
99040510604390c68c0034ffcc0418a1b6044230c9ea85c7aacb
is an output caught after the scan node. The 05 direct after 9904 is the code for the dataformat.
Old flow
Install dependencies
sudo apt install libbluetooth-dev libudev-dev git
Install thenoble
package, the latest updated node-red-contrib-noble
node and thenode-red-contrib-ruuvitag
node
cd ~/.node-red
npm install @abandonware/noble
npm install MatsA/node-red-contrib-noble
npm install ojousima/node-red
npm install @abandonware/noble
npm install MatsA/node-red-contrib-noble
npm install ojousima/node-red
Restart NR,
The NR flow(RuuviTag_old.json), shown dashboard above, can be downloaded from GitHub.
sudo systemctl restart nodered
, and check the installed Nodes via the NR GUI. It will appear in the Node list below "advanced", named scan ble and ruuvitag.The NR flow(RuuviTag_old.json), shown dashboard above, can be downloaded from GitHub.
Hi,
ReplyDeleteNice tutorial. Do you know how this would work with Open-plotter v2 and embedded Node-red?
...think the best way is to use the SignalK Ruuvi plugin. https://www.npmjs.com/package/signalk-ruuvitag-plugin
DeleteThank you for your quick reply. I have to try that next...
ReplyDeleteI have several Ruuvi tags and now installing this flow. But come to a problem in the last step for "The Node-Red flow, shown dashboard above, can be downloaded from GitHub. "
ReplyDeleteHow to make that last step? I don't have enough knowledge on how to do that step to get the visual interface loaded. Could you please give a bit help!
OK. Click on the link which will take you to Github. Click on the file name "RuuviTag.json". Click on "Raw" and copy the displayed text. In NodeRed "Meny=>Import=>Clipboard" paste the flow. "Import to=>New flow". Enjoy !
DeleteThanks for help.
ReplyDeleteManaged to set up the dashboard, but how to include multiple tags?
Now the dashboard randomly scans through all tags and shows some. But how to control the flow such that tags are identified and on the dashboard shown the tags name (based on mac or uuid...)? Listing long uuid's on ScanBLE node seems not to work. And then still the identification part....
Nice you made it! As said above, use "peripheralUuid" to map to your own id like, fridge, dining room....
Delete