senseHAT "disconnected"

Hi, I'm a Node Red newbie and have installed a fresh updated version on my Raspberry Pi-4, which is also running on fully updated packages. I've tried to implement the basic senseHAT node with a debug node, as per instructions in tutorials. I deploy the setup and all seems well but after a brief moment the indicator on the senseHAT node goes red with status showing "disconnected".
I get the following output being continously sent to the terminal:

pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/python -u /home/pi/.node-red/node_modules/node-red-node-pi-sense-hat/sensehat.py
pam_unix(sudo:session): session opened for user root by (uid=0)
pam_unix(sudo:session): session closed for user root

What am I doing wrong? Any help appreciated in advance.

user root?

How are you starting Node-RED?

JFI I've just tested a sense-hat into my Pi4 and its seems to be working fine

Hi ukmoose, thanks for the prompt response. I'm starting NR from within the Raspbian GUI, ie; Pi > Programming > Node Red

Your right - it does fail if launched that way

Close it down and launch terminal session and it should work

cd ./node-red
node-red

Actually, it doesn't fail on me if I launch via the menu - It still says connected and it still works fine (but I only get the message in the logs once whereas you said its repeating on you so that's another difference)

Hi cymplecy, I rebooted the Pi and tried your suggestion but the SenseHAT node still shows being "disconnected".
Any other ideas?

More info. Since I re-started Node-Red from within the console, I now get the following output, which is continuously repeated:

4 Oct 13:00:48 - [info]
Welcome to Node-RED

4 Oct 13:00:48 - [info] Node-RED version: v1.0.0
4 Oct 13:00:48 - [info] Node.js version: v12.10.0
4 Oct 13:00:48 - [info] Linux 4.19.66-v7l+ arm LE
4 Oct 13:00:49 - [info] Loading palette nodes
4 Oct 13:00:50 - [info] Dashboard version 2.16.3 started at /ui
4 Oct 13:00:51 - [info] Settings file : /home/pi/.node-red/settings.js
4 Oct 13:00:51 - [info] Context store : 'default' [module=memory]
4 Oct 13:00:51 - [info] User directory : /home/pi/.node-red
4 Oct 13:00:51 - [warn] Projects disabled : editorTheme.projects.enabled=false
4 Oct 13:00:51 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
4 Oct 13:00:51 - [error] Unable to listen on http://127.0.0.1:1880/
4 Oct 13:00:51 - [error] Error: port in use
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit-code'.
nodered.service: Service RestartSec=100ms expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 122.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
4 Oct 13:00:52 - [info]
Welcome to Node-RED

4 Oct 13:00:52 - [info] Node-RED version: v1.0.0
4 Oct 13:00:52 - [info] Node.js version: v12.10.0
4 Oct 13:00:52 - [info] Linux 4.19.66-v7l+ arm LE

I don't get this when I start NR from within the GUI

The port is in use because you already have Node-RED running.

Try running the following command in the terminal
ps -auxw | grep Node

what does it list?

ukmoose, I get the following:
pi 7613 0.0 0.0 7348 520 pts/0 S+ 13:12 0:00 grep --color=auto Node

I should have added that i stopped NR with: node-red-stop

sorry try

ps -auxw | grep node

OK, Here's what I get:
pi@raspberrypi:~/.node-red $ ps -aux | grep node
pi 1090 0.0 0.1 7676 1548 pts/1 Ss+ 12:53 0:00 /bin/bash /usr/bin/node-red-start
root 1121 0.0 0.2 9952 2836 pts/1 S+ 12:53 0:00 sudo journalctl -f -n 0 -u nodered -o cat
root 1133 0.0 0.8 23244 7624 pts/1 S+ 12:53 0:00 journalctl -f -n 0 -u nodered -o cat
pi 7697 0.0 0.0 7348 580 pts/0 S+ 13:21 0:00 grep --color=auto node

So after you have run node-red-stop
you still have a process /bin/bash /usr/bin/node-red-start running??

I'd suggest running the following command
sudo systemctl disable nodered.service to stop node-red auto-running on boot, rebooting and then running ps -auxw | grep node again before doing anything else.

You also are running nodejs v12 which suggests you haven't followed the recommended way of upgrading for a raspberry pi. The recommended version of nodejs is the LTS version which is currently v10. It would be worth running the install script from https://nodered.org/docs/getting-started/raspberrypi

Thanks for that input. Just for my clarification & Understanding, wouldn't you expect to see: /bin/bash /usr/bin/node-red-start running, because the node-red-stop command just suspends the NR and you can restart it again with node-red-start. Re: the node.js, I was having problems with the version that came with my new pi and I followed the instructions that I found on the net, which loaded the latest version, ie: v12. At least by doing this all of my other problems disappeared and NR seemed to start up properly but still gives me the same pesky problem with the senseHAT.
If you'll bear with me, I'm going to suggest an intermediate step; I've rebooted the Pi and run ps -auxw | grep node (without disabling the nodered.service. I get the following:
pi@raspberrypi:~ $ ps -auxw | grep node
pi 956 0.0 0.0 7348 524 pts/0 S+ 14:31 0:00 grep --color=auto node

Does that shed some light?

Well that suggests no node-red is running. So no try starting it from the command line with as user pi.

Whilst node-red will run under v12, third party nodes may not be tested and you may run into issues.
Hence the recommendation to run the LTS version

OK, so it doesn't auto start node-red on reboot. When you say to start NR, "as user pi" ; I'm currently operating as root user. Should this make a difference?

Does the following make sense, considering that I'm the only user:
pi@raspberrypi:~ who pi tty7 2019-10-04 14:28 (:0) pi tty1 2019-10-04 14:28 pi@raspberrypi:~ users #
pi pi
pi@raspberrypi:~ $

That shows you are running as the user pi.
Which has the permissions that you should be using.

Now try running node-red-start