question

markusschwientek avatar image
markusschwientek asked

Node Red - don't get everytime "connected" notification

Hello,

I am using several Cerbo GX (HW Version 02 and 03). I've installed the node red venus-swu-einstein-20210416100626-v2.70~5-large-18.swu via usb-stick, how its described here to do:https://www.victronenergy.com/live/venus-os:large

Installation and so on is working without any problems. After reboot just sometimes I can connect to the node red interface via venus.local:1880 or IP:1880. And sometimes via VRM Remote with the ID of the Cerbo.

1) Unfortunately sometimes I can open the node red interface, and sometimes not. Then I get the notification that node red isnt installed. But it is installed and activated in the menu.

2) When its working, then just sometimes I can ad my flow (its about temperature to switch on the fans when system is getting to hot) and deploy/send to my Cerbo. Unfortunately here just sometimes happens that there will a notificatin of "connected" and sometimes not. I dont unterstand why its just sometimes working. When I change the Cerbo GX and try exactly the same procedere, its working. But then I get the next system with another Cerbo and its not working again. Attached you can find 2 pictures, how its looking like when not working (missing "connected") and when its working.

sometimes like this:

before.png

and sometimes its working like this:

after.png

Is there a dependence to the version of node red and Hardware version? I've tried also older versions of node red (16, and 10 and 12) and sometimes its working, sometimes not. Can't figure out whats wrong.

What I did after installing node red via usb stick:

1) Firmware -> online updates -> Auto update -> OFF
2) Remote control -> disable password check (do double click)
3) Remote control -> Enable on VRM -> ON
4) Remote control -> Enable on LAN -> ON
5) DVCC -> OFF
6) VRM online portal -> VRM two-way communication -> ON
7) Ethernet -> check if connected to network otherwise connect
8) I/O -> Analog inputs -> ALL OFF but temp input 1 (depends where connected)
9) I/O -> Digital inputs -> ALL OFF
10) Venus OS large features -> Node Red -> ON
Do a reboot (General -> reboot (double click)

I hope someone could help me with my 2 problems, which maybe related to each other.

Thank you.

Regards

Markus



Node-RED
before.png (26.9 KiB)
after.png (28.8 KiB)
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

4 Answers
Dirk-Jan Faber (Victron Energy) avatar image
Dirk-Jan Faber (Victron Energy) answered ·

That 40-50% is way too high, which makes me more certain that there must be something wrong in the flow. Can you provide the file /home/root/.node-red/flows_einstein.json so I can have a look at it? You can output this in the terminal by typing:

cat /home/root/.node-red/flows_einstein.json

What I think is wrong, is that the temperature node outputs 'null' because there is no temperature probe connected and the function does not handle 'null' values correctly.

8 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

markusschwientek avatar image markusschwientek commented ·

But up to now I was not able to put in my one flow, but I think its another flow which is or should be inside the node red installation. Unfortunately I get this answer:

root@einstein:~# cat /home/root/.node-red/flows_einstein.json
cat: can't open '/home/root/.node-red/flows_einstein.json': No such file or directory

right now I have the cerbo gx connected on my desk just with power supply and ethernet. but also before in the system (connected with mppts & inverter from victron) was the same.



0 Likes 0 ·
Dirk-Jan Faber (Victron Energy) avatar image Dirk-Jan Faber (Victron Energy) ♦♦ markusschwientek commented ·

This is weird. The flows file should exist. What is the output of

ls /home/root/.node-red/


0 Likes 0 ·
markusschwientek avatar image markusschwientek Dirk-Jan Faber (Victron Energy) ♦♦ commented ·

there I get this:

root@einstein:~# ls /home/root/.node-red/
node_modules settings.js user-authentication.js

0 Likes 0 ·
markusschwientek avatar image markusschwientek Dirk-Jan Faber (Victron Energy) ♦♦ commented ·

could it be that he is not installing node red correctly and something is missing?

0 Likes 0 ·
Dirk-Jan Faber (Victron Energy) avatar image Dirk-Jan Faber (Victron Energy) ♦♦ markusschwientek commented ·

That seems to be the case. I would have expected the output to be:

lib                     node_modules            package-lock.json       package.json            settings.js             user-authentication.js

Can you provide the logging of node-red?

cat /var/log/node-red/current

If you want to force node-red on Venus to reinstall all of its files, you can remove the files and directories in `/home/root/.node-red`:

rm -r /home/root/.node-red

Afterwards you need to restart node-red. In your case I would suggest doing this by rebooting the device. Note that the above command removes all of the flows you had on your system as well. (but in your case there are none)

0 Likes 0 ·
markusschwientek avatar image markusschwientek Dirk-Jan Faber (Victron Energy) ♦♦ commented ·

sure, here you have the log, but not completely, its a long list which repeats.

root@einstein:~# cat /var/log/node-red/current
@4000000060a61eb00172e72c *** Starting node-red ***
@4000000060a61eb71d49bbec Error loading settings file: /home/root/.node-red/settings.js
@4000000060a61eb71df0dd14 Error: Cannot find module 'debug'
@4000000060a61eb71fe4f09c *** Starting node-red ***
@4000000060a61ebf01df455c Error loading settings file: /home/root/.node-red/settings.js
@4000000060a61ebf02b317ec Error: Cannot find module 'debug'
@4000000060a61ebf04cf606c *** Starting node-red ***
@4000000060a61ec724dfa4d4 Error loading settings file: /home/root/.node-red/settings.js
@4000000060a61ec725a2932c Error: Cannot find module 'debug'
@4000000060a61ec7278da604 *** Starting node-red ***
@4000000060a61ecf0292bac4 Error loading settings file: /home/root/.node-red/settings.js
@4000000060a61ecf0336420c Error: Cannot find module 'debug'
@4000000060a61ecf0522a4d4 *** Starting node-red ***
@4000000060a61ed61e3aa7b4 Error loading settings file: /home/root/.node-red/settings.js
@4000000060a61ed61edee694 Error: Cannot find module 'debug'
@4000000060a61ed621124924 *** Starting node-red ***
@4000000060a61ede04fb238c Error loading settings file: /home/root/.node-red/settings.js
@4000000060a61ede05a4e494 Error: Cannot find module 'debug'
@4000000060a61ede07a1f4e4 *** Starting node-red ***
@4000000060a61ee521079eac Error loading settings file: /home/root/.node-red/settings.js
@4000000060a61ee521b12cec Error: Cannot find module 'debug'
@4000000060a61ee523a367cc *** Starting node-red ***
@4000000060a61eed025e48fc Error loading settings file: /home/root/.node-red/settings.js
@4000000060a61eed030673c4 Error: Cannot find module 'debug'
@4000000060a61eed04fd7d1c *** Starting node-red ***
@4000000060a61ef41e201ebc Error loading settings file: /home/root/.node-red/settings.js


>>

rm -r /home/root/.node-red

I removed it and did a reboot, waited for several minutes and "tara" I can connect to node red

1621500581682.png


but what to do to avoid this problem in future in general?

I think I am not the only one with this problem, I guess.

0 Likes 0 ·
1621500581682.png (15.0 KiB)
Dirk-Jan Faber (Victron Energy) avatar image Dirk-Jan Faber (Victron Energy) ♦♦ markusschwientek commented ·

I am glad that this got it solved. It looks like your system got a reboot while node-red was starting the very first time it tried to start node-red and never recovered from that. This is a bug in our node-red startup script and we need to adjust it in order to prevent this.

0 Likes 0 ·
markusschwientek avatar image markusschwientek Dirk-Jan Faber (Victron Energy) ♦♦ commented ·

very nice. Thank you (and also Mark) very very much for your great help, also to improve this nice product :)

