The warning on the function is because of the ">!" however it works perfectly as expected any single value peak high or low is not send as msg.payload.
> var tst = 40
> tst >! 50
true
> var tst = 60
> tst >! 50
true
> var tst = 50
> tst >! 50
true--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/12922595-dcc3-47c3-a8e2-492b5297b8d7%40googlegroups.com.
Seemed that the 5V pin on my Raspberry wasn't sufficient: was only about 4,8 Volt and not stable.
After replacing it by a decent stable 5V lab power supply, it became very accurate (about 1 cm tolerance).
Have been testing it at the time being on about 5 different SR04 sensors, and they were all stable afterwards.
But I see that you are already using an external power supply...
A collegue of mine also had similar issues, and he solved it by adding an extra 470 nF ceramic capacitor between Vcc and ground.
At the time I had the problems, I also have been looking at the RPI-GPIO Python code.
However I didn't find anything useful.
The only thing I found: when the Raspberry is heavily loaded, it might take too long before NodeJs handles the events, so the timing between the trigger and echo pulses is being messed up.
Good luck with it !
Bart
Thanks Bart