# Repeated message even without anyone publish it

**URL:** <https://discourse.nodered.org/t/repeated-message-even-without-anyone-publish-it/46451>\
**Category:** General\
**Created:** [29 May 2021 15:47 UTC](https://discourse.nodered.org/t/repeated-message-even-without-anyone-publish-it/46451 "2021-05-29T15:47:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kristfrizh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kristfrizh/32/42619_2.png) [@kristfrizh](https://discourse.nodered.org/u/kristfrizh)\
**Post date:** [29 May 2021 15:47 UTC](https://discourse.nodered.org/t/repeated-message-even-without-anyone-publish-it/46451/1 "2021-05-29T15:47:38Z")

</div>

Hello, i'm new with this node-red things and need some guidance regarding my problem.  
I'm using google VM as my server with mosquitto and esp32 as publisher and subscriber.  
right now, i start using 2 esp32 to communicate with publish and subscribe things.

the first one esp32 i'm using it for publisher and the others for subscribe.

I have seen a repeated messages debug is coming all the time even i'm not powering the esp32 publisher.  
Is it normal or i have done something wrong?

when i check to my subscriber esp, those data always coming even i don't power up my publisher esp32

thank you for your attention  
regards

NB here is my nodered graph

 ![Screenshot from 2021-05-29 22-45-01](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/a/2a2dfd6a67cd206e89f7771878f01afc9aeb611e.png)

and one thing  
my big goal is to use 4 esp32 to sharing some data between all of them  
Is it possible to do that with mqtt and node red?  
thank you

---

<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:** [29 May 2021 15:51 UTC](https://discourse.nodered.org/t/repeated-message-even-without-anyone-publish-it/46451/2 "2021-05-29T15:51:39Z")

</div>

Assuming the subscribe nodes and publish nodes are all connected to the same broker, it looks like you have created an MQTT loop.

You should **never** publish to the topic you are subscribed to. The message just goes round and round your network, usually ending up in crashing node-red.

---

<div class="post-metadata">

**Author:** ![kristfrizh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kristfrizh/32/42619_2.png) [@kristfrizh](https://discourse.nodered.org/u/kristfrizh)\
**Post date:** [29 May 2021 15:54 UTC](https://discourse.nodered.org/t/repeated-message-even-without-anyone-publish-it/46451/3 "2021-05-29T15:54:19Z")

</div>

oh ok i understand  
thank you very much for your reply

but how i suppose to connect with my others esp32?

---

<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:** [29 May 2021 16:01 UTC](https://discourse.nodered.org/t/repeated-message-even-without-anyone-publish-it/46451/4 "2021-05-29T16:01:30Z")

</div>

> [@kristfrizh](#):
>
> but how i suppose to connect with my others esp32?

You use a topic convention (either your own design or homie)

e.g...

ESP1 publishes  
`esp1/temperature`

ESP2 publishes  
`esp2/temperature`

ESP1 subscribes to  
`esp1/command`

ESP2 subscribes to  
`esp2/command`

---

<div class="post-metadata">

**Author:** ![kristfrizh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kristfrizh/32/42619_2.png) [@kristfrizh](https://discourse.nodered.org/u/kristfrizh)\
**Post date:** [29 May 2021 16:03 UTC](https://discourse.nodered.org/t/repeated-message-even-without-anyone-publish-it/46451/5 "2021-05-29T16:03:22Z")

</div>

thank you very much  
i think that is the answer i need

---

<div class="post-metadata">

**Author:** ![kristfrizh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kristfrizh/32/42619_2.png) [@kristfrizh](https://discourse.nodered.org/u/kristfrizh)\
**Post date:** [29 May 2021 17:08 UTC](https://discourse.nodered.org/t/repeated-message-even-without-anyone-publish-it/46451/6 "2021-05-29T17:08:34Z")

</div>

hii sory to disrupt you again  
I'm still little bit confusing

may i ask one more?

i have tried like this  
(publish)esp1/temperature -----\>(subscribe) esp2/command

but the message is not received by my esp32 subs

I need direct communication between 2 esp32  
no toggle or inject

thank you for your hospitality and patience  
regards

---

<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:** [29 May 2021 17:16 UTC](https://discourse.nodered.org/t/repeated-message-even-without-anyone-publish-it/46451/7 "2021-05-29T17:16:59Z")

</div>

> [@kristfrizh](#):
>
> i have tried like this  
> (publish)esp1/temperature -----\>(subscribe) esp2/command
> 
> but the message is not received by my esp32 subs

Why would it.

- If you subscribe to `hello` you need to publish to `hello`
- If you publish to `esp1/temperature` you should subscribe to `esp1/temperature`

> [@kristfrizh](#):
>
> I need direct communication between 2 esp32  
> no toggle or inject

You dont even need node-red in this at all. The ESPs will simply talk to the broker as 2 clients.

You can do something like this...

### ESP2 → ESP1

ESP1 - subscribe to `esp2/send/esp1`  
ESP2 - publish to `esp2/send/esp1`

### ESP1 → ESP2

ESP2 - subscribe to `esp1/send/esp2`  
ESP1 - publish to `esp1/send/esp2`

Use whatever topics you like but they should make sense and should be unique.

* * *

Without meaning to be cheeky, I think you should spend an hour reading up on MQTT - there are tonnes of videos on youtube and lots of info around the web. Get familiar with the basics before you continue.

---

<div class="post-metadata">

**Author:** ![kristfrizh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kristfrizh/32/42619_2.png) [@kristfrizh](https://discourse.nodered.org/u/kristfrizh)\
**Post date:** [29 May 2021 17:23 UTC](https://discourse.nodered.org/t/repeated-message-even-without-anyone-publish-it/46451/8 "2021-05-29T17:23:33Z")

</div>

well thank you  
that clarify my doubt

the big picture why i want use node-red is in the end after all direct communication i want to store all the value from 4 esp to my mysql.

thank you once again for clarify this for me

i got it now  
best regards

---

<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:** [12 June 2021 17:24 UTC](https://discourse.nodered.org/t/repeated-message-even-without-anyone-publish-it/46451/9 "2021-06-12T17:24:09Z")

</div>

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