Can't locate Setting file

Hello,

I'm using Armbian on Orange Pi Zero and have Node-red running as a server for a healthy 6 months.

To cut a long story short, I had to reinstall everything only to encouter the following at startup problem:

root@orangepizero:~# node-red -start
28 Apr 15:18:03 - [info]

Welcome to Node-RED

28 Apr 15:18:03 - [info] Node-RED version: v1.0.6
28 Apr 15:18:03 - [info] Node.js version: v10.15.2
28 Apr 15:18:03 - [info] Linux 5.4.20-sunxi arm LE
28 Apr 15:18:10 - [info] Loading palette nodes
28 Apr 15:18:17 - [info] Dashboard version 2.21.0 started at /ui
28 Apr 15:18:18 - [info] Settings file : /root/.node-red/settings.js
28 Apr 15:18:18 - [info] Context store : 'default' [module=memory]
28 Apr 15:18:18 - [info] User directory : /root/.node-red
28 Apr 15:18:18 - [warn] Projects disabled : editorTheme.projects.enabled=false
28 Apr 15:18:18 - [info] Flows file : /root/.node-red/flows_orangepizero.json
28 Apr 15:18:18 - [warn]


Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.

28 Apr 15:18:18 - [info] Starting flows
28 Apr 15:18:19 - [info] Started flows
28 Apr 15:18:19 - [info] [mqtt-broker:mqtt] Connection failed to broker: mqtt://localhost:1883
28 Apr 15:18:19 - [error] Unable to listen on http://127.0.0.1:1880/
28 Apr 15:18:19 - [error] Error: port in use

So, I did this:

root@orangepizero:~# netstat -ltup
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN 937/sshd
tcp 0 0 0.0.0.0:1880 0.0.0.0:* LISTEN 1343/node-red
tcp6 0 0 [::]:ssh [::]:* LISTEN 937/sshd
udp 0 0 localhost:323 0.0.0.0:* 905/chronyd
udp 0 0 0.0.0.0:bootpc 0.0.0.0:* 1017/dhclient
udp6 0 0 localhost:323 [::]:* 905/chronyd

followed by,
root@orangepizero:~# killall node-red

and node-red -start
and back to square one.

So I decided to check for setting file by

root@orangepizero:~# find / -name settings.js
/root/.node-red/settings.js
/usr/local/lib/node_modules/node-red/settings.js
/usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/settings.js
/usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/storage/localfilesystem/settings.js
/usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/api/settings.js
/usr/local/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/settings.js

and picked the First one, and to my surprise, there was nothing under \root

Since I'm a beginner in Linux, I'm puzzled and have no clue what to do next.

So I appreciate any help.

Thanks.

p.s. When running design view (http://192.168.1.11:1880/#flow/94dde7f4.01f478) on node-red under windows browser, all nodes display 'connecting' as expected.

That should be node-red-start, no spaces.
To stop node red use node-red-stop.
If those don't work then tell us how you installed node-red. Note that it is generally considered a bad idea to run node-red as root, generally it should run as a user so you can't accidentally write all over the operating system.

Colin:
root@orangepizero:/# node-red-start
node-red-start: command not found
root@orangepizero:/# node-red-stop
node-red-stop: command not found

I have installed it as per this site: https://agrinode.github.io/docs/install_nodered_orangepi/

I agree on your note regarding running as root user.

So, what's the directorylisting from your root homedir?

cd ~
root@yourserver:~# ls -lah

Check to see if there's a .node-red directory

cd .node-red/

root@yourserver:~#/.node-red$ ls -lah
total 196K
drwxr-xr-x 7 red red 4.0K Apr 24 14:47 .
drwxr-xr-x 7 red red 4.0K Apr 6 16:30 ..
drwxr-xr-x 2 red red 4.0K Mar 24 15:01 certs
-rw-r--r-- 1 red red 19K Apr 24 14:47 .config.json
-rw-r--r-- 1 red red 19K Apr 24 14:32 .config.json.backup
-rw-r--r-- 1 red red 44 Mar 24 16:07 flows_www_cred.json
-rw-r--r-- 1 red red 83 Mar 24 16:07 flows_www.json
-rw-r--r-- 1 red red 265 Mar 24 16:07 .flows_www.json.backup
drwxr-xr-x 3 red red 4.0K Mar 24 11:29 lib
drwxr-xr-x 192 red red 4.0K Apr 24 14:32 node_modules
-rw-r--r-- 1 red red 459 Apr 24 14:32 package.json
-rw-r--r-- 1 red red 73K Apr 24 14:32 package-lock.json
drwxr-xr-x 4 red red 4.0K Mar 24 16:16 projects
-rw-r--r-- 1 red red 715 Apr 28 14:49 .sessions.json
-rw-r--r-- 1 red red 14K Mar 24 16:50 settings.js
-rw-r--r-- 1 red red 13K Mar 24 14:31 settings.original
drwxr-xr-x 2 red red 4.0K Mar 24 17:13 static

Here you should find your settings file.

Well that is why node-red-start and stop don't work. It is horrible running as root just to get access to the pins. That should just be a matter of making sure that the user is in the appropriate group, but I don't know much about armbian so can't comment further on that. Presumably you set up the start on boot which is why it is already running. If so then you should be able to start and stop node red as a service using

sudo systemctl stop nodered
sudo systemctl start nodered

It will probably log to syslog when running as a service. To run it in a terminal stop the service then run node-red to start it in a terminal. It will stop when you break out.

onbekende: That is a direct answer. Thanks.
Colin: Thanks for your input.

So I'll install a clean copy of Armbian and try (https://nodered.org/docs/getting-started/local#installing-with-npm) based on the new information and see what happens.

cheers.

As it is Debian based, maybe try the pi install script first

Update: After a complete installation nothing changed.

So I installed mosquitto and voila.

Thank you all for your support.

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