# \[solved\] Mosquitto\_pub Node Red

**URL:** https://discourse.nodered.org/t/solved-mosquitto-pub-node-red/37584
**Category:** General
**Created:** [16 December 2020 16:31 UTC](https://discourse.nodered.org/t/solved-mosquitto-pub-node-red/37584 "2020-12-16T16:31:32Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)
#### Post date: [16 December 2020 16:31 UTC](https://discourse.nodered.org/t/solved-mosquitto-pub-node-red/37584/1 "2020-12-16T16:31:32Z")

</div>

Hello

i have a Raspberry Pi with Node Red, nothing else till now.

i have a second Raspberry Pi with a 433 Dongel and installed like this

> **[Native rtl\_sdr Setup — sdr-setup-notes documentation](https://sdr-setup-notes.readthedocs.io/en/latest/dev_rtlsdr.html)**

to collect and view it on the Monitor works!

then installed mosquitto-clients  
sudo apt install -y mosquitto-clients

and done this command  
rtl\_433 -F json -M utc | mosquitto\_pub -t home/rtl\_433 -l  
i found out the Port 1883 is closed on the this device. but found no config file

and yes sorry basicly it is not a Node Red Proble 😉  
but the next step will be the connection

have a nice day  
vinc

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [16 December 2020 16:49 UTC](https://discourse.nodered.org/t/solved-mosquitto-pub-node-red/37584/2 "2020-12-16T16:49:26Z")

</div>

Have you installed mosquitto? That is the package that provides the mosquitto broker, mosquitto-clients gives you the command line client for sub and pub.

---

<div class="post-metadata">

### Author: ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)
#### Post date: [16 December 2020 16:53 UTC](https://discourse.nodered.org/t/solved-mosquitto-pub-node-red/37584/3 "2020-12-16T16:53:48Z")

</div>

@Colin thanks for your feedback.  
on the Raspi where Node Red is or on the place where the data are?  
on the 433 Raspi i have only installed a mosquitto client

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [16 December 2020 17:59 UTC](https://discourse.nodered.org/t/solved-mosquitto-pub-node-red/37584/4 "2020-12-16T17:59:43Z")

</div>

On whichever device you want to run the broker. Often that will be the device running node red but it is up to you where you run it.  
I suspect you don't know a lot about mqtt, if so I suggest you read this set of tutorials.

> **[MQTT Essentials - All Core Concepts explained](https://www.hivemq.com/mqtt-essentials/)**

---

<div class="post-metadata">

### Author: ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)
#### Post date: [16 December 2020 19:38 UTC](https://discourse.nodered.org/t/solved-mosquitto-pub-node-red/37584/5 "2020-12-16T19:38:17Z")

</div>

@Colin it is true i have to read more, it also a bit confusing with all the systems working together or sometimes not 😉

---

<div class="post-metadata">

### Author: ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)
#### Post date: [16 December 2020 21:42 UTC](https://discourse.nodered.org/t/solved-mosquitto-pub-node-red/37584/6 "2020-12-16T21:42:33Z")

</div>

So now it is a Node Red Question

from a Raspberr Pi wiht a 433 Dongel i got message like this:  
iot12-rpi3b-gw-433 : msg.payload : Object

object

time: "2020-12-16 21:31:37"  
brand: "OS"  
model: "Oregon-THGR122N"  
id: 126  
channel: 2  
battery\_ok: 1  
temperature\_C: 6.2  
humidity: 77

the fist question how offen will a ID change?  
The Model i have two time but on different Chanel, should a Switch be used to splitt the data?

have a nice day  
vinc

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [16 December 2020 21:58 UTC](https://discourse.nodered.org/t/solved-mosquitto-pub-node-red/37584/7 "2020-12-16T21:58:36Z")

</div>

Since this now appears to be a question about the oregon device and the data it provides then it would probably be better to start a new thread with a title describing the problem, then possibly someone who knows that device will be able to help.

In the meantime though, as to whether to split the messages down two paths using a switch node that depends on what you want to do. If possible it is better to make one flow that will cope with both channels and use the id to determine what to do, but that depends on what you want to do with the data.

---

<div class="post-metadata">

### Author: ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)
#### Post date: [16 December 2020 22:17 UTC](https://discourse.nodered.org/t/solved-mosquitto-pub-node-red/37584/8 "2020-12-16T22:17:28Z")

</div>

@Colin thanks  
changed the Forum

> [@MQTT in Node - sort/switch the input](https://discourse.nodered.org/t/mqtt-in-node-sort-switch-the-input/37603):
>
> Hello i have some msg.payload coming from a Raspi-with433MHz Dongel. They nicely drop in Node Red MQTT IN with output a parsed JSON object The Question how do i splitt the Message to use them and later add to InfluxDB? The id: will ich change, or how will it work when two device have the same ID? Do i have to use the Switch node, to splitt the differen input? iot12-rpi3b-gw-433 : msg.payload : Object object time: "2020-12-16 21:31:37" brand: "OS" model: "Oregon-THGR122N" id: 126 chan…

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [30 December 2020 22:17 UTC](https://discourse.nodered.org/t/solved-mosquitto-pub-node-red/37584/9 "2020-12-30T22:17:31Z")

</div>

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