0 Likes 0 ·
markusschwientek avatar image
markusschwientek answered ·

Regarding to my main problem of missing "connected" sign, I solved it too:

Just do copy & paste of your imported flow and delete the old one and "deploy" again on your device and its done.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Mark avatar image
Mark answered ·

Not sure if I can provide any definite answers, but:

  • After a reboot it normally takes a few minutes for Node-RED to start up and be accessible again, so be patient after a reboot. Otherwise you may have a network connection issue.


  • If you are copying flows between devices normally the Victron nodes have to be re-configured (basically just open the node and select the desired device + parameter again) and then redeploy. After that it should show that it is connected and auto re-connect upon a reboot.


7 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

markusschwientek avatar image markusschwientek commented ·

Thank you, I will try it tomorrow and inform you if it worked out.

0 Likes 0 ·
markusschwientek avatar image markusschwientek commented ·

well now I tried to install node red again and I was waiting maybe for 10 min after reboot and still can't get access to node red. I get the notification:

Error: remote installation does not seem to have a running Node Red service.

But its running on the cerbo:

1621407071099.pngI've tried to connect via VRM Remote and via IP:1880 and not possible

but connecting to the menu (see above) just with IP is working great.

0 Likes 0 ·
1621407071099.png (32.8 KiB)
Mark avatar image Mark ♦♦ markusschwientek commented ·

How are you 'reinstalling' Node-RED?

I think this same issue has occurred before with another user - if the same issue, it's related to the allocated data partition being full.

I will ask for some advice and come back to you.

But are you able/comfortable to SSH into the device with Putty or similar to check yourself?

0 Likes 0 ·
markusschwientek avatar image markusschwientek Mark ♦♦ commented ·

I just installed the "normal version" again (actual Ver.2.66 without node red) and after rebooting I've installed the ...einstein...swu again.

putty: I never tried but with a "how to do manual" I could manage to do it and check it.

thanks for checking.

Today I did an one-to-one check, it means I took 2 cerbo gx. I did exactly the same on both. both have the same hw.rev0.3 number and the same settings.

