It is possible?. How could be done?

Hi mates!! I will like to know if it is possible or not:

Imagine i have a computer called PC1. In this one, ill have node.js installed. In second place, i will have 3 arduinos sending data to node-red using mqtt, for instance. All the info that arduinos are sending are being stored in a database.

Eventually, ill get this information using mysql node and will be displayed in the dashboard, but i want to restrict the access in this way: User 1 will see the info about Arduino1, using an username and password. User 2 will see the info about Arduino2, using an username and password, and the user 3 the same.

Its simple, only display the info to the respective user, but of course the 3 users could be getting his own information at the same time. Could this be done?

Thank you very much mates, have a nice day!

Hi,

The simplest way (perhaps not the most efficient) would be to have three instances of Node-RED sunning on what you call 'PC1'. I suggest looking at the command-line switches. Suggest instances running on ports 1880, 1881, and 1882. Rach instance stores it's own data (possibly even in a single MySQL DB) and generates its own dashboard for each user. Each user goes to 'their' instance (by port #) and sees their own data without seeing other data.

Securing Node-RED for public web access is a involved and quite technical prospect; mistakes will result in your network being breached. Possible, but will require significant effort.

Note: Node-RED is designed to be single-tenant only. Expectations for sharing a single instance need to be tempered.

Each instance of Node-RED is actually pretty efficient on memory / CPU depending on the density and type of data you are processing & displaying.

Cheers,

Paul

Cheers,

Paul

1 Like

Thank you Paul, the problem is that in the real project, ill have 20 arduinos, so i can not use 20 different ports. I was thinking about creating a html login database and display in the web the info from the arduino asociated to the user. The problem is that i dont know if i can have a dashboard with 20 pages and get only in the webpage the page which is associated to the arduino´s user.

Hi,

That aspect is actually pretty easy. Simply choose a different tool to display dashboard / graphical data.

For instance: all of your Arduinos communicate to a single instance of Node-RED running on PC1. It also stores Arduino data in a MySQL DB. You query the DB using a tool like Grafana which outputs different dashboards for different users. Grafana also makes each user sign-in before getting the data / charts etc.

Cheers,

Paul

Mmmm could you explain better paul? This solution seem to be perfect, i will like to understand it in the 100%. Thank you mate!

Hi,

Try researching grafana. It is a standalone application that displays data graphically that is pulled from a database. Users connect to the grafana data display through web pages. So grafana shows multiple users charts etc based on their login.

All of the node red integrations are simple. Again, some research is needed. You need to figure out how you will connect the Arduinos to pc1.

I suggest drawing how the pieces will connect on paper. That will help you understand.

Cheers,

Paul

Thank you very much Paul.

It is need to connect Arduinos to the PC1? I mean, the databse will be in the PC1, i just only need to send the data from Arduinos to the database using a python script, and using grafana get the info and display it

Hi,

The questions you are asking indicate that you have a lot to study in order to accomplish your goals. You have to connect devices together - either wired or wireless connections - so that they can talk to each other.

I'd suggest starting with some google searches and seeing if it is possible that someone can help you.

Cheers,

Paul

Seems this project is commercial? If so, hire the resources you need

Its not commercial, its only a personal project for my degree.

Thank you!

You can also have a look at Multi Tenant Node-RED – Ben's Place

Take care that 20 node red instances will take about 2 to 3 GB of Physical memory. So your PC1 must gave sufficient memory.

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