Examples of visualization using Node Red as infrastructure?

5,212 views
Skip to first unread message

Edward Vielmetti

unread,
Jun 26, 2014, 11:10:17 AM6/26/14
to node...@googlegroups.com
Now that I'm collecting a bunch of data, I'd like to visualize it in
some reasonable way. (For instance, graph a value as it changes over
time.) What are people using with Node Red to make that happen? I'm
trying to figure out if there's existing infrastructure I can plug
into that works out of the box, to support some efforts that don't yet
deserve much more than a "try it out" approach.

--
Edward Vielmetti +1 734 330 2465
edward.v...@gmail.com

Mark Setrem

unread,
Jun 26, 2014, 12:06:47 PM6/26/14
to node...@googlegroups.com
I think it might have been said before but NodeRed isn't a Control Panel/dashboard ;-)

What I've done with some energy usage and Air Quality data etc is to post it to emoncms.org and use their graphs to visualise.

On another home project, I'm using NodeRed to put the data into a database.
I then have a "static" webpage served by NodeRed that contains d3.js which calls a 
NodeRed Flow to extract data from the database as json.  D3.js takes a while to get your head around but is very powerful.

Eugen Kammerloher

unread,
Jun 26, 2014, 12:08:54 PM6/26/14
to node...@googlegroups.com

Edward Vielmetti

unread,
Jun 26, 2014, 4:20:23 PM6/26/14
to node...@googlegroups.com
Thanks to all. I now have emoncms.org doing some simple visualizations.

I do have some ideas about how Node Red could be a control panel /
dashboard, at least for prototyping and debugging purposes. For
instance, just how hard would it be for a debug-style node to display
its most recent input as a value in the label, or to change colors
under program control? It already does a little bit of that displaying
error conditions on I/O nodes, and for debugging purposes it would be
very handy to interpose an object in a flow that was a meter or gauge
or strip chart or some other little sign of life.

thanks

Ed
> --
> 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.

Nicholas O'Leary

unread,
Jun 26, 2014, 4:43:01 PM6/26/14
to node...@googlegroups.com
Ed,

this has been discussed many times over the history of Node-RED, both on this list and amongst ourselves.

Whilst it wouldn't be 'hard' to do, it isn't something we want to do right now; we aren't a dashboard.

Now, there may be small things we could do from a debug perspective with the new node status api, but adding charts/gauges into the editor UI is not an option.

Nick


Edward Vielmetti

unread,
Jun 26, 2014, 4:48:37 PM6/26/14
to node...@googlegroups.com
Nick - got it - I found the docs for the new node status api here

http://nodered.org/docs/creating-nodes/status.html

and for some large set of problems this is "enough" to prove a concept
or illustrate a point or handle the debugging in question.

Dave C-J

unread,
Jul 4, 2014, 12:58:18 PM7/4/14
to node...@googlegroups.com
Edward (et al),

on how to use Node-RED with the Freeboard.io dashboard (locally hosted version)...

Lorenzo Maiorfi

unread,
Jul 5, 2014, 12:37:53 AM7/5/14
to node...@googlegroups.com

Just for sake of completeness, please take a look also at our websocket datasource for freeboard, located on freeboard plugins github subproject.

--

Gareth Coleman

unread,
Jul 8, 2014, 9:34:06 AM7/8/14
to node...@googlegroups.com
I have attempted to follow your gist but I can't seem to get web sockets out of Node-RED working.

