# MQTT question in light of what has recently happened

**URL:** https://discourse.nodered.org/t/mqtt-question-in-light-of-what-has-recently-happened/30187
**Category:** General
**Created:** [16 July 2020 09:07 UTC](https://discourse.nodered.org/t/mqtt-question-in-light-of-what-has-recently-happened/30187 "2020-07-16T09:07:19Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [16 July 2020 09:07 UTC](https://discourse.nodered.org/t/mqtt-question-in-light-of-what-has-recently-happened/30187/1 "2020-07-16T09:07:19Z")

</div>

Ok, I was trying to update my RasPi to Buster and it failed.

While doing it, the machine was off-line for any Node-Red stuff and that machine is also my `MQTT broker`.

So, as I understand: The _broker_ is the guy who sits there and receives messages and re-broadcasts them to the other devices.

Without the **broker** `MQTT` won't work.

This was obvious with my WAP temperature sensor. It was complaining no end when the RasPi was shut down.

# WEIRD THING HAPPENED

On another RasPi, I have things happening on `MQTT`. It sends commands..... (doesn't really matter - yeah?)

The commands are sent to an IR Transmitter.

Though it didn't _work_ I did see the command go through and it was attempted.  
Alas now and these commands _fail_ for reasons unknown.

But it raises the question for me:

## If the **broker** was nonexistant: **how** did that work?

Someone?

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [16 July 2020 09:19 UTC](https://discourse.nodered.org/t/mqtt-question-in-light-of-what-has-recently-happened/30187/2 "2020-07-16T09:19:01Z")

</div>

> [@Trying\_to\_learn](#):
>
> Though it didn't _work_ I did see the command go through and it was attempted.  
> Alas now and these commands _fail_ for reasons unknown.

What do you mean by this? You need to give more detail, like "machine "A" has a flow that uses an mqtt-out node. The mqtt msgs go to machine "B" which is the MQTT broker. On machine "C" I have an a flow that listens for certian MQTT msgs and then sends then using an IR Transmitter."

You should be able to duplicate this very easily by powering down machine "B"  
You need to monitor the MQTT msgs being received by machine "C" to see what they are.

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [16 July 2020 09:26 UTC](https://discourse.nodered.org/t/mqtt-question-in-light-of-what-has-recently-happened/30187/3 "2020-07-16T09:26:06Z")

</div>

All things being _good_ - be it there is such a thing - 99.99% of the time they work.  
The commands are sent and they are obeyed.

Probably / could be problems with the nodes at the end. (Who knows)

But the _commands_ are sent over `MQTT` from one machine to another.

Yes (as per your example): _machine a_ has a `MQTT OUT` node and _machine b_ has a `MQTT IN` node.  
_Machine c_ (or \*_another_ machine) is the broker.

So with _a_, _b_ and _c_ all online things ..... work.

Machine _c_ was turned off - gone.... not existing. Being re-flashed / built / what ever.  
What it is/was at that time: no longer existing.

During that time _machine a_ sent a `MQTT` message and _machine b_ received it, or part there of.

Is the broker essential for `MQTT` to work?

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [16 July 2020 09:28 UTC](https://discourse.nodered.org/t/mqtt-question-in-light-of-what-has-recently-happened/30187/4 "2020-07-16T09:28:02Z")

</div>

> [@Trying\_to\_learn](#):
>
> During that time _machine a_ sent a `MQTT` message and _machine b_ received it, or part there of.
> 
> Is the broker essential for `MQTT` to work?

In which case Machine A and B are connected to an MQTT broker that is not on Machine C.

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [16 July 2020 09:33 UTC](https://discourse.nodered.org/t/mqtt-question-in-light-of-what-has-recently-happened/30187/5 "2020-07-16T09:33:21Z")

</div>

Well, _a_ and _b_ have their `MQTT` nodes configured to use _c_ as the broker.  
(192.168.0.99)

That machine did not exist during the time of the message from _a_ to _b_.

Well, unless raspbian comes with MQTT pre-installed by default.

I flashed the SD card with the `BUSTER` image and was updating/upgrading it.

It is an **OLD** machine. 2 x USB ports and a yellow composite video output.

So how did the message get from _a_ to _b_ if there is no broker?  
The IP address they know as the broker didn't have MQTT installed. Unless - as I said - Buster comes with MQTT pre-installed.

As the new O/S didn't work (well, it did, but CPU @ 100% all the time: it isn't usable.) I took out the new SD card and put back the old(er) one with Stretch.

Back to what was (and working)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [16 July 2020 09:42 UTC](https://discourse.nodered.org/t/mqtt-question-in-light-of-what-has-recently-happened/30187/6 "2020-07-16T09:42:03Z")

</div>

> [@Trying\_to\_learn](#):
>
> That machine did not exist during the time of the message from _a_ to _b_

Are you certain? Perhaps you have a duplicate IP? Try turning it off while pinging that IP?

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [16 July 2020 09:52 UTC](https://discourse.nodered.org/t/mqtt-question-in-light-of-what-has-recently-happened/30187/7 "2020-07-16T09:52:05Z")

</div>

It isn't I want to be annoying in what I am saying.

(The long story)

The machine:

```auto
Raspberry Pi Model B Rev 2

PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
VERSION_CODENAME=stretch
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Raspberry Pi reference 2018-03-13
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 00013d7972122d1304aacda8fff5098f073ceb43, stage5

```

IP address 192.168.0.99

That is my **MQTT Broker**  
All machines on the network have their `MQTT` nodes set to talk to it.

It is Stretch and as much as it is great, the people at RasPi updated the kernel a while back and it killed the ability for the device to be a WAP, which I wanted.

**Buster** (supposedly) supports WAP and it has become really annoying not having the WAP, so I decided to update.

192.168.0.99 powered down. SD card out. New SD card in with Buster.  
Set it up as the same IP address as the old SD card, as basically it is going to be the same machine anyway.

So, with the IP set, I plug in the Cat-5 cable and `sudo apt update` and then `sudo apt -y upgrade`.

This took about 30 minutes.

During this time _machine a_ sent a message out via MQTT and _machine b_ received most of the command.

Note: Now and then even with the _old_ card that would happen. So as I said: it could be a problem with the node at the end. Not my problem.

I am stating that the MQTT message got through when I did **not** have a broker machine.

How is this possible?

Or as I keep asking: Does BUSTER come with MQTT pre-installed?  
Though that can't be true as my thermometer which also uses MQTT was screaming that it couldn't find the BROKER.

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [16 July 2020 09:55 UTC](https://discourse.nodered.org/t/mqtt-question-in-light-of-what-has-recently-happened/30187/8 "2020-07-16T09:55:20Z")

</div>

> [@Trying\_to\_learn](#):
>
> During this time _machine a_ sent a message out via MQTT and _machine b_ received most of the command.

What do you mean by "most"?

Pis do not come with a broker preinstalled and running.

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [16 July 2020 10:00 UTC](https://discourse.nodered.org/t/mqtt-question-in-light-of-what-has-recently-happened/30187/9 "2020-07-16T10:00:20Z")

</div>

> [@knolleary](#):
>
> What do you mean by "most"?

(Sorry, not angry at you.)

I have a samsung TV. I have the nodes to control it.

Machine _a_ has a schedule to send commands to the TV.  
Machine _b_ is an IR HUB that transmits

.  
.  
.

Oh _(&_&^_(&(_&\*(&

It is sent by HDMI not IR.

# I am sorry.

I am just stressed out by trying to update from Stretch to Buster - and it not working.  
While I was trying to get it working an event happened and I got .... _distracted_ by it working because I thought it was via MQTT and it was really by HDMI.

I'm stupid. We (you) already know that.

I'll shut up now.

Again: Sincerest apologies.

---

<div class="post-metadata">

### Author: ![Nodi.Rubrum](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodi.rubrum/32/107482_2.png) [@Nodi.Rubrum](https://discourse.nodered.org/u/Nodi.Rubrum)
#### Post date: [17 July 2020 12:43 UTC](https://discourse.nodered.org/t/mqtt-question-in-light-of-what-has-recently-happened/30187/10 "2020-07-17T12:43:09Z")

</div>

Side note, I finally decided that upgrade in place between Stretch to Buster is just not worth the headaches. I changed how I deploy applications above the OS, so I can create a new base image for a given OS distribution, and then install applications as needed. If you dig into the documentation of Debian based OSes, and lurk in the various forums, a full distribution upgrade in place is actually discouraged. It is typically not recommended, I have heard many times from various sources. I worked for a Fortune 50 firm for decades doing OS deployment strategies... and we never did a distribution upgrade in place, we automated OS deployment and application deployment, both as part of our DR strategy, and as validation for new application deployments, between DEV, UAT and PROD.

---

<div class="post-metadata">

### Author: ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)
#### Post date: [17 July 2020 14:34 UTC](https://discourse.nodered.org/t/mqtt-question-in-light-of-what-has-recently-happened/30187/11 "2020-07-17T14:34:18Z")

</div>

> [@Trying\_to\_learn](#):
>
> # I am sorry.
> 
> I am just stressed out

Maybe we should kindly ask management to assign a new category for you 🙃  
Never wrong to ask...but sometimes...not so bad to check twice & test first

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [17 July 2020 21:27 UTC](https://discourse.nodered.org/t/mqtt-question-in-light-of-what-has-recently-happened/30187/12 "2020-07-17T21:27:59Z")

</div>

I wasn't upgrading it in place.

I got a new SD card and put Buster on it from blank.

Stretch was on another SD card altogether.

I am updating to Buster because Stretch used to (note: past tense) support WAP.  
One day I did an update and the new kernel blacklisted the WiFi dongle which - until then - had been working fine.

RasPi won't talk to me unless I am using Buster.

As I kind of want the WAP part I decided to update to Buster.  
If I knew how to _downgrade_ Stretch to the previous working version: I would.

---

<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: [31 July 2020 21:28 UTC](https://discourse.nodered.org/t/mqtt-question-in-light-of-what-has-recently-happened/30187/13 "2020-07-31T21:28:07Z")

</div>

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