-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Uncontrolled/unexpected node msg reception #185
Comments
Thank you. I'll try to reproduce this. Which add-on is used for the counter? |
Hi, the counter is just a simple node to increment a global when triggered, one global for each Count., the count being showed as a status. |
Understood, but which add-on provided that? I now used node-red-contrib-msg-counter and that one seems to count as I would have expected. |
I've just tested using node-red-contrib-msg-counter and still see the same issue, odd. My flow is as follows:
|
I've been thinking a bit about it and to get back to your remark:
What the node does, is send out a message every 5 seconds and on each value change. It is correct that this can result in more messages than just 1 per 5 seconds. If the value does not change, it outputs once every 5 seconds. With a gps, I can imagine that the value changes more frequently. I cannot recall that the behavior of the node changed regarding this behavior during the last updates. A limit rater can prevent this behavior. I'll keep this issue open, as it may be a good idea to also implement the limit rater within this node. |
Just making sure you are aware of https://cookbook.nodered.org/basic/rate-limit-message-stream |
I have used the delay node for this sort of purpose before. I went one better to ignore passing on any payload that is the same as the previous, thus only presenting a change downstream. I think my expectations differed to the actual implementation, hence how this thread started. If things are not to change I shall carry on using my implementation to 'rate limit', but I would still prefer to see it done at the source. However, can anyone else confirm the issue I see with the multiplus switch position, I get a lot of messages as stated, even when there is no actual change! |
The nodes respond to the dbus signals:
If the devices sends an "ItemsChanged" or "PropertiesChanged", even when there is no change (which it should not do), then the node will assume the value changed and output the value. On the commandline these signals can be made visible using I tried replicating the issue on a system here with a Multiplus-II, but there I don't see any switch position changes. Can you attach a chart graph to the node to show the points?
If the node outputs non-changing values (it does output once on each deploy), you should be seeing a lot more non-changing points in the graph. |
Attaching the graph for itemschanged does show that the value doesn't change for each message received. However, adding a graph to show the message reception count, shows that a lot of unexpected messages do arrive - over 100 per minute. You are correct that 'dbus-monitor --system path=/,member=ItemsChanged' does output a lot and is near impossible to filter. signal time=1694446020.177471 sender=org.freedesktop.DBus -> destination=:1.5913 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired and nothing more. All this is with a Multiplus, not a II though. |
The Node-RED node merely does what it happening on the dbus. Can you tell me a little bit more about the used Multiplus? Perhaps that firmware sends out the info too often. What type is it and is it running the latest firmware? |
There is a newer firmware (506), but there are no changes there regarding dbus changes. So that should not be it. |
The are no writing to multiplus switch position nodes in my flow. When I did a retest to document this issue I tested in isolation, the entirety of my flows is shown at the opening of this thread. |
I'd tried to reproduce this on a local system, but so far failed. If possible, I'd like to take a look at your system and see what is causing it. Can you enable remote support and provide your vrm id? You may also mail it to dfaber at victronenergy dot com if you don't want to provide it here. |
I'm interested in this issue as my system relies on the five seconds message rate (I'm still on a pre v3 version of Venus). Has it been resolved? Thanks. |
Hi Paul, I'm not ignoring you (honest). I am going back to basics to analysis this and my loading issues. As I am running into high CPU utilisation to the point things are breaking. This may still be due to high signal input rates, but will have a definitive answer in a couple of days. |
After 'some' modifications to my node-red and further testing I do have some results. This testing has been performed using v3.20~2. Here is an extract of my signal table, with two pairs of test input signals, one of which is configured to be a '5 second' update and one 'on change' (and rounded in case of the input voltage). Please note, and as clarified by Victron, that '5 seconds' does not guarantee one message every 5 seconds! What it means is that if the data does not change you will get one message every 5 seconds, but for each change you will also get a message!! Here are the results for an approximate 5 minute run: Explanation on table headings:
Starting with the simple case The more complicated case Overall I am seeing a bit of a mixed bag on various signals that I am dealing with in my system. Victron have raised an issue relating to the Multiplus switch position as I mentions at the top of this thread - they have confirmed an issue with the MkII dbus sending out excessive messages. As regarding other messages that I see as excessive, in a 5 minute test run my pass through logic is rejecting 52% of all victron node messages!! Although the biggest hitter is the multiplus switch position In conclusion It would be appreciated if Victron could look into the other messages that I have highlighted to confirm or deny. |
@thepaulcooper: Have you seen https://github.com/victronenergy/node-red-contrib-victron/wiki/Example-Flows#only-messages-at-regular-intervals ? If you want regular intervals, this might help. |
Hi. Thanks for that. Yes, I am very familiar with Node-Red and the possibility of using the method in the link, or indeed a Delay node set as a rate limiter. My issue is that I have 20 Victron input nodes and it seems to me to be unnecessary to have to add 20 Delay nodes to get back the previous behaviour of precisely 'one message every five seconds'. Before this change was introduced we were told that the previous behaviour would be an option, however this has been subtly changed to 'one message every five seconds plus all changes’ . That is not "backward compatibility" and breaks any previous flows that relied on precisely one message every five seconds. Yes, it is fixable with a Delay node, but why was it implemented like that?
… On 19 Sep 2023, at 10:33, Dirk-Jan Faber ***@***.***> wrote:
@thepaulcooper <https://github.com/thepaulcooper>: Have you seen https://github.com/victronenergy/node-red-contrib-victron/wiki/Example-Flows#only-messages-at-regular-intervals ? If you want regular intervals, this might help.
—
Reply to this email directly, view it on GitHub <#185 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AENQL5H6KFB4A52JN2ELWOTX3FRH7ANCNFSM6AAAAAA4QEVPSQ>.
You are receiving this because you were mentioned.
|
The technical change was due to switching from PropertiesChanged to ItemsChanged on the dbus, which causes this non-backward compatible change. This change was introduced to reduce the load on the dbus and is successfully doing that. That being said, I hear you, when you want the old behaviour back. I think I may have an idea on bringing that back to the system (adding an option to ignore the ItemsChanged messages). But that would also mean that changes that occur during the 5 seconds and return back to the value of the last reported value will be missed by your nodes. Is that acceptable? I am also curious about the use-case where the 5 second delay and no messages in between makes sense. |
Thanks for the explanation @dirkjanfaber. To be honest, for most of the 20 input nodes it won't matter if there are additional messages to the one occurring every five seconds. However where it will matter is in two areas: 1) limiting the amount of data being fed into a Chart node – no more than once every five seconds gives a fixed number of data points for a time-based chart; 2) I am calculating an average using a Smooth node – the mean over a time period is calculated from a fixed number of messages. As I said before, these examples are fixable but I was just curious why the behaviour needed to change. |
I have noticed with recent past versions and and have just confirmed using v3.10~36 that there are issues with the rate of message reception from the victron nodes.
I am finding that the '5 second' transmission rate does not work, for example I count messages received for gps speed and see a continuous stream rather than one every 5 seconds (this did work sometime back).
Another 'related' issue is with multiplus switch position, here again the 5 second rule doesn't work, but further 'on change' doesn't either. Again I see multiple messages coming in even when there is no actual switch change (and the payload is unchanged from the previous)! I believe there are other nodes at fault also.
The result of this issue is heavily loading my dashboard.
Steps to reproduce the behaviour
This is a snapshot of my test flow:

Both counts increase unexpectedly.
Hardware
Versions
The text was updated successfully, but these errors were encountered: