Node-RED Node

Hi, I am having the same issue. The best hint I found so far is https://github.com/nodejs/help/issues/1051#issuecomment-354811768 but I do not intend to change those settings.

Did you eventually came across a solution?

Hi, for all of you having issues with the node-red-contrib-noble under Node 10,12,13 use this version:

2 Likes

Hi, I did the setup on a RPI3B+ running the latest Raspian following the instructions on https://github.com/ojousima/node-red.

The problem I came across was that after some days no more values were received and the Node-Red logs showed messages like Unable to start BLE scan. Adapter state: unknown.

The simple “fix” that worked for me was to create a bash script that does basically nothing else than execute the command
node-red-restart
once a day via crontab. Haven’t had issues after so far. So wanted to share this as it may be helpful for some of you.

I will put this here, because I had to reinstall Raspbian and struggled with this again.
This worked for me:

sudo setcap cap_net_raw,cap_net_admin+eip $(eval readlink -f `which node`)
sudo systemctl restart nodered

Hey!

Anyone having a problem with scan-loop working for a while and then just stops at “Started” state.

My flow looks like this:

It works flawlessly for usually few hours or might even go further but then always at some point the loop gets stuck on “Started” and never changes to stopped. Even if I try to inject the node myself from the inject-node button, it doesnt change.

Here’s my flow, has been running for years.

edit:
try this one is zipped.

flows.json.zip (1.0 KB)

Thanks for sharing but this flow seems to be faulty somehow. Cannot import to node-red for some reason! :smiley:

Hey! Thanks for the zip. This one can be imported without problems.

However, it also gets stuck the same way as my previous… So it seems like the problem is maybe in the Scan Ble node or some other part of the system.

What version of contrib-noble are you using on your working system?

My setup on pi zero w.
setup.zip (394 Bytes)

Hi, I have a same kind of problem. It does not stop suddenly, but it won’t start after reboot or restart. It stay “Started” state after reboot and start working only after redeploy the flow. Have you got fixed your system?

Hey! I didnt get it working even tho trying lots of things. I think the Scan BLE node is broken somehow in newer systems. It seems to be updated 4 years ago so I think it is not in the best shape.
I dumped the whole node-thingy and just made my own Python script for reading the data.

Did a post for a year ago, mentioned earlier in this thread, https://pysselilivet.blogspot.com/2019/10/ruuvitag-and-node-red.html Just did a check and it still works with Node-Red !!

Mine worked log time ago, then I didn’t use NR as RT reader. Now I started using it again and tried different solutions, finally this “pysseliivet” blog solution started to work. I have few questions.

  1. It didn’t start immediately, yes there is one minute delay, but it took longer, few minutes until measurements started to come. What could be reason for this behaviour? Because first I thought it didn’t work.
  2. I put debug also before RT node and noticed that there comes quite many BLE messages. How RT node knows which one is RT device?

Thats all, it works like charm now

That linked blog post seems to use my proof-of-concept node. I probably am checking for sequence 0xFF9904 in the data, i.e. “Manufacturer specific data field, manufacturer Ruuvi Innovations” and then check if there is a header used in official Ruuvi firmwares.

ok and thanks, I looked Advertisement object and it starts with [0]0x99 [1]0x4.
If that is PoC version, is there improved version then?

What is the meaning of Tx power? I know it is transmission power but are some values good or bad? Mine is “TxPower -18 dB”

I made telegram alarm when battery voltage is too low, but what is too low voltage level?

I think I saw some other Ruuvi node too, but can’t remember.

Transmission power of RuuviTags is fixed to +4 dBm in most firmwares, if the parser really is node-red/ruuvi-node/ruuvitag.js at 5cd7d968c2f9f3bd3cbb7f41d3fa057cab653d67 ¡ ojousima/node-red ¡ GitHub there is a bug. it should be

let txpower = ((parseInt(powerInfoString, 16) & 0x001F) * 2) - 40;

Depends on firmware and temperature, 2.0 V is a good guess. Most reliable way of detecting low battery is reboots, which shows up as MeasurementSequenceCounter resetting to zero.

I changed in ruuvitag.js
let txpower = (parseInt((powerInfoString, 16) & 0x001F) * 2) - 40; // dB > -40
at /home/pi/.node-red/node_modules/node-red-contrib-ruuvitag/ruuvi-node
and restarted node-red. Now TxPower is -8?

Thanks for other responses

Can you get the associated raw data?

this?
0: 0x99
1: 0x4
2: 0x5
3: 0x11
4: 0xac
5: 0x2f
6: 0x20
7: 0xc0
8: 0xb4
9: 0xff
10: 0xf4
11: 0xff
12: 0xf8
13: 0x3
14: 0xfc
15: 0xaa
16: 0xb6
17: 0x9b
18: 0x6b
19: 0x2f
20: 0xd6
21: 0x19
22: 0x8f
23: 0xe1
24: 0xe4
25: 0x7

Yes,

These should match to power bytes. 0xaab6 → 10101010101 10110
Voltage: 10101010101 → 1365 (base 10) → voltage = 1365 + 1600 mv = 2965 mV, → Battery is ok.

10110 → 22 → (22 * 2) - 40 = 4 dB.

I take it that there still is some bug in the tx power calculation, but I don’t spot it right away.