Showing Node-RED dashboard on remote browser

251 views
Skip to first unread message

Richard Tenney

unread,
Mar 27, 2018, 4:19:01 PM3/27/18
to Node-RED
Hi all,

I'm sure this question has been asked and answered somewhere, but I'm sufficiently befuddled that I can't even formulate the right question to get to the prior work.

I have a very nice Node-RED flow that runs on a Beaglebone Black Wireless (BBBW) and displays sensor information from various probes. It can be accessed as a web page at http://<server>:1880/sensors. Associated with this is a nice display using Node-RED's dashboard, accessed at http://<server>:1880/ui. It provides a graphical display of the information from one probe, chosen by clicking on a button on the sensor web page. It all works just fine viewed on a browser on the local area net.

However, it requires three pieces that make it too limited for remote use.

1) The BBBW has to connect to a local wifi access point -- i.e., it has to know which access point to use and what its password is.
2) The router has to have port-forwarding set up for port 1880, which can be tricky if the BBBW uses DHCP to get its local IP address.
3) To access the BBBW running Node-RED from a browser on the Internet, the BBBW has to have a known external IP address (i.e., the external IP address of its router).

While I'd love to address all three points, I'd first like to solve 2 and 3, which I think I can address with MQTT. Namely, the BBBW can access a broker (e.g., HiveMQ's  <broker.hivemq.com>) and publish to MyServer/sensors. The BBBW wouldn't have to set up port forwarding nor know its external IP address, as all this would be taken care of by the MQTT system. The remote browser on the Internet would then simply subscribe to MyServer/sensors on the same broker...but now I'm stuck.

a) Without running Node-RED on the device that runs the browser (think of a PC in a coffee shop or a smart phone), how do I show that nice dashboard display that I see on the LAN? I assume I have to build a web page that accepts MQTT data and does something with them, but what? Is there any carry-over from the Node-RED dashboard? Oh, and the remote browser has to be able to send back the choice of which sensor to display, but that seems much simpler.

b) There seem to be two choices within the MQTT world: either standard MQTT (port 1883) or web sockets (port 8000 on the HiveMQ broker). How would I choose between these, and why?

Where can I look for help on these? And obviously, once I solve 2 and 3, I'm going to be looking for a way to solve 1, but one step at a time...

Thanks,
Richard

Simon Walters

unread,
Mar 27, 2018, 4:32:06 PM3/27/18
to Node-RED
A bit of a left-field reply but if your happy to go into a engine room and get your hands dirty .....
Rnt a "cloud" computer instance (I use https://www.ovh.co.uk/ myself) for a few $ a month and install your own broker on it and then just get BBB to upload sensor data to it instead of  hivemq

Then install node-RED on it and then you can browse to its dashboard from anywhere


Simon

Colin Law

unread,
Mar 27, 2018, 4:32:45 PM3/27/18
to node...@googlegroups.com
1. There must be a way of telling the BBBW to use a fixed IP address and pre-configuring the access point.
2. Solved by 1.
3. Use duckdns.org or similar (free) service.

However I advise against connecting directly into the device from the internet. It is too dangerous. As soon as you connect bots will start trying to hack it.

There are various solutions to this problem and it is regularly discussed here. My preferred solution is to run a VPN server in my home, on a pi, which then gives safe access to the local network from anywhere.

Colin

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
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+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/88676930-ef48-426b-9040-4519e9ffa5b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dave C-J

unread,
Mar 27, 2018, 4:44:45 PM3/27/18
to node...@googlegroups.com
And some users have had good success with https://ngrok.com/
(I have not personally used them)

Simon Walters

unread,
Mar 27, 2018, 6:15:13 PM3/27/18
to Node-RED

And some users have had good success with https://ngrok.com/

That looked interesting, so I just tried it out (the free version) and it worked fine doing a quick test with editor and dashboard ui 
Simon

Richard Tenney

unread,
Mar 28, 2018, 11:22:39 PM3/28/18
to Node-RED
Thanks all for the replies. I've been hammered with other tasks, so it'll be a little while before I can make progress.

I think my first attempt will be to set up a computer with a known, fixed name and run Node-RED on it. I'll have to figure out how to get the info from the sensors to the flow on that computer, and I suspect that MQTT will figure into that exercise. Thank you Simon for the idea.

Colin, yes there is a way to give the BBBW a fixed IP address on the LAN, but it has the disadvantage that if I were to give a copy of the system to someone else to use, its IP address could interfere with the local DHCP scheme or with another unit on the LAN. And whoever got the unit would have to register with DynDNS or DuckDNS and configure the local router to talk to the service. Too much to hope for unless the new user were fairly tech savvy.

I haven't yet confronted how to secure the system beyond obfuscation by changing the default port. A worthy next step!

And thank you Dave C-J for the pointer to ngrok. I'll look into that if my attempt to run Node-RED on a known computer runs into trouble. Or if I need that for security.

So, again, thank you all!
Richard

Garry Hayne

unread,
Mar 29, 2018, 4:53:49 AM3/29/18
to Node-RED
On Tuesday, March 27, 2018 at 9:44:45 PM UTC+1, Dave C-J wrote:
And some users have had good success with https://ngrok.com/
(I have not personally used them)

I can vouch for Ngrok, simple to set up (no static IP needed), 4 tunnels on the free plan. 
You can leave your node-red, MQTT and MySQL servers on your device and access them from anywhere.

Garry

john macrae

unread,
Mar 29, 2018, 5:21:16 AM3/29/18
to Node-RED
I run an instance of mosquitto and NR on AWS for free (1st year). Also Google Cloud Platform.  The smallest machine on GCP tells me constantly that I need to upgrade since I'm overusing resources with 2% CPU and about the same for I/O - duh!  AWS seems to be a better solution for a few $ a month.

Dannaz Perth

unread,
Mar 29, 2018, 6:55:51 AM3/29/18
to Node-RED
HI John.

Is it possible you can provide some instructions on how you achieved your method ?
Loading Mosquito and NR on AWS sounds pretty solid.
Is there anything i can follow online already ?  If not, your advise would be awesome.

Cheers mate

Dan 

john macrae

unread,
Mar 29, 2018, 7:46:12 AM3/29/18
to node...@googlegroups.com
I haven't written anything up (since my level of competence is low) - lol

However.  Go to AWS and create an account. Get yourself a T2 micro instance with Ubuntu and install mosquitto and NR.
Now go to your local NR and create an outbound MQTT node connected to your AWS mosquitto and pipe all the info you want to it.

Back in AWS, create nodes for each topic that you need and then recreate your dashboard. (You can, of course export the nodes and flows you need and then import them into the AWS instance).

Consider security. HTTPS?  There are guides to setting this up.

I like this way of doing things, I can keep an eye on things wherever I am and also control things from the dashboard if required. (i.e. get your local instance to subscribe to topics on the AWS )

Hope this helps!

Kind Regards
John

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
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/oMlDcwa1blI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages