# Is there a way to process with the contents of "debug messages"?

**URL:** <https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930>\
**Category:** General\
**Created:** [25 June 2020 02:30 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930 "2020-06-25T02:30:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![yossy4](https://avatars.discourse-cdn.com/v4/letter/y/c67d28/32.png) [@yossy4](https://discourse.nodered.org/u/yossy4)\
**Post date:** [25 June 2020 02:30 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/1 "2020-06-25T02:30:18Z")

</div>

Hey, guys.

Raspberry Pi and Azure IoT Hub are connected via MQTT.  
Sometimes the connections are bad and the devices disconnect from each other.  
If you get disconnected, restart your browser or "restart the flow" and the connection will be restored.

It is a hassle to do it manually each time.  
Is it possible to restart the flow automatically?

In the debug messages, the following error is output.

```auto
06/02/2020 9:21:34 node: Azure IoT Hub
msg : string[62]
"Error while trying to send message:Error: client disconnecting"

```

Is it possible to restart the flow if this message is caught?  
Thanks.

 ![キャプチャ](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/0/a0a68d4f86e98715d34b1458ee6a477265432881.png)

---

<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:** [25 June 2020 04:28 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/2 "2020-06-25T04:28:44Z")

</div>

On which machine is you `MQTT broker`?

It could be a problem with it too.

Also - but don't ask me - there is a setting somewhere that sets how long it is to keep trying before it says it can't connect. I think.

Another thing could be to do with the `MQTT` node.

Open the `configure node` list (top right-ish) of the browser window.

Look for the `MQTT` node/s.

![Screenshot from 2020-06-25 14-27-09](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/1/819c4f5ad789b4ad264e42127a7db36498aa034c.png)

Though I have 2 showing, really there should only be **one**.  
If you have more than one, that could be causing problems.

---

<div class="post-metadata">

**Author:** ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)\
**Post date:** [25 June 2020 05:06 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/3 "2020-06-25T05:06:34Z")

</div>

Thats what the catch node in your palette is for. It can either catch all errors or just listen to a specific node and will output messages on errors for you to act on:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/3/b314d2eb13435572d1a90e69e37064bff2806556.jpeg)  
you can also use the status node which outputs messages if the text status that is below some nodes in the editor changes for the selected node. The mqtt node has a disconnected status that you could act on this way.

Johannes

---

<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:** [25 June 2020 08:07 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/4 "2020-06-25T08:07:24Z")

</div>

> [@yossy4](#):
>
> If you get disconnected, restart your browser or "restart the flow" and the connection will be restored.

If restarting the browser restores the connection then something very odd is going on as the browser only shows the current state, restarting the browser should have no effect on mqtt connections.

---

<div class="post-metadata">

**Author:** ![yossy4](https://avatars.discourse-cdn.com/v4/letter/y/c67d28/32.png) [@yossy4](https://discourse.nodered.org/u/yossy4)\
**Post date:** [26 June 2020 00:34 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/5 "2020-06-26T00:34:29Z")

</div>

Hi, Trying\_to\_learn.  
That's right. Raspberry Pi is the MQTT broker.

If you can set it in the MQTT node, that seems easier.

Should I use the MQTT node that exists by default instead of the Azure IoT Hub node?

---

<div class="post-metadata">

**Author:** ![yossy4](https://avatars.discourse-cdn.com/v4/letter/y/c67d28/32.png) [@yossy4](https://discourse.nodered.org/u/yossy4)\
**Post date:** [26 June 2020 00:36 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/6 "2020-06-26T00:36:42Z")

</div>

Hi, JGKK.

Doesn't the example node mean that it can't be used with Azure IoT Hub nodes?

I'm sorry I didn't understand.

---

<div class="post-metadata">

**Author:** ![yossy4](https://avatars.discourse-cdn.com/v4/letter/y/c67d28/32.png) [@yossy4](https://discourse.nodered.org/u/yossy4)\
**Post date:** [26 June 2020 00:39 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/7 "2020-06-26T00:39:41Z")

</div>

Hi, Colin.

Is it really?

Close your browser, restart your browser and open Node-RED.

It will reconnect.  
Is there something wrong with my environment?

---

<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:** [26 June 2020 02:02 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/8 "2020-06-26T02:02:23Z")

</div>

> [@yossy4](#):
>
> Should I use the MQTT node that exists by default instead of the Azure IoT Hub node?

I honestly can't say.

However, I would use the one supplied in Node-Red.

---

<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:** [26 June 2020 08:11 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/9 "2020-06-26T08:11:01Z")

</div>

> [@yossy4](#):
>
> Close your browser, restart your browser and open Node-RED.
> 
> It will reconnect.  
> Is there something wrong with my environment?

Can you describe please exactly the symptom you are seeing that tells you it is disconnected and what changes when you restart the browser, without touching anything else. Restarting the browser should not change anything on the server except UI related stuff.

---

<div class="post-metadata">

**Author:** ![yossy4](https://avatars.discourse-cdn.com/v4/letter/y/c67d28/32.png) [@yossy4](https://discourse.nodered.org/u/yossy4)\
**Post date:** [26 June 2020 09:21 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/10 "2020-06-26T09:21:39Z")

</div>

I understand.  
I would like to try to solve it by using the one provided by Node-RED.

---

<div class="post-metadata">

**Author:** ![yossy4](https://avatars.discourse-cdn.com/v4/letter/y/c67d28/32.png) [@yossy4](https://discourse.nodered.org/u/yossy4)\
**Post date:** [26 June 2020 09:24 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/11 "2020-06-26T09:24:32Z")

</div>

Sorry.  
It seems I was wrong.  
Communication did not recover even after restarting the browser.  
There was no recovery other than restarting the flow.

---

<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:** [26 June 2020 09:29 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/12 "2020-06-26T09:29:22Z")

</div>

@yossy4,

I don't seem to remember you answering my question I asked a long time back:

Open the `configure node` list (top right-ish) of the browser window.

Look for the `MQTT` node/s.

![Screenshot from 2020-06-25 14-27-09](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/1/819c4f5ad789b4ad264e42127a7db36498aa034c.png)

How many `MQTT` nodes do you have and do they have only one host listed?

---

<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:** [26 June 2020 09:38 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/13 "2020-06-26T09:38:15Z")

</div>

Are you using [https://flows.nodered.org/node/node-red-contrib-azureiothubnode](https://flows.nodered.org/node/node-red-contrib-azureiothubnode)?

Unfortunately there does not seem to be a github (or any other) repository linked so I don't know how you can feed the question to the node's authors or submit an issue against it.

If you want to force a restart when that message appears then if you put a Switch node on the output of the azure node you can detect the specific message using the payload Contains test, then use that to trigger a restart.

How did you install node-red on the Pi? It might be worth restarting node red in a terminal using  
`node-red-stop && node-red-start`  
trigger the error, if you can make it fail, and then copy/paste the complete log output here. That will tell us what versions of all the tools you are using and may give further information about the error.  
When pasting the log click the `</>` button and paste it in there, that will stop the forum interpreting the log as markdown text.

---

<div class="post-metadata">

**Author:** ![yossy4](https://avatars.discourse-cdn.com/v4/letter/y/c67d28/32.png) [@yossy4](https://discourse.nodered.org/u/yossy4)\
**Post date:** [29 June 2020 02:30 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/14 "2020-06-29T02:30:13Z")

</div>

I'm sorry I forgot to confirm.  
MQTT only exists in captured state, is that okay? ![c](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/5/95f4e328a2dbcdb987e4ab0a5a84a4740badaf56.png)

---

<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:** [29 June 2020 02:35 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/15 "2020-06-29T02:35:02Z")

</div>

Yeah, I think that is ok.

The only thing that worries me is HOW you have that node set up.

Open an `MQTT` node (eg)

![Screenshot from 2020-06-29 12-32-49](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/9/89ec82da864e4fe790796000a2bf6476dcfb8efb.png)

 ![Screenshot from 2020-06-29 12-32-55](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/3/d36edc1721fbfd9f274d3806c11534707230a72e.png)

More importantly the second picture.

What is yours showing?

Actually, you can just double click on the node you showed me in the picture. Sorry. My bad.

---

<div class="post-metadata">

**Author:** ![yossy4](https://avatars.discourse-cdn.com/v4/letter/y/c67d28/32.png) [@yossy4](https://discourse.nodered.org/u/yossy4)\
**Post date:** [29 June 2020 02:57 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/16 "2020-06-29T02:57:00Z")

</div>

I tried to find the same screen.  
The only difference is if there are checks to support legacy versions.

 ![d](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/8/98ede0d16d7e422af000f691cfbf1edfe185b031.png)

---

<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:** [29 June 2020 03:57 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/17 "2020-06-29T03:57:32Z")

</div>

![blah](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/a/3a9e723bc64dfe9da1008257e37723846b26bbbd.png)

I think there may be a problem.

You have IOT devices talking to your `MQTT`.

I may be wrong, but I **think** IP addresses are needed before that can work.

---

<div class="post-metadata">

**Author:** ![yossy4](https://avatars.discourse-cdn.com/v4/letter/y/c67d28/32.png) [@yossy4](https://discourse.nodered.org/u/yossy4)\
**Post date:** [29 June 2020 05:57 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/18 "2020-06-29T05:57:36Z")

</div>

I never thought.  
Let's try the operation by specifying the IP address.

---

<div class="post-metadata">

**Author:** ![yossy4](https://avatars.discourse-cdn.com/v4/letter/y/c67d28/32.png) [@yossy4](https://discourse.nodered.org/u/yossy4)\
**Post date:** [1 July 2020 08:31 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/19 "2020-07-01T08:31:49Z")

</div>

Hi, @Trying_to_learn.

It was a disappointing result.  
I entered the IP address but got the same error.

---

<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:** [1 July 2020 08:32 UTC](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930/20 "2020-07-01T08:32:26Z")

</div>

> [@yossy4](#):
>
> I entered the IP address but got the same error.

Which IP address?  
(How did you get/find/determine the IP address to enter?)

Did you reboot the computer?  
(I say that because I don't know the other _tricks_ that could be done)

[Next page](https://discourse.nodered.org/t/is-there-a-way-to-process-with-the-contents-of-debug-messages/28930.md?page=2)
