# COM port as input to Serial Node

**URL:** <https://discourse.nodered.org/t/com-port-as-input-to-serial-node/30238>\
**Category:** General\
**Created:** [17 July 2020 01:55 UTC](https://discourse.nodered.org/t/com-port-as-input-to-serial-node/30238 "2020-07-17T01:55:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![T0T4R4](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/t0t4r4/32/10850_2.png) [@T0T4R4](https://discourse.nodered.org/u/T0T4R4)\
**Post date:** [17 July 2020 01:55 UTC](https://discourse.nodered.org/t/com-port-as-input-to-serial-node/30238/1 "2020-07-17T01:55:26Z")

</div>

Hi all,

I am reusing a flow on 4 machines. On each machine an arduino is plugged in.  
Because it's windows, different COM ports are attributed to each arduino (well we can change them in Device Manager, but not sure they persist upon each replug, do they ?).  
On the flow I have a global specifying the name of each COM port for each hostname.

I need each independent flow to connect to the right arduino on the machine it runs.

But currently the Serial node does not take the host as input parameter (it wants the connection to be specified at design time).

Do you have a solution to propose to this ?

Thanks !!

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [17 July 2020 08:09 UTC](https://discourse.nodered.org/t/com-port-as-input-to-serial-node/30238/2 "2020-07-17T08:09:43Z")

</div>

Can you use environment variables to specify the port ? ${env\_var} syntax in the config ? They are then read/set at deploy time.

---

<div class="post-metadata">

**Author:** ![T0T4R4](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/t0t4r4/32/10850_2.png) [@T0T4R4](https://discourse.nodered.org/u/T0T4R4)\
**Post date:** [19 July 2020 23:26 UTC](https://discourse.nodered.org/t/com-port-as-input-to-serial-node/30238/3 "2020-07-19T23:26:05Z")

</div>

Thanks mate, i'll have a look at this.

But also I found that by manually assigning a COM port in the Windows Device Manager, it does the job 🙂

---

<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:** [2 August 2020 23:26 UTC](https://discourse.nodered.org/t/com-port-as-input-to-serial-node/30238/4 "2020-08-02T23:26:05Z")

</div>

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