This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pi refuses connection for Node Red and Dahboard
I am not sure if I somehow managed to screw something up or not but I am starting to sweat a bit ....
I can reboot my pi, I can get into it via VNC, I can see the SignalK diagnostic page. I can go to all the OpenPlotter tabs and things 'seem' to work right. If I go to the signalK tab and click on 'show signal k tools', I get the expected web page but the tab 'Node Red' tells me the server is refusing connection, the Dashboard gives me a blank page and freeboard gives me a refused connection error as well.
The other thing I noticed is that on reboot, a 'tool' I added to the 'Tools' menu doesn't start automatically (BMV700 battery monitor code) but runs fine if I start it manually.
I did have a situation where, when Node Red still ran, it reported a discrepancy with the node red flows between a remote browser and the local page (???) and it asked me if I wanted to merge the two. I never answered the question and eventually rebooted and Node Red did not come back up.

Any ideas ?

Ok, figured out how to start NodeRed manually and I get this:

pi@openplotter:~ $ node-red
Error loading settings file: /home/pi/.node-red/settings.js
functionGlobalContext: {
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/lib/node_modules/node-red/red.js:115:20)
pi@openplotter:~ $ ^C

I think this is the section of settings.js that it objects to:

// Anything in this hash is globally available to all functions.
// It is accessed as
// eg:
// functionGlobalContext: { os:require('os') }
// can be accessed in a function block as:

functionGlobalContext: {
// os:require('os'),
// octalbonescript:require('octalbonescript'),
// jfive:require("johnny-five"),
// j5board:require("johnny-five").Board({repl:false})

I have no clue why .....
Ok, so I screwed up ....

The settings.js file contains this section
// Node-RED scans the `nodes` directory in the install directory to find nodes.
// The following property can be used to specify an additional directory to scan.
//nodesDir: '/home/nol/.node-red/nodes',

So I added

nodesDir: '/home/pi/.node-red/add.nodes'

and somehow that screwed everything up ..... could be because there is no ',' at the end of the line I added.
Why the heck it screwed up where it did, I have no clue (yeah, I know, common theme with me)

I thought I had rebooted after the original change but obviously I did not. When I had unrelated issues and rebooted the pi, this gem decided to rear it's ugly head Sad
The line was removed and all is well again

Forum Jump:

Users browsing this thread: 1 Guest(s)