Multiple raspberry pi dashboard

What do you see in the terminal when you start node red. Copy/paste it here.
Have you put the IP address of the pi in the MQTT In node on the pc?

I run Node Red on my Windows PC and connect to Mosquito running on a Pi.


Here is a simple connection to my Pi which is at 192.168.1.100 on my network. For simplicity, I am using no password. The inject node passes "Hello World!". Open the mqtt node options, set your topic. My topic is just "hello" (on both send and receive nodes), hit the edit button (pencil icon) and enter the IP address of your Pi that is running Mosquito, This sends my message to the mqtt server on the topic of "hello". The other mqtt node receives anything from that mqtt server that is published on the topic of "hello".

When I start Node-red:

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

23 Jul 07:51:55 - [info] Node-RED version: v0.18.7
23 Jul 07:51:55 - [info] Node.js  version: v8.11.3
23 Jul 07:51:55 - [info] Windows_NT 6.1.7601 x64 LE
23 Jul 07:51:58 - [info] Loading palette nodes
23 Jul 07:52:01 - [warn] ------------------------------------------------------
23 Jul 07:52:01 - [warn] [node-red/rpi-gpio] Info : Ignoring Raspberry Pi specif
ic node
23 Jul 07:52:01 - [warn] [node-red/tail] Not currently supported on Windows.
23 Jul 07:52:01 - [warn] ------------------------------------------------------
23 Jul 07:52:01 - [info] Settings file  : \Users\estrobel\.node-red\settings.js
23 Jul 07:52:01 - [info] User directory : \Users\estrobel\.node-red
23 Jul 07:52:01 - [warn] Projects disabled : editorTheme.projects.enabled=false
23 Jul 07:52:01 - [info] Flows file     : \Users\estrobel\.node-red\flows_124CC3
b2D6F7.json
23 Jul 07:52:01 - [info] Server now running at http://127.0.0.1:1880/
23 Jul 07:52:01 - [warn]

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

23 Jul 07:52:01 - [info] Starting flows
23 Jul 07:52:01 - [info] Started flows
23 Jul 07:52:01 - [info] [mqtt-broker:820d6142.eb45e] Connection failed to broke
r: mqtt://10.168.58.32:1883

I have the IP address of the pi in the MQTT In node on the pc.

This is what I have at the moment. I removed the security and included the MQTT wildcards. I believe this is very similar to what you have, but as the log from the terminal shows the connection failed to the broker.

Yes, that is what I mean.

In your MQTT-out you have a wildcard in the topic. You need to specify to specific topic to publish on.
Wildcards are restricted to the MQTT-IN

When you say you "removed the security" what exactly do you mean?

Does it matter the name of the topic I publish to. In post 13 I show an mqtt input which is connected, and the topic is emon/emonpi/power1. Should this be the topic of the mqtt output node on the pi as well?

For both mqtt output node and input node, I have deleted the username and password under the security tab when I go to configure.

Yes. You need to get the topic names right for it to work. You cannot publish to a topic with a wildcard (# or +) in. So your MQTT Out node's configuration in that screenshot is not valid and will not do anything.

You can either subscribe to a single topic (/emon/emonpi/power1) to get just the messages published to that topic, or use a topic filter with a wildcard in it (/emon/emonpi/#) to get all messages published to topics that begin with /emon/emonpi/.

I changed the mqtt blocks to the way I had previously configured them, with the mqtt output node topic on the pi (emon/emonpi/power1) and the input on the pc (emon/emonpi/power1), but I am still not connected. The log is still saying:

Jul 11:07:52 - [info] [mqtt-broker:820d6142.eb45e] Connection failed to broke
mqtt://10.168.58.32:1883

I understand that the topics between pi and pc need to match, but does it matter that the output on the pi is subscribed to the same topic that the input on the pi is subscribed to?

If it is failing to connect, it doesn't matter how you have the topic's configured.

Is that IP address correct for the machine running the broker?
Have you checked the broker logs for any error messages related to failed connection attempts?
Have you tried a command line tool (such as those mosquitto provides) to check you can reach the broker outside of Node-RED?

You are not running node-red-contrib-mqtt-broker on both the PC and the pi are you? You should just be running one broker in your situation. On the pi.

What matters is whether you have specified security in the broker. If you have then you need to specify it in mqtt out and mqtt in, if you have not specified it in the broker then you don't need in in the In and Out nodes. I suspect that you still do not have a grasp of the basics of MQTT. Did you work through the introduction that was suggested to your some days ago? http://www.hivemq.com/mqtt-essentials

1 Like

I have been going through the introduction as I have had time. What I didn't realize was the fact that regardless the topic, the broker requires the same username and password to connect. It is saying connected now, so thank you. Sorry it took 32 posts for a solution so simple.

I wonder if is possible to run different instances of NR at once using a different port.... maybe someone has some link that explains howto.

Regards

OT but yep - my main one runs on 1880 - my own customised fork of NodeRED runs on port 1881 - you just need to change a value in settings.js

I know to change the port is just edit settings but I mean to have running several instances of NR at once

I'm not sure how this relates to this thread, which was about integrating data from three different machines. If you have a query about running multiple instances at once, how about opening a new thread?

Ukmoose, I just wondering myself, but I think was related to the original post title " Multiple raspberry pi dashboard"

Regards