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.
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)
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
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
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:~ $