# I am receiving MQTT messages from a device that is not powered on

**URL:** https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929
**Category:** General
**Created:** [13 September 2024 02:57 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929 "2024-09-13T02:57:15Z")
**Posts on this page:** 20
**Page:** 2

<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: [13 September 2024 09:17 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/21 "2024-09-13T09:17:00Z")

</div>

```auto
pi@TimePi:/var/log/mosquitto $ apt policy mosquitto
mosquitto:
  Installed: 1.5.7-1+deb10u1
  Candidate: 1.5.7-1+deb10u1
  Version table:
 *** 1.5.7-1+deb10u1 500
        500 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages
        100 /var/lib/dpkg/status
pi@TimePi:/var/log/mosquitto $ 

```

---

<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: [13 September 2024 09:26 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/22 "2024-09-13T09:26:32Z")

</div>

It looks like `log_timestamp` was added in mqtt v5 and is not backward avaliable in mqtt v3 which seems to be what you are using:  
`Sep 13 18:52:33 TimePi systemd[1]: Stopped Mosquitto MQTT v3.1/v3.1.1 Broker.`

So you have two choices

1. upgrade your MQTT broker to version 5.1
2. add a formatted timestamp to the msg being published

---

<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: [13 September 2024 09:28 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/23 "2024-09-13T09:28:01Z")

</div>

> [@zenofmud](#):
>
> It looks like `log_timestamp` was added in mqtt v5 and is not backward avaliable in mqtt v3

It works for me on an old system running 3.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: [13 September 2024 09:29 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/24 "2024-09-13T09:29:18Z")

</div>

Thanks very much.

I can live with things as is - kind of.

Alas this _problem_ has now faded into **INSIGNIFICANCE** ☹😭

I'll post back in the main thread.

---

<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: [13 September 2024 09:45 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/25 "2024-09-13T09:45:53Z")

</div>

Ok, update to all.

Ok, there is a _problem_ with reading the `log files`.  
Yeah, well, as of now that doesn't even register as a problem.

I am back to the original problem but with a different device!

# Recap:

Originally there was some weird _feedback loop_ with a `TASMOTA` device.  
I'm not sure what happened.  
But I got home and noticed the device was not telling my system it was alive.

Looking at it's `MQTT-IN` node weird things were happening.  
I can't remember the exact details, but even powering down the device and powering it back up, somehow a _feedback loop_ started.

I put a `gate` node in this loop - which is/was kinda obvious.  
I closed (stopped) the `gate`. Things settled down. I opened (started) the `gate`.  
It was fixed.

(Go figure.)

I tested it a few times and it seems to be working.  
For clarity:  
The `MQTT-IN` node was spitting messages out hand over fist originally.  
Now it is quiet.

(No blame assigned)  
I tried to look at the log file and read the time stamps.  
Doing this I STOPPED the broker, edited the file and tried to START the broker.  
It threw up the error and so I had to edit the `config` file back to the original format.

## HOWEVER!

As soon as I did, I got bombarded with voice messages.

**LUCKILY** I have determined that if I disable the `VOICE` `MQTT-IN` node, things work.  
Local messages on the same machine things work.  
If I then enable (well, ok open a `gate`, but what ever...) the `MQTT_IN` node:

# BOOM!

FLOODED with messages.  
Ok, I admit, it may be just one. I'll get back to that in a moment.

There is NO OUTPUT back to the `VOICE` topic from the working part of the code/flow.

So, on my NUC (this machine) I put a `MQTT-IN` and set the topic to `VOICE` and then I put a `debug` node.

 ![Screenshot from 2024-09-13 19-43-23](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/c/5c328929682904242bf12d17543a49ed8bcebec1.png)

So _something_ is just constantly broadcasting this message.

But it started when I stopped/failed to start and then got it started.

While typing this, I do have a theory.

But want to get it out there while I am still able.

---

<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: [13 September 2024 10:15 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/26 "2024-09-13T10:15:50Z")

</div>

# **I AM AN IDIOT!**

Found it!

Alas I found a small trace and it was all related to the original problem.

Edited the code and now all working.

## Sorry folks.

---

<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: [15 September 2024 20:41 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/27 "2024-09-15T20:41:21Z")

</div>

> [@Trying\_to\_learn](#):
>
> ```auto
> pi@TimePi:/var/log/mosquitto $ apt policy mosquitto
> mosquitto:
> Installed: 1.5.7-1+deb10u1
> 
> ```

It seems likely that the time format feature was introduced in mosquitto 1.6, which would explain why it fails for you with 1.5.7

---

<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 September 2024 08:48 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/28 "2024-09-16T08:48:48Z")

</div>

Without wanting to sound like a _stick in the mud_, is there a way to update from 1.5.7 to 1.6?

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [16 September 2024 09:09 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/29 "2024-09-16T09:09:42Z")

</div>

This is on a Raspberry Pi?

On my Pi` apt policy mosquitto` gives

```auto
mosquitto:
  Installed: 2.0.11-1.2+deb12u1
  Candidate: 2.0.11-1.2+deb12u1

```

Edit - reading @Colin below - You still have ~~Jessie~~ Buster. That explains the Mosquitto version.

---

<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 September 2024 09:10 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/30 "2024-09-16T09:10:48Z")

</div>

The problem is that you are on Jessie and 1.5.7 is the latest version available in raspbian repos.

This may still work, I don't know.

> **[Mosquitto Debian repository](https://mosquitto.org/blog/2013/01/mosquitto-debian-repository/)**
>
> On a previous post I described how to make mosquitto debian packages. This
> turned out to be a bit problematic, so I've now put up an experimental debian
> repository for mosquitto. It includes packages

---

<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 September 2024 09:13 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/31 "2024-09-16T09:13:05Z")

</div>

No, I have BUSTER.

```auto
pi@TimePi:~ $ sudo apt update | grep upgradable && sudo apt list --upgradable | grep mosquitto

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

W: GPG error: http://ftp.de.debian.org/debian buster-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9
E: The repository 'http://ftp.de.debian.org/debian buster-updates InRelease' is not signed.
pi@TimePi:~ $ 

```

---

<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 September 2024 09:15 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/32 "2024-09-16T09:15:00Z")

</div>

Sorry Colin, I have BUSTER on my main RasPie machines now.

It has been ..... a year?.... since the update.

SOME of the machines MAY be running an older version.  
But that is because they are seldom used.

---

<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 September 2024 09:29 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/33 "2024-09-16T09:29:32Z")

</div>

```auto
W: GPG error: http://ftp.de.debian.org/debian buster-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9
E: The repository 'http://ftp.de.debian.org/debian buster-updates InRelease' is not signed.

```

What does this show?  
cat /etc/apt/sources.list && ls /etc/apt/sources.list.d/

---

<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 September 2024 09:33 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/34 "2024-09-16T09:33:05Z")

</div>

To the first part:

 ![Screenshot from 2024-09-16 19-31-16](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/5/0525d535e5ca7cefb3480f1fc89669ec8000fe63.png)

and the second part:

```auto
pi@TimePi:~ $ cat /etc/apt/sources.list && ls /etc/apt/sources.list.d/
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
deb http://ftp.de.debian.org/debian buster-updates main
nodesource.list raspi.list vscode.list
pi@TimePi:~ $ 

```

---

<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 September 2024 10:17 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/35 "2024-09-16T10:17:11Z")

</div>

> [@Trying\_to\_learn](#):
>
> `deb http://ftp.de.debian.org/debian buster-updates main`

What is that line doing there? If you don't know then comment it out and run  
`sudo apt update && sudo apt full-upgrade`  
which will probably update hundreds of packages.

You have got an up to date backup of the system of course.

---

<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 September 2024 10:18 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/36 "2024-09-16T10:18:39Z")

</div>

Hoestly, I don't know why that line is there.

I'll comment it out and try again.

Stand by.

Ummm.....

So you only want the first line not the last two?

---

<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 September 2024 10:25 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/37 "2024-09-16T10:25:07Z")

</div>

The third line is commented out already.

---

<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 September 2024 10:26 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/38 "2024-09-16T10:26:23Z")

</div>

Sorry I meant the .... third ....... link line.

---

<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 September 2024 10:31 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/39 "2024-09-16T10:31:22Z")

</div>

Which third link line?

---

<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 September 2024 10:37 UTC](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929/40 "2024-09-16T10:37:33Z")

</div>

(The machine is now kinda busy with a lot of updates.)

The `sources.list` file.

There is the first line:  
(trying to type from the screen)

`deb http://raspbian.raspberrypi.org/raspbian/ ....`  
Then there is the line `uncomment line below.....`  
Then another 2 `deb` lines.

So that is 1, 2, and 3.

I have _commented out_ the last two.

ONLY the first one is _active_.

[Previous page](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929.md?page=1)

[Next page](https://discourse.nodered.org/t/i-am-receiving-mqtt-messages-from-a-device-that-is-not-powered-on/90929.md?page=3)
