# Detect disconnection from tcp request node

**URL:** <https://discourse.nodered.org/t/detect-disconnection-from-tcp-request-node/42540>\
**Category:** General\
**Created:** [12 March 2021 13:57 UTC](https://discourse.nodered.org/t/detect-disconnection-from-tcp-request-node/42540 "2021-03-12T13:57:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![fmarzocca](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmarzocca/32/35901_2.png) [@fmarzocca](https://discourse.nodered.org/u/fmarzocca)\
**Post date:** [12 March 2021 13:57 UTC](https://discourse.nodered.org/t/detect-disconnection-from-tcp-request-node/42540/1 "2021-03-12T13:57:31Z")

</div>

I am using a tcp request node with "keep connection open", but sometimes it gets disconnected. How can I get the status message of the node, to trigger an action which re-connects it (a sort of home-made watchdog)?

---

<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:** [12 March 2021 13:57 UTC](https://discourse.nodered.org/t/detect-disconnection-from-tcp-request-node/42540/2 "2021-03-12T13:57:59Z")

</div>

Status node.

---

<div class="post-metadata">

**Author:** ![fmarzocca](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmarzocca/32/35901_2.png) [@fmarzocca](https://discourse.nodered.org/u/fmarzocca)\
**Post date:** [12 March 2021 14:05 UTC](https://discourse.nodered.org/t/detect-disconnection-from-tcp-request-node/42540/3 "2021-03-12T14:05:19Z")

</div>

Yes, not clear how to get the message...  
The node does not produce a payload, and in the docs I read about a "status.text"...

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [12 March 2021 14:08 UTC](https://discourse.nodered.org/t/detect-disconnection-from-tcp-request-node/42540/4 "2021-03-12T14:08:50Z")

</div>

From the node help:

```auto
status.textstring
the status text.
status.source.typestring
the type of the node that reported status.
status.source.idstring
the id of the node that reported status.
status.source.namestring
the name, if set, of the node that reported status.

```

Put a debug node on the output of the status node configured to show the complete message object.

---

<div class="post-metadata">

**Author:** ![fmarzocca](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmarzocca/32/35901_2.png) [@fmarzocca](https://discourse.nodered.org/u/fmarzocca)\
**Post date:** [12 March 2021 14:11 UTC](https://discourse.nodered.org/t/detect-disconnection-from-tcp-request-node/42540/5 "2021-03-12T14:11:26Z")

</div>

I see. But as the node doesn't produce a payload, how can I read status.text?

---

<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:** [12 March 2021 14:15 UTC](https://discourse.nodered.org/t/detect-disconnection-from-tcp-request-node/42540/6 "2021-03-12T14:15:32Z")

</div>

You can access any property of a msg. As @ghayne said,

> [@ghayne](#):
>
> Put a debug node on the output of the status node configured to show the complete message object

Then use the copy path button that appears under your mouse cursor when you hover over the item you are interested in. Then you can use change node to copy that to msg.payload

There’s a great page in the docs that will explain how to use the debug panel to find the right path to any data item.

[https://nodered.org/docs/user-guide/messages](https://nodered.org/docs/user-guide/messages)

---

<div class="post-metadata">

**Author:** ![fmarzocca](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/fmarzocca/32/35901_2.png) [@fmarzocca](https://discourse.nodered.org/u/fmarzocca)\
**Post date:** [12 March 2021 14:15 UTC](https://discourse.nodered.org/t/detect-disconnection-from-tcp-request-node/42540/7 "2021-03-12T14:15:47Z")

</div>

Thank you!

---

<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:** [26 March 2021 14:15 UTC](https://discourse.nodered.org/t/detect-disconnection-from-tcp-request-node/42540/8 "2021-03-26T14:15:55Z")

</div>

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