On one cerbo it worked out, but the other one had still this problem not to connect via node red (doesnt matter if vrm remote .../proxy/ or with IP:1880.

I also tried to install old versions on this cerbo, Version -10,12,16,17 but no difference.

I wrote down also the PN and SN of both if it could help you.

PN: BPP900450100 (both have the same)

SN: HQ20482LSD1 (where it works)

SN: HQ2048RX936 (where it doesnt work)

Thank you.

0 Likes 0 ·
Mark avatar image Mark ♦♦ markusschwientek commented ·

To check yourself:

0 Likes 0 ·
markusschwientek avatar image markusschwientek Mark ♦♦ commented ·

Hi, thank you. I did it, here the result:

login as: root
root@192.168.2.94's password:
Last login: Wed May 19 13:03:26 2021
root@einstein:~# df

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 927632 777800 83096 90% /
devtmpfs 465376 4 465372 0% /dev
tmpfs 515040 304 514736 0% /run
tmpfs 515040 560 514480 0% /var/volatile
/dev/mmcblk1p5 1182728 4180 1100420 0% /data
/dev/sda1 7844032 189160 7654872 2% /run/media/sda1



maybe this 90% are the reason. what should I do?

0 Likes 0 ·
Dirk-Jan Faber (Victron Energy) avatar image Dirk-Jan Faber (Victron Energy) ♦♦ markusschwientek commented ·

The 90% is probably not be the cause of the problem. There is 10% free, which should be sufficient.

What I think might cause the problem is that there is in error in the function block, causing node-red to take up too much CPU time. This is harder to check if you are not too familiar with working on the commandline, but let's see if we can get this to work.

Can you login via ssh again and type the command 'top'? This starts up a program to show the currently running processes and refreshes every 3 seconds, looking something like:


Mem: 452264K used, 577820K free, 2052K shrd, 32720K buff, 134600K cached
CPU:   8% usr   2% sys   0% nic  88% idle   0% io   0% irq   0% sirq
Load average: 0.38 0.27 0.28 3/319 5425
  PID  PPID USER     STAT   VSZ %VSZ %CPU COMMAND
 1099  1073 root     S    32188   3%   3% {vrmlogger.py} /usr/bin/python -u /opt/victronenergy/vrmlogger/vrmlogger.py
 1588  1040 root     S     188m  19%   2% node-red
 1595  1048 root     S     193m  19%   1% node /usr/lib/node_modules/signalk-server/bin/signalk-server -c /data/conf/signalk
  777   775 messageb S     3496   0%   1% dbus-daemon --system --nofork


You can exit top via ctrl-c. The node-red line is the interesting one and then the %CPU column. Can you check the CPU load for node-red? It should be around 1%. If it is consistently above 10% there must be something wrong in the flow itself.

0 Likes 0 ·
markusschwientek avatar image
markusschwientek answered ·

Hi, thank you. I used the command top, here is the result. I copied just the upper lines where is an usage of the CPU. In this node red is still no flow because up to now I could not connect to the node red interface. The usage is jumping from 0 to approx 52 %:

Mem: 279596K used, 750488K free, 1084K shrd, 8224K buff, 103400K cached







CPU: 52% usr 12% sys 0% nic 36% idle 0% io 0% irq 0% sirq



Load average: Jan 58 01. Feb 0.44 2/313 2271












PID PPID USER STAT VSZ %VSZ %CPU COMMAND










2265 926 root R 98.5m 10% 48% node /usr/lib/node_modules/node-red/re







2271 2247 root R 2684 0% 8% top










960 941 root S< 57540 6% 0% /opt/victronenergy/gui/gui #NAME? #NAME?



























PID PPID USER STAT VSZ %VSZ %CPU COMMAND










2265 926 root R 115m 11% 51% node /usr/lib/node_modules/node-red/red.js






2271 2247 root R 2776 0% 0% top










960 941 root S< 57540 6% 0% /opt/victronenergy/gui/gui #NAME? #NAME? VNC:size=480x272:depth=32:passwordFile=/data/conf/vncpassword.txt:0





















PID PPID USER STAT VSZ %VSZ %CPU COMMAND










974 951 root S 31952 3% 5% {vrmlogger.py} /usr/bin/python #NAME? /opt/victronenergy/vrmlogger/vrmlogger.py




960 941 root S< 57540 6% 0% /opt/victronenergy/gui/gui #NAME? #NAME? VNC:size=480x272:depth=32:passwordFile=/data/conf/vncpassword.txt:0





















PID PPID USER STAT VSZ %VSZ %CPU COMMAND










960 941 root S< 57540 6% 0% /opt/victronenergy/gui/gui #NAME? #NAME? VNC:size=480x272:depth=32:passwordFile=/data/conf/vncpassword.txt:0


2271 2247 root R 2776 0% 0% top





























PID PPID USER STAT VSZ %VSZ %CPU COMMAND










2317 926 root R 117m 12% 52% node /usr/lib/node_modules/node-red/red.js






2271 2247 root R 2776 0% 0% top










1619 1613 root S 3220 0% 0% /opt/victronenergy/vedirect-interface/vedirect-dbus #NAME? #NAME? 25 #NAME? 25 #NAME? 0 #NAME? -s /dev/ttyS7


after that it was ongoing like 0 or a few % and then again up to 40 - 50 % and so on.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.