# I would like to know how to check the serial port unconnected message

**URL:** <https://discourse.nodered.org/t/i-would-like-to-know-how-to-check-the-serial-port-unconnected-message/68068>\
**Category:** General\
**Created:** [22 September 2022 08:46 UTC](https://discourse.nodered.org/t/i-would-like-to-know-how-to-check-the-serial-port-unconnected-message/68068 "2022-09-22T08:46:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Athurian](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@Athurian](https://discourse.nodered.org/u/Athurian)\
**Post date:** [22 September 2022 08:46 UTC](https://discourse.nodered.org/t/i-would-like-to-know-how-to-check-the-serial-port-unconnected-message/68068/1 "2022-09-22T08:46:37Z")

</div>

I would like to know how to check the serial port unconnected message.

For example, if you set msg.status.text in the debug node like the status node, you want the serial port or mqtt to check the unconnected messages in the debug node, just as the connected or connected messages are still activated.

I want to know if it is possible to receive disconnected messages from the debug node.

Below is the picture.

I want to receive the serial port COM5 error message I want from the debug node.

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

 ![status code](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/d/9de4fbc3fecda27193494a459dc631e3950cf9f5.png)  
 ![unconnect](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/6/76a5b0fbc13a1b9c3fdc5b8bf6b7e119bc55eb8e.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:** [22 September 2022 09:07 UTC](https://discourse.nodered.org/t/i-would-like-to-know-how-to-check-the-serial-port-unconnected-message/68068/2 "2022-09-22T09:07:19Z")

</div>

(Only my opinion) But I think it is bad news and bad news.

If you want to know if there is a (as per your example) a `com5` port, you would have to check that at the O/S level.

The picture you put with the `status` node won't work like that if you want to monitor the port's status.

---

<div class="post-metadata">

**Author:** ![Athurian](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@Athurian](https://discourse.nodered.org/u/Athurian)\
**Post date:** [22 September 2022 09:14 UTC](https://discourse.nodered.org/t/i-would-like-to-know-how-to-check-the-serial-port-unconnected-message/68068/4 "2022-09-22T09:14:13Z")

</div>

Ah, I want to receive the error message that I want to connect to from the debug node.  
I know what kind of error it is.  
I made it like that on purpose for testing.

---

<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:** [22 September 2022 09:17 UTC](https://discourse.nodered.org/t/i-would-like-to-know-how-to-check-the-serial-port-unconnected-message/68068/5 "2022-09-22T09:17:40Z")

</div>

Sorry, but I am still not getting the bigger picture. Debug nodes don't send messages, but I'll try to read around that.

From where is the error message coming? The `COM` port, or somewhere else?  
Is the `COM` port only for _sending_ the message else where?

I am also not the best person to be replying, as I have little work with `COM` ports on/in Node-red.

---

<div class="post-metadata">

**Author:** ![Athurian](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@Athurian](https://discourse.nodered.org/u/Athurian)\
**Post date:** [22 September 2022 09:25 UTC](https://discourse.nodered.org/t/i-would-like-to-know-how-to-check-the-serial-port-unconnected-message/68068/6 "2022-09-22T09:25:08Z")

</div>

A message stating that it is connected sends a message from the status node to the debug node.  
If you set status.text in the debug node, it says connected or connecting.  
However, the error code cannot be checked in the debug node.

---

<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:** [22 September 2022 09:28 UTC](https://discourse.nodered.org/t/i-would-like-to-know-how-to-check-the-serial-port-unconnected-message/68068/7 "2022-09-22T09:28:07Z")

</div>

No - you are correct - the **error code** can't be checked in the debug. For a couple of reasons.

1 - the `debug` is looking for `status.text`. Not what the error is.  
2 - errors are not status messages.

If you want to see the error message you may need to use the `catch` node and point it to the `com port` node.  
(open the `catch` node and change it from `ALL NODES` to `SELECTED`.)

That may help you. Not sure.

---

<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:** [22 September 2022 15:14 UTC](https://discourse.nodered.org/t/i-would-like-to-know-how-to-check-the-serial-port-unconnected-message/68068/8 "2022-09-22T15:14:21Z")

</div>

The debug node is just for displaying the content of messages. You can feed the status node into, for example, a Switch node and check the message content in there. Or into a function node.

---

<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:** [22 September 2022 15:41 UTC](https://discourse.nodered.org/t/i-would-like-to-know-how-to-check-the-serial-port-unconnected-message/68068/9 "2022-09-22T15:41:38Z")

</div>

Sorry Andrew, I see I replied to your post instead of @Athurian.

---

<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:** [24 September 2022 11:38 UTC](https://discourse.nodered.org/t/i-would-like-to-know-how-to-check-the-serial-port-unconnected-message/68068/10 "2022-09-24T11:38:48Z")

</div>

(Sorright. We all make mistakes.)

---

<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:** [23 November 2022 11:39 UTC](https://discourse.nodered.org/t/i-would-like-to-know-how-to-check-the-serial-port-unconnected-message/68068/11 "2022-11-23T11:39:14Z")

</div>

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