# Serial nodes can be deactivated if not used in a given configuration

**URL:** https://discourse.nodered.org/t/serial-nodes-can-be-deactivated-if-not-used-in-a-given-configuration/85315
**Category:** General
**Tags:** node-red-node-serialport
**Created:** [8 February 2024 08:53 UTC](https://discourse.nodered.org/t/serial-nodes-can-be-deactivated-if-not-used-in-a-given-configuration/85315 "2024-02-08T08:53:45Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)
#### Post date: [8 February 2024 08:53 UTC](https://discourse.nodered.org/t/serial-nodes-can-be-deactivated-if-not-used-in-a-given-configuration/85315/1 "2024-02-08T08:53:45Z")

</div>

Hello everyone.  
I have several serial nodes in my flow. Depending on the user's hardware configuration, not all of them are used. I would like to be able to deactivate them, but I understand that NR loads them as soon as the flows start (even though I have deactivated them in the flow according to my tests). Do you think there's a way of disabling a serial node so that it doesn't generate an error in the console saying that this device isn't present, which is indeed the case if, for example, only 1 USB port is connected and not the others?  
Note that the error has absolutely no effect on subsequent operation.  
I hope I've made myself clear, it's not easy to explain.  
Thanks for your feedback

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/d/ad599a262f1ba73fb4dac106ce23bc077b5d14c7.jpeg)

---

<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: [8 February 2024 08:57 UTC](https://discourse.nodered.org/t/serial-nodes-can-be-deactivated-if-not-used-in-a-given-configuration/85315/2 "2024-02-08T08:57:53Z")

</div>

> [@Jean-Luc](#):
>
> even though I have deactivated them in the flow according to my tests

Did you disable the serial config nodes?

---

<div class="post-metadata">

### Author: ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)
#### Post date: [8 February 2024 09:10 UTC](https://discourse.nodered.org/t/serial-nodes-can-be-deactivated-if-not-used-in-a-given-configuration/85315/3 "2024-02-08T09:10:37Z")

</div>

In fact, the user fills in fields upstream in a control panel (in HA) designating which USB port is used. This is then written to a file which is reread at NR startup to adapt to the client's configuration.  
I've tried to disable a serial port, but even in this case NR or Nodejs hogs the port and doesn't leave it available. For example, I have VMs running in parallel that have the serial port stolen even when it has been disabled in the flow.

---

<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: [8 February 2024 09:17 UTC](https://discourse.nodered.org/t/serial-nodes-can-be-deactivated-if-not-used-in-a-given-configuration/85315/4 "2024-02-08T09:17:23Z")

</div>

> [@Jean-Luc](#):
>
> I've tried to disable a serial port, but even in this case NR or Nodejs hogs the port

But have you tried disabling the serial config nodes?

Also, are you using the very latest serial node? There was a feature merged recently that introduces a `Serial Control` node: [node-red-nodes/io/serialport/README.md at master · yhur/node-red-nodes · GitHub](https://github.com/yhur/node-red-nodes/blob/master/io/serialport/README.md#serial-control)

---

<div class="post-metadata">

### Author: ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)
#### Post date: [8 February 2024 09:31 UTC](https://discourse.nodered.org/t/serial-nodes-can-be-deactivated-if-not-used-in-a-given-configuration/85315/5 "2024-02-08T09:31:03Z")

</div>

> [@Steve-Mcl](#):
>
> But have you tried disabling the serial config nodes?

Yes, disabled into the flow without success. The deactivated port is still occupied by NR, as I understand it.

> [@Steve-Mcl](#):
>
> Also, are you using the very latest serial node? There was a feature merged recently that introduces a `Serial Control` node: [node-red-nodes/io/serialport/README.md at master · yhur/node-red-nodes · GitHub](https://github.com/yhur/node-red-nodes/blob/master/io/serialport/README.md#serial-control)

This is the version i'm using. This is the docker version integrated into home assistant. Is it good ?  
NR is V 3.1.4

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/b/1b212738d23d72a39aaf3d90a977434b639b02be.png)

This what is on the function node to setup de serial

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/b/1b7411c7ff0c7d58a9032ce4e55b4930bfa8a626.png)

---

<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: [8 February 2024 09:52 UTC](https://discourse.nodered.org/t/serial-nodes-can-be-deactivated-if-not-used-in-a-given-configuration/85315/6 "2024-02-08T09:52:44Z")

</div>

> [@Jean-Luc](#):
>
> Yes, disabled into the flow without success

That does NOT disable the serial config.

Open the node, open the config (by clicking the pencil), then disable the **config**  
 ![chrome_TT2AFNoY6D](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/e/be62c22f577cded75cad1ea33840339f1ce9cf5d.gif)

---

<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: [8 February 2024 09:53 UTC](https://discourse.nodered.org/t/serial-nodes-can-be-deactivated-if-not-used-in-a-given-configuration/85315/7 "2024-02-08T09:53:50Z")

</div>

> [@Jean-Luc](#):
>
> This what is on the function node to setup de serial
> 
> ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/b/1b7411c7ff0c7d58a9032ce4e55b4930bfa8a626.png)

Where do you send that? To what kind of node?

NOTE

there is a demo flow in that link i posted - it shows you how to do dynamic control, including ENABLE/DISABLE

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/f/5fc04cd287513399af40aef0f68f9fe46ca2bc90.png)

---

<div class="post-metadata">

### Author: ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)
#### Post date: [8 February 2024 10:10 UTC](https://discourse.nodered.org/t/serial-nodes-can-be-deactivated-if-not-used-in-a-given-configuration/85315/8 "2024-02-08T10:10:00Z")

</div>

> [@Steve-Mcl](#):
>
> Open the node, open the config (by clicking the pencil), then disable the **config**

it's much better this way indeed 👍

> [@Steve-Mcl](#):
>
> Where do you send that? To what kind of node?

Which device do you mean? These are inverters and battery BMSs.

> [@Steve-Mcl](#):
>
> there is a demo flow in that link i posted - it shows you how to do dynamic control

It works in the same way as the manipulation above? if so, that's perfect. I'll have to test it as soon as possible. Top.

---

<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: [8 February 2024 10:28 UTC](https://discourse.nodered.org/t/serial-nodes-can-be-deactivated-if-not-used-in-a-given-configuration/85315/9 "2024-02-08T10:28:58Z")

</div>

> [@Jean-Luc](#):
>
> > [@Steve-Mcl](#):
> >
> > Where do you send that? To what kind of node?
> 
> Which device do you mean? These are inverters and battery BMSs.

I meant "To what kind of node" as in a serial-in node, a serial-out node, a serial-request node

All you showed was the innards of a function node.

---

<div class="post-metadata">

### Author: ![Jean-Luc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jean-luc/32/89996_2.png) [@Jean-Luc](https://discourse.nodered.org/u/Jean-Luc)
#### Post date: [8 February 2024 11:15 UTC](https://discourse.nodered.org/t/serial-nodes-can-be-deactivated-if-not-used-in-a-given-configuration/85315/10 "2024-02-08T11:15:15Z")

</div>

Ah ok, sorry, these are serial control nodes

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/6/f64f807dcd3da6f8df9bc2116122229f72992189.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/d/3d24b314f6a4d92b859af2cdae412427a8eb6716.png)

---

<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: [22 February 2024 11:15 UTC](https://discourse.nodered.org/t/serial-nodes-can-be-deactivated-if-not-used-in-a-given-configuration/85315/11 "2024-02-22T11:15:58Z")

</div>

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