I tested out both Lorenzo's and your websocket plugins for Freeboard - and they both work great against
the demo ws uri that Lorenzo provides in the help text (ws://iot.mqtt.it:1880/ws/freeboard1).

So I'm confident the dashboard side is fairly good, and I'm now running it on the same machine as
node-red itself just to follow your gist more fully.

However I can't get any connection to websockets from node-red, using the code provided (or my own).

i've got an inject node, a counter function and a websocket out node, and it's path is set to /ws/count
(admin seems auto-prepended as it's my static path in settings.js)

I am using a uri of ws://localhost:1880/admin/ws/count as a datasource in freeboard but it isn't accessed
ever, unlike the mqtt.it example.

I'm pretty sure I'm doing something simple wrong, do you have any idea what it might be?

Kind regards

Gareth

Gareth

Lorenzo Maiorfi

unread,
Jul 8, 2014, 10:48:34 AM7/8/14
to node...@googlegroups.com
I suggest you to try some simple message exchange with a simple javascript websocket interactive client like http://bit.ly/wsclientjs

Heiko

unread,
Jul 8, 2014, 5:14:12 PM7/8/14
to node...@googlegroups.com
Hi,

i also tried the example,  and it just works without the "admin" in the ws://...

Maybe it helps.

Heiko

mike.s...@gmail.com

unread,
Jul 9, 2014, 12:33:05 AM7/9/14
to node...@googlegroups.com
check you selected "Send/Receive entire message" in websocket config

Gareth Coleman

unread,
Jul 9, 2014, 5:27:23 AM7/9/14
to node...@googlegroups.com
That's a great tool, thanks Lorenzo!

I was able to use it to quickly verify that node-red was counting via ws fine, and eventually concluded that because the websockets are direcly accessed by the client browser they couldn't be accessed via a local address!!

D'oh!

In the meantime I also verified that the /admin/ prefix only applies when the static content directory in settings.js is used

And I also found that because the payload is sent 'raw' it is necessary to send the entire message to use the payload object.

Also in case anyone is experimenting, it's a good idea to send data after the datasource is defined, then the message objects are available to select rather than needing to be typed in!

Great responses many thanks to the list

Gareth


On 9 July 2014 05:33, <mike.s...@gmail.com> wrote:
check you selected "Send/Receive entire message" in websocket config

--
http://nodered.org
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/IJAzy233EWE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
------------------------
Gareth Coleman
layer zero labs

Gareth Coleman

unread,
Jul 11, 2014, 11:57:45 AM7/11/14
to node...@googlegroups.com, gar...@sublime.org
In case anyone is interested and/or can provide feedback, my first freeboard dashboard thingy is available at:
http://incredibleaquagdn.no-ip.info/?load=dashboard.json

Some of the data is only updated every minute, and the status messages fire very infrequently.

I like freeboard so far, it seems simple to start with but also looks fairly straight-forward to extend, thanks for the heads-up!

Gareth

Dave C-J

unread,
Jul 11, 2014, 1:56:44 PM7/11/14
to node...@googlegroups.com

Nice !

Gareth Coleman

unread,
Jul 11, 2014, 4:09:25 PM7/11/14
to node...@googlegroups.com
Glad you got to see it before it crashed :-(

Hmm, I wonder if introducing a dozen websocket nodes should have made it crash more often?

Seems to have crashed a fair few times in the last few days, just when I started playing with freeboard...

I suppose I had better do it properly with a single ws endpoint and filter it by topic at the dashboard or some such.

Ooops!


On 11 July 2014 18:56, Dave C-J <dce...@gmail.com> wrote:

Nice !

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

mike.s...@gmail.com

unread,
Jul 11, 2014, 11:34:50 PM7/11/14
to node...@googlegroups.com, gar...@sublime.org
Gareth,

if you put all information in one object you also will provide last known state to the dashboard.
Store status in context.global.aqua_dashboard[<property>] and then return the whole object in payload to split it in dashboard. As you have a clock, whole dashboard will be updated every second.
To get information on open without clock you can change freeboard plugin to send message in onopen event (ex. ws.send(JSON.stringify({payload: "freeboard"}));) and add websocket input node to the flow.

Daniel Buentello

unread,
Jul 12, 2014, 11:54:39 AM7/12/14
to node...@googlegroups.com, gar...@sublime.org
I suppose I had better do it properly with a single ws endpoint and filter it by topic at the dashboard or some such.

Im wondering same thing as well. Master websocket vs one per datasource? Was it ws that crashed it? could you post trace?

Gareth Coleman

unread,
Jul 15, 2014, 11:27:21 AM7/15/14
to node...@googlegroups.com, gar...@sublime.org
That's great advice, thanks Mike!

We've now got the dashboard running off a single websocket, we're happy with using a clock but that's good thinking with creating a websocket input node to respond to an onopen event - I'm sure we'll use that idea sometime soon.

Gareth Coleman

unread,
Jul 15, 2014, 11:42:22 AM7/15/14
to node...@googlegroups.com, gar...@sublime.org
I have got an entry from the node-red.log file that goes like this:

11 Jul 18:42:59 - [red] Uncaught Exception:
11 Jul 18:42:59 - Error: not opened
    at WebSocket.send (/home/pi/node_modules/node-red/node_modules/ws/lib/WebSocket.js:187:16)
    at WebSocketListenerNode.broadcast (/home/pi/node_modules/node-red/nodes/core/io/22-websocket.js:114:32)
    at WebSocketOutNode.<anonymous> (/home/pi/node_modules/node-red/nodes/core/io/22-websocket.js:164:31)
    at WebSocketOutNode.EventEmitter.emit (events.js:95:17)
    at WebSocketOutNode.Node.receive (/home/pi/node_modules/node-red/red/nodes.js:170:10)
    at MQTTInNode.Node.send (/home/pi/node_modules/node-red/red/nodes.js:159:38)
    at /home/pi/node_modules/node-red/nodes/core/io/10-mqtt.js:87:22
    at MQTTClient.<anonymous> (/home/pi/node_modules/node-red/nodes/core/io/lib/mqttConnectionPool.js:63:37)
    at MQTTClient.EventEmitter.emit (events.js:117:20)
    at Connection.<anonymous> (/home/pi/node_modules/node-red/nodes/core/io/lib/mqtt.js:137:28)

It hasn't crashed (yet!) since rationalising the websocket node to a single endpoint, and it didn't crash for weeks before them either, so it certainly seems related to me. There were even warnings starting node-red about memory leaks with so many listeners:

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.

I guess the lesson is that those who cannot understand their own log files are condemned to repeat them!

Gareth

Nicholas O'Leary

unread,
Jul 15, 2014, 11:56:00 AM7/15/14
to node...@googlegroups.com, gar...@sublime.org
What version are you running? I fixed the EventEmitter leak warning with the WebSocket node in 0.8.

The stack trace you have appears to be a timing window where a message arrived at a WebSocket Out node whilst it was still processing a new connection. That's worth an issue on github to get fixed.

Nick


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.

jay.s...@googlemail.com

unread,
Oct 4, 2014, 9:40:12 AM10/4/14
to node...@googlegroups.com

Thank you for the gist!

I took the liberty to forge it into a Vagrant/Ansible setup: https://github.com/jsilence/vagrant-nodered-freeboard
This allows Node Red starters to very quickly check out Node Red including the Freeboard dashboard.

Feedback and pull requsts are welcome.
For example it would be nice to use the freeboard-plugin websocket code (https://github.com/Freeboard/plugins), but I failed getting it up and running and oped for your implementation.

Best regards!

-rolf

Reply all
Reply to author
Forward
0 new messages