Harsch-Systems / node-red-contrib-pi-plates

Control Pi-Plates from Node-RED
Apache License 2.0
6 stars 7 forks source link

black screen after installing node-red-contrib-pi-plates #11

Closed poly-experimental closed 3 years ago

poly-experimental commented 3 years ago

Hi Mike and thanks for this cool software. I have a new raspberry pi 4 4gb and a new DAQCplate. After going through the setup I attempt to start node red and get a full black screen with a cursor at the upper left corner of the display. The mouse continues to work and I can see the pointer on the black screen but nothing else but that and the cursor. At that point I can do alt+ctl+f2 to get a console and login. Then "startx" gets me back to the desktop where things seem to function as normal (I'm able to connect to the daqcplate with the already started node-red instance or python and issue commands). My setup is as follows: raspberry pi OS: release date 12-2-2020 kernel verion 5.4 node-red version v1.0.6 node.js version v10.21.0 Steps after writing new raspberry pi OS to microSD card: enable SPI with "raspberry pi configuration" issue command at cli: sudo pip3 install pi-plates set DAQCplate address with jumpers at this point everything works normal and no black screen when starting node-red but black screen will result on node-red startup once I issue this command in /home/pi/.node-red: npm install node-red-contrib-pi-plates edit: I should also mention that if I issue the command: npm uninstall node-red-contrib-pi-plates the blacked out screen goes away and node-red starts normally. Any help is appreciated.

poly-experimental commented 3 years ago

One more thing in case it's important: The first time issuing the command: npm install node-red-contrib-pi-plates I get this warning message: pi@piper:~/.node-red $ npm install node-red-contrib-pi-plates npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EAI_AGAIN: request to https://registry.npmjs.org/node-red-contrib-pi-plates failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.

5 packages are looking for funding run npm fund for details

5 packages are looking for funding run npm fund for details

mharsch commented 3 years ago

Well, this sounds very odd. I'll try to reproduce using the provided steps. I usually do not run the pi with a graphical display, so it's possible I've missed this issue along the way.

Could you check to see what the gpu memory split is set to? It's one of the Advanced options in the 'raspi-config' tool. Or you can look it up in your /boot/config.txt file.

poly-experimental commented 3 years ago

The GPU memory is set to 64 MB

mharsch commented 3 years ago

Could you check to see if the blank screen event triggers any entries in the system log (/var/log/messages)?

poly-experimental commented 3 years ago

Hey Mike. I don't think it's an issue so long as the pi is started with this rPi specific command: node-red-pi --max-old-space-size=256 found here: https://nodered.org/docs/getting-started/raspberrypi I don't get the black screen and all seems ok.

poly-experimental commented 3 years ago

Hi Mike. These are the messages from /var/log/messages after startup and doing alt+ctrl+f2 and then "startx":

Jan 5 13:53:59 raspberrypi rsyslogd: [origin software="rsyslogd" swVersion="8.1901.0" x-pid="416" x-info="https://www.rsyslog.com"] rsyslogd was HUPed Jan 5 13:54:24 raspberrypi kernel: [ 62.218512] broken atomic modeset userspace detected, disabling atomic

mharsch commented 3 years ago

We're unable to reproduce this issue using the info provided, so we must be missing something. Incidentally, the built-in version of Node-RED (and nodejs for that matter) that comes with the Desktop version of Raspberry Pi OS is problematic, as it's always out-of-date. The supported way of installing Node-RED on Raspberry Pi is to use their installer script that handles uninstalling old versions and installing current/matching versions of nodejs and Node-RED. I don't have any reason to think that this will resolve the screen blanking issue, but it would probably resolve the npm error messages and is generally the best practice way of getting Node-RED up and running.

A quick google search of your last log message seems to indicate that it's related to the screen and could be triggered by using VNC to connect to the pi (for remote display). What else can you tell us about the display configuration you're using?

poly-experimental commented 3 years ago

I tried it with a fresh install for the third time (I used the proper installer script each time) - and could not reproduce the error and did not get any warnings. Perhaps corrupted microSD card even though it verified ok each time? I have experienced some strange desktop happenings previously. Perhaps I should go headless too for more stability. I think it's a non-issue. Thanks for your help with this Mike.

mharsch commented 3 years ago

Ok, let us know if you see this again. We don't have good test coverage of graphical Pi instances. Pi Plates themselves do support graphical environments using their python stack (see their various GUI examples for DAQC2Plate and TINKERplate).

Our reference configuration for these Node-RED modules is Raspberry Pi OS Lite + headless.

mharsch commented 3 years ago

Subsequent testing has reproduced the blank screen issue described here when using the version of pygame that ships with the full Raspberry Pi OS (Desktop). Upgrading that version to the current version appears to resolve the issue.