Chart line is invisible

Hi All,

I created an energy management dashboard 2-3 years ago. It has been working great until about a month ago. On one of my 3 line charts the line disappeared. When I hover over the chart, I can see the data points. My other two charts are fine. I have adjusted the scale, number of points and many other chart items to try and get it to come back, but as you can see, only the "enlarge points" feature provides any help, but still no line. I am using Chrome to display it and it is a problem on all of my devices including my PC, Android phones and IOS IPad. But if I switch to Firefox on my PC, the line shows up. I am running Chrome 86.0.4240.75 (latest).

Anyone have a suggestion (other than switching browsers :slight_smile:)

Is the chart line colour the same as the chart plot?
If not, have you used a debug node to look at the data being fed into the chart node. Is there something different about that data compared to the other 2 charts?

Thanks for the suggestion. It is set up just like the other charts and I have never changed any of the colors. None of the colors offer a black choice. But I changed it anyway and it didn't make any difference. The data hasn't changed either, but it clearly shows correctly on the chart when you hover the cursor over the data point. There is just no line between the data points.

Have you looked at the data with a debug node?

Ok, I put a debug node on the output of the chart node that is acting up and there is no error message. I put the debug on the input and got valid data going into it.

Being it works on Edge and Firefox, I am thinking a Chrome bug from a recent update, but I can't be sure.

Are you using the latest version of the dashboard?

You may be on to something. I have never updated the Node-Red program since I installed it a couple of years ago, so it is still V 0.17.5 on Raspbian.

I have now issued the command to upgrade NR twice using the syntax:
"sudo npm install -g --unsafe-perm node-red"
But the version still shows up as v0.17.5. (after reloading the browser screens)
I am still a bit new to the Pi command line usage. Any suggestions?

Have you restarted node red?

Also that isn't actually what I asked, though it might be relevant. The dashboard node version is not related to the node red version. You can upgrade that using Manage Palette. I think you may need to restart node red after upgrading the dashboard too.

Thanks Colin for the specific instructions. I didn't realize the different components needed updating. My Dashboard was significantly older, so I updated it and restarted Node-Red.
On the Pi command line I go the error:
12 Oct 10:30:44 - [info] Waiting for missing types to be registered:
12 Oct 10:30:44 - [info] - ui_base

When I pull up the web site of the nodes and flow, it shows an error:
"Flows stopped due to missing node types. Check logs for details."
and there is no option to open the dashboard.

When I try to open the dashboard thru the URL, I see the error:
"Cannot GET /ui/"

When I open the NODE-RED console on the Pi, it seems to restarting over and over with errors (over and over again):
Welcome to Node-RED

12 Oct 10:48:17 - [info] Node-RED version: v0.17.5
12 Oct 10:48:17 - [info] Node.js version: v6.12.0
12 Oct 10:48:17 - [info] Linux 4.9.59-v7+ arm LE
12 Oct 10:48:18 - [info] Loading palette nodes
12 Oct 10:48:25 - [warn] ------------------------------------------------------
12 Oct 10:48:25 - [warn] [ui_base] SyntaxError: Unexpected token ...
12 Oct 10:48:25 - [warn] ------------------------------------------------------
12 Oct 10:48:25 - [info] Settings file : /home/pi/.node-red/settings.js
12 Oct 10:48:25 - [info] User directory : /home/pi/.node-red
12 Oct 10:48:25 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
12 Oct 10:48:25 - [warn] Communication server error: Error: listen EADDRINUSE 0.0.0.0:1880
12 Oct 10:48:25 - [error] Unable to listen on http://127.0.0.1:1880/
12 Oct 10:48:25 - [error] Error: port in use
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Unit entered failed state.
nodered.service: Failed with result 'exit-code'.
nodered.service: Service hold-off time over, scheduling restart.
Stopped Node-RED graphical event wiring tool..
Started Node-RED graphical event wiring tool..
12 Oct 10:48:28 - [info]

Any help would be appreciated. I did some research in the forum for answers, but I could not correlate any thing specific to this. It seems the UI_BASE is the issue, but I am not using this node specifically.

The "unable to listen" error is probably because you already have node-red running, So stop it before trying to restart. I didn't realise you were running on a Pi, so I suggest running the recommended upgrade script first then you will have the up to date start/stop scripts. You can find the at https://nodered.org/docs/getting-started/raspberrypi.

Then to stop node red run node-red-stop and to start it node-red-start.

I think that may not fix the ui_base problem though, ui-base is part of the dashboard so I think something went wrong in the update. In a terminal go to your .node-red folder then run
npm remove node-red-dashboard
npm install node-red-dashboard
Then stop and restart node-red using the commands above.

Should that be npm uninstall node-red-dashboard

Either remove or uninstall will do, they are aliases for the same command.

1 Like

I ran the upgrade script command, twice and both times it rebooted the Pi halfway through the scripts. Afterwards none of my node-red commands would work from the home/Pi: command line to stop or start. So I ran the remove and install dashboard commands and still no response (command not found) for starting or stopping node red.

Any help would be appreciated.

Here is the latest contents of the nodered-install.log file after all this:


Started : Mon Oct 12 16:08:48 CDT 2020
Running for user pi at /home/pi
Found global nodes:   :

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 412 not upgraded.
Already have nodejs v6.12.0
Now install nodejs
Updating nodejs v6.12.0
Using nodesource.list
Removing nodejs v6

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodejs-legacy' is not installed, so not removed
Package 'npm' is not installed, so not removed
The following packages will be REMOVED:
  nodejs
0 upgraded, 0 newly installed, 1 to remove and 411 not upgraded.
After this operation, 40.9 MB disk space will be freed.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 118800 files and directories currently installed.)

Removing nodejs (6.12.0-1nodesource1) ...

dpkg: warning: while removing nodejs, directory '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator' not empty so not removed

Processing triggers for man-db (2.7.6.1-2) ...


## Installing the NodeSource Node.js 12.x repo...


## Populating apt-get cache...

+ apt-get update
Hit:1 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
Hit:3 https://deb.nodesource.com/node_6.x stretch InRelease
Reading package lists...

## Confirming "stretch" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_12.x/dists/stretch/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
Warning: apt-key output should not be parsed (stdout is not a terminal)
OK

## Creating apt sources list file for the NodeSource Node.js 12.x repo...

+ echo 'deb https://deb.nodesource.com/node_12.x stretch main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src https://deb.nodesource.com/node_12.x stretch main' >> /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Hit:2 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Get:3 https://deb.nodesource.com/node_12.x stretch InRelease [4,585 B]
Get:4 https://deb.nodesource.com/node_12.x stretch/main armhf Packages [775 B]
Fetched 5,360 B in 1s (3,084 B/s)
Reading package lists...

## Run `sudo apt-get install -y nodejs` to install Node.js 12.x and npm
## You may also need development tools to build native addons:
     sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
     echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn



WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  nodejs
0 upgraded, 1 newly installed, 0 to remove and 411 not upgraded.
Need to get 16.2 MB of archives.
After this operation, 86.4 MB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_12.x stretch/main armhf nodejs armhf 12.19.0-1nodesource1 [16.2 MB]
Fetched 16.2 MB in 3s (4,585 kB/s)
Selecting previously unselected package nodejs.

(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 115805 files and directories currently installed.)

Preparing to unpack .../nodejs_12.19.0-1nodesource1_armhf.deb ...

Unpacking nodejs (12.19.0-1nodesource1) ...

Setting up nodejs (12.19.0-1nodesource1) ...

Processing triggers for man-db (2.7.6.1-2) ...

Versions: node:v12.19.0 npm:6.14.8
Now install Node-RED
npm WARN deprecated bcrypt@3.0.6: versions < v5.0.0 do not handle NUL in passwords properly
npm WARN deprecated request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142

***************************************

Started : Mon Oct 12 16:31:59 CDT 2020
Running for user pi at /home/pi
Found global nodes:   :

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Package 'nodered' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 411 not upgraded.
Already have nodejs v12.19.0
Now install nodejs
Versions: node:v12.19.0 npm:6.14.8
Now install Node-RED
npm WARN deprecated bcrypt@3.0.6: versions < v5.0.0 do not handle NUL in passwords properly

Also here is a screen cut just before the script upgrade rebooted my Pi:

I get this error if I try to run Node-Red from the Pi Desktop node-red app:
Invalid desktop entry file: '/usr/share/applications/Node-RED.desktop'

I have now reinstalled Node-Red to latest version, updated Dashboard to the latest version and it is working again just like before.

The line chart still has no line, so nothing seems to have been fixed yet.

Wow, I hadn't realised your system was that old. Stretch went out of support over two years ago, and it wasn't even up to date with the latest Stretch even then, with 411 out of date packages even then.

I don't know if the script is supposed to support Stretch any more, @dceejay would have to comment on that.

The script log shows that at least it upgraded nodejs, can you confirm that using
node -v
it should show v12.
If it does then go into your .node-red folder and run
npm install
and
npm rebuild
if those run without error then restart node red and see it it helps.

If it doesn't then I don't know what to suggest other than using an up to date version of the OS (Buster). If you wanted to do that then make a backup of your .node-red folder first, except for the node_modules folder which you should not backup. Hopefully you have the folder backed up already. Then burn Buster onto a card, restore the .node-red folder and run the node-red install script.
Ideally use a new card so you still have the old one in case you have missed backing up something.

Thanks for the tips. Yes, I checked all the notes on the script and it was supposed to work with anything “Jessie” and above, but clearly there is a problem. Regardless, it seems I am back up, but no solution to the original problem. This is a single purpose Pi for just an energy management display, so I am tempted to just leave it alone for now.

One thing that did come out of this is my main display unit, an old iPad original running old Safari is now showing the line chart correctly again. But Chrome on my Android phone and on my PC are not. Since switching the chart to “enlarged data points” now anyway I can at least see the data points, so I can live with it for the time being.

Someday when I am feeling masochistic, I will take a shot at upgrading the Pi to Buster, if that is compatible with my “older” (only 3 years old) Pi hardware.

Thanks again,

--Leon

Provided you have a new SD card you don't need to destroy the working one.
Does node -v show 12.x and did you run the npm commands I suggested?

Buster will work on any pi.

:+1: Thanks for the help. I'll have to address any remaining issues next week.

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