node-red - arduino - johnny-five - Unable to load settings #727

261 views
Skip to first unread message

darlin

unread,
Sep 24, 2015, 6:16:58 AM9/24/15
to Node-RED
Hello Guys,
Maybe I harried up to reported the issue #727
and this is my mistake, which you could help me to resolve.

Uncomment each of this two lines,in
functionGlobalContext: {
:
 jfive:require("johnny-five"),
 j5board:require("johnny-five").Board({ port: "/dev/ttyACM0", repl:false })

 },

caused error:
Unable to load settings file: /usr/local/lib/node_modules/node-red/settings.js

Please let me know of your suggestions, if any.

Mark Setrem

unread,
Sep 24, 2015, 7:47:07 AM9/24/15
to Node-RED

The line "functionGlobalContext: {:" does not have a : on the end.

But that should give you a different error.  

Have you checked that the user account the you are running node-red from has permissions to read that file?

darlin

unread,
Sep 24, 2015, 7:55:56 AM9/24/15
to Node-RED
"{:" is my mistake during copy to post.
I'm working as root. When I commented this two line I can start node-red base on this settings.

Nicholas O'Leary

unread,
Sep 24, 2015, 9:43:11 AM9/24/15
to Node-RED Mailing LIst
Hi,

normally if there is a syntax error or runtime error loading the settings file it will give you a more useful message. There is a special case that says if the error is 'MODULE_NOT_FOUND' then report it as the message you are getting. This is because I (incorrectly) assumed this would be caused by not being able to find the settings file itself.

What I think is happening here is it is failing to find the johnny-five module, causing the MODULE_NOT_FOUND error.

Looking at your original problem description, I see you have installed johnny-five in ~/.node-red, but you are editing the settings file in the node-red module directory. That is the problem; the module should be relative to the settings file (as it is the settings file trying to load the module). If you copy the settings file to ~/.node-red then it will work.

Will look at the docs to see how to make this clearer.

Nick



--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

darlin

unread,
Sep 24, 2015, 1:32:38 PM9/24/15
to Node-RED
Nick, thank you for your great  suggestion. Copy  setting file to ~/.node-red solved the problem of "Unload setting".
but node-red still is not work );

root@beaglebone:~/.node-red# node-red-pi
1443114011036 Device(s) /dev/ttyACM0
1443114011165 Connected /dev/ttyACM0


Welcome to Node-RED
===================

24 Sep 19:00:12 - [info] Node-RED version: v0.11.1
24 Sep 19:00:12 - [info] Node.js  version: v0.10.38
24 Sep 19:00:12 - [info] Loading palette nodes
24 Sep 19:00:25 - [warn] ------------------------------------------
24 Sep 19:00:25 - [warn] Failed to register 1 node type
24 Sep 19:00:25 - [warn] Run with -v for details
24 Sep 19:00:25 - [warn] ------------------------------------------
24 Sep 19:00:25 - [info] Settings file  : /root/.node-red/settings.js
24 Sep 19:00:25 - [info] User directory : /root/.node-red
24 Sep 19:00:25 - [info] Flows file : /root/.node-red/flows_beaglebone.json
24 Sep 19:00:25 - [info] Server now running at http://127.0.0.1:1880/
1443114025245 Device or Firmware Error A timeout occurred while connecting to the Board.

Please check that you've properly flashed the board with the correct firmware.
See: https://github.com/rwaldron/johnny-five/wiki/Getting-Started#trouble-shooting
24 Sep 19:00:25 - [red] Uncaught Exception:
24 Sep 19:00:25 - TypeError: Uncaught, unspecified "error" event.
    at TypeError (<anonymous>)
    at Board.emit (events.js:74:15)
    at Board.log (/root/.node-red/node_modules/johnny-five/lib/board.js:629:8)
    at Board.(anonymous function) [as error] (/root/.node-red/node_modules/johnny-five/lib/board.js:640:14)
    at Board.<anonymous> (/root/.node-red/node_modules/johnny-five/lib/board.js:411:14)
    at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)


Of course StandardFirmata is installed.

Darek

Nicholas O'Leary

unread,
Sep 24, 2015, 1:38:53 PM9/24/15
to Node-RED

Hmm, the node should definitely be catching that error to stop it crashing the whole runtime. As for the underlying cause, I have to defer to what it says regarding the firmware... unless anyone else has hands experience with this node?

Nick

Reply all
Reply to author
Forward
0 new messages