PiSense HAT Disconnected - both ends!

#1

Hello,

The "connection lost" issue at https://discourse.nodered.org/t/node-red-connection-lost/1724 does not apply to my situation. I'm using node (v11.6.0) and npm (6.5.0-next.0) and stretch will all updates/upgrades applied on RPi3.

Both PiSense HAT nodes (in and out) display "disconnected" status message after "some" random period. Node-RED is running as a service per official documentation. Other related nodes, Wunderground, Inject (fixed periodicity) and others, are working fine per my understanding. Even if I close the browser, PiSense HAT nodes stop transmitting/receiving (per respective node) after a while.

I am probably making a basic mistake. It is very elementary linear PiSense HAT flow. What should I look for in the logs?

Thanks.

P.S. Getting back to Node-RED after an year's absence and it shows! :slight_smile: Still need to fix the Twitter node at my end.

0 Likes

#2

Were you aware that v8.x is the recommended version of node.js with node-RED? I don't think it very likely that this is the cause of your problem but still, dropping back to the supported version would be my first action just in case.

0 Likes

#3

Thanks, Colin. I'll give it a try. Rgds.

0 Likes

#4

Hello Colin,

Just an update to complete the loop (and to close my original post in case it helps others).

I downgraded the versions (per your suggestion) but the problem persisted. I reverted back to my prior version and disconnected the PiSenseHAT display node. No further issue with the input node (for some inexplicable understanding at my end). I have had continuous feed from PiSenseHAT to the Dashboard nodes for the last six days. Since I am uncomfortable with the PiSense display (via node sadly but works wonderfully with Python code), I will simply focus on improving my Node-RED skills with other widgets for now.

Thanks once again for stepping in to respond and to provide a positive suggestion (as you always do). Regards.

0 Likes

#5

For what it's worth, I just upgraded my pi using a sense hat to NR 0.19.5 and for the moment see no problem with the PiSense.

Were you seeing and/or reading something from the hat?

0 Likes

#6

Ok, I have reproduced this :grinning: but don't know the exact steps to reproduce it :confused:. It seems that some event (I was sending different things to the LEDs) caused the session to close and it reopened right away but in the flow editor, the node shows a red dot and the word Disconnected even though it still works.
sensehat
what makes it more interesting is that if I do something to modify the flow - like edit the node and give it a name or add a debug to the flow - the Sense Hat node is attached to, it goes back to a green dot and Connected. In this image you see two of the Sense Hat nodes are now connected and the last is not - which makes a sense (no pun intended) since I have deploy set to 'Modified Flows'.
sensehat2
Here is the startup log to the point where the issue occurs

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.48.222:1880
On Pi Node-RED works better with the Firefox or Chrome browser
 
Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot
 
To find more nodes and example flows - go to http://flows.nodered.org
 
Starting as a systemd service.
Started Node-RED graphical event wiring tool.
25 Jan 03:44:32 - [info]
Welcome to Node-RED
===================
25 Jan 03:44:32 - [info] Node-RED version: v0.19.5
25 Jan 03:44:32 - [info] Node.js  version: v8.15.0
25 Jan 03:44:32 - [info] Linux 4.14.79-v7+ arm LE
25 Jan 03:44:34 - [info] Loading palette nodes
25 Jan 03:44:50 - [info] Dashboard version 2.9.4 started at /ui
25 Jan 03:44:52 - [info] Settings file  : /home/pi/.node-red/settings.js
25 Jan 03:44:52 - [info] Context store  : 'default' [module=memory]
25 Jan 03:44:52 - [info] User directory : /home/pi/.node-red
25 Jan 03:44:52 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
25 Jan 03:44:52 - [info] Flows file     : /home/pi/.node-red/flows_arduino.json
25 Jan 03:44:52 - [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.
---------------------------------------------------------------------
25 Jan 03:44:52 - [info] Starting flows
      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)
25 Jan 03:44:52 - [info] Started flows
25 Jan 03:44:52 - [info] Server now running at http://127.0.0.1:1880/
 25 Jan 03:51:37 - [info] Stopping modified flows
25 Jan 03:51:37 - [info] Stopped modified flows
25 Jan 03:51:37 - [info] Starting modified flows
25 Jan 03:51:37 - [info] Started modified flows
25 Jan 03:51:56 - [info] Stopping modified flows
25 Jan 03:51:56 - [info] Stopped modified flows
25 Jan 03:51:56 - [info] Starting modified flows
25 Jan 03:51:56 - [info] Started modified flows
pam_unix(sudo:session): session closed for user root
      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)

0 Likes

#7

Thanks for the detailed information. As a newbie, every little bit helps me to understand Node-RED a little bit more. Your details will help me positively.

I could not get:

  • Text to scroll (even I used exactly the same string as in the doc)
  • Couldn't sequence multiple frames the 8x8 LED display (of course, comparison to equivalent Python is unfair)

Since the Dashboard widgets are doing their job, I have one less reason to blink LEDs. It has been eight days now since I resumed the PiSense HAT feed and there has no gap in the Dashboard line charts (unlike previously). The only bell/whistle that I would like to see would be some user setting to stream the payload at any reasonable user specified interval. Right now I have to use a downstream node for this purpose - not an issue at all because I got to experience the two ways to filter messages.

Regards.

0 Likes