Skip to content
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

Not restarting after one cycle? #37

Open
A380Coding opened this issue Dec 14, 2021 · 13 comments
Open

Not restarting after one cycle? #37

A380Coding opened this issue Dec 14, 2021 · 13 comments

Comments

@A380Coding
Copy link

A380Coding commented Dec 14, 2021

I noticed that lately the presence faker node does not restart the next day.
Everything is set up and running. After a cycle is complete I get the "next cycle: " shown next to the node. But at that time, nothing happens.
I did an update of the node some days back. Not sure since when this behavior is there. I did not change anything else from my workflow.
It's a bit confusing why that is happening now and does not start the cycle again the next day.

Anything changed on the behavior of the node?

Edit: Running version 1.8.5 now

@A380Coding
Copy link
Author

I monitored the behavior today.
I'm setting the sunset and other values via input message. This is triggered by the sunset each day. Currently days are getting longer and sunset is therefore later than the sunset presently set to the presence faker node.
I saw that actually the presence faker node starts with the next cycle (in my case a off cycle). A few seconds later the new sunset triggers a new input message to the presence faker node with the new sunset time. Then the presence faker node switches to "next cycle". If I trigger the input message again, it actually starts the cycle.
For some reason the node does not like a new sunset time being set if it just started.

@A380Coding
Copy link
Author

Looks like if I already set "WindowBegin" to some value and I send a new message with a new "WindowBegin" message, it does not like that. Seems to be a timing issue if both values are close together. I now modified my workflow to avoid such cases.

@csuermann
Copy link
Owner

Hi @A380Coding!

Thanks for investigating this issue! I was wondering if you happen to have any debug output that could be useful?! If you activate the "Logging" option in the presence-faker settings, there should be a ton of helpful information appearing on the Node-RED debug tab.

@A380Coding
Copy link
Author

Hey @csuermann
I'm still looking into that and actually thought I solved it or at least had a work around. The strange thing is that on some days it works as expected and on others it does not. the cycle restarts once per day so it takes a while to check in more detail. Additionally if I change anything on the workflow it will restart everything and therefore not show the issue initially.

What I'm currenty thinking:

  1. Maybe there is an issue because I'm using multiple nodes.
  2. I'm sending a input message every night now as I thought there was an issue with that. But looks like that does not change anything.
  3. Somehow it appears that the node gets stuck after some time

I have to set up some debugging with export to a file, otherwise I'll not be able to move forward.

@A380Coding
Copy link
Author

Something strange is happening, not sure if this is connected here: I'm sending input values to the presence faker node and in the settings normally the text gets red and I can see the values that have been configured using the input message.

Message is:
{"payload":{"windowBegin":"16:49:00","windowEnd":"23:59:59","minDuration":900,"maxDuration":3600,"minCount":4,"maxCount":7,"topic":true},"_msgid":"3858f9833eef205a"}

I do not get any red text in the configuration. I activated the debug messages and actually all the information seems to be considered according to the debug output:

!!!! CONFIG OBJECT RECEIVED !!!
new windowBegin: 16:49:00
and so on.

Any idea on this?

@csuermann
Copy link
Owner

Hi @A380Coding,

I could not reproduce that problem. Could you please observe the Network activity of the Developer tools while opening up the Node details? It should show a call to Node-RED's context API similar to what's shown below. Is this call going through?

image

@A380Coding
Copy link
Author

Where should I observe that? I actually do not have any dev tools installed.
Can I check that call anywhere in node red?

@csuermann
Copy link
Owner

If you use Chrome, you should find the developer tools under 'View > Developer > Developer Tools'. Since you need to inspect the communication between the Node-RED frontend and its backend, there is no way to do this directly in Node-RED.

@A380Coding
Copy link
Author

There is a get request to the node and I get an error:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Status
401
Unauthorized

@csuermann
Copy link
Owner

Hmm, is there anything being displayed when you select the presence-faker node and then click the "Context Data" button in the sidebar?

@A380Coding
Copy link
Author

I found this one:
nodered

In the Context Data I can see the values e.g. maxCount, minCount, and so on, properly set to my values. The node as such is working with my values and if I activate the debug it shows that is receiving the right values. So it is only an optical thing.

I activated node red authentication lately, not sure when that would fit to the error message.

@csuermann
Copy link
Owner

That might be spot on, since you mentioned a 401 / Unauthorized error.

@ssillen
Copy link

ssillen commented Mar 6, 2023

I have the same issue, presence-faker is not restarting after the first cycle.
In the network monitor I get 404 error:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants