Inject node doesnt execute properly

Hi all,

I am running into a problem I haven't seen before. I am using an inject node to trigger every 4 seconds, however the inject node triggers at seemingly random intervals, I included a screenshot to show the timestamps of the messages. I am running node-red v3.1.3 on android (Galaxy s8) using Termux.


Please see the image above.
Does anyone know why this is happening? My time settings on my android device are correct.

Android is notorious for power saving and some devices timings can be off, Is the wake lock held? or any device sleep or battery saving enabled?

If this is not the issue please supply a example flow showing the issue.

If you set it to 60 seconds are they better?

The Galaxy s8 is quite an age now. I fired mine up recently and it was hella slow. I would not be surprised if it is simply overworked and starving the terminal and node and node-red of CPU cycles.

Failing that, you have some loop or very heavy workload in your flows causing an issue.

You could try node-red-contrib-cron-plus as a comparison.

I came home and indeed I did not enable the wake lock in Termux. After I did node-red started working so much smoother and my inject nodes work properly again. As you can see in the screenshot there is a temperature being pulled from an API every 5 minutes, before the wake lock it barely worked and now its very consistent:
image
Also before enabling the wake lock the node-red dashboard was very slow and kept reloading the page. Thats also gone now, the whole process must have been running on only a fraction of the available processing power. Regarding @Steve-Mcl 's comment, even though the s8 is an old phone I think it might still have more processing power than for example a raspberry pi 4 so I couldnt imagine that being the problem. Thanks for the help everyone!

Sorry to interject here, but......

Yeah, it may have the same sized engine, but the phone has a lot of other stuff / overheads which you can't control and MAY be reducing the available power to you to get things done.

Thats true ofcourse. There is no way to say for sure how much actual power node-red is receiving. Its a factory reset phone with as much bloatware removed and just has Termux running node-red on it so I hope most of the processing power is made available for node-red. Especially because most other processes should be in deep sleep. Either way, everything is running smoothly now.

I used Termux on Android 2-3 years ago, but I migrated to Raspberry. At that time, it was not possible to install NodeJS higher than 14 (version 16 was also available).
Which version of NodeJS did you manage to install now?

I run a android tv box on nodejs 22, and old htc one on 22 also. both run node-red 4.0.3, Installed termux from fdroid.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.