# Unavailable Cannot lock port

**URL:** <https://discourse.nodered.org/t/unavailable-cannot-lock-port/17287>\
**Category:** General\
**Created:** [29 October 2019 17:05 UTC](https://discourse.nodered.org/t/unavailable-cannot-lock-port/17287 "2019-10-29T17:05:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kalamar194](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@kalamar194](https://discourse.nodered.org/u/kalamar194)\
**Post date:** [29 October 2019 17:05 UTC](https://discourse.nodered.org/t/unavailable-cannot-lock-port/17287/1 "2019-10-29T17:05:00Z")

</div>

hello , i have a problem with the serial port , the error is serial port /dev/ttyUSB0 error: Error: Error Resource temporarily unavailable Cannot lock port, please help

29 Oct 10:56:29 - [info] Node-RED version: v1.0.2  
29 Oct 10:56:29 - [info] Node.js version: v10.17.0  
29 Oct 10:56:29 - [info] Linux 4.19.75-v7+ arm LE  
29 Oct 10:56:30 - [info] Loading palette nodes  
29 Oct 10:56:33 - [info] Dashboard version 2.17.1 started at /ui  
29 Oct 10:56:34 - [info] Starting flows  
29 Oct 10:56:34 - [info] Started flows  
29 Oct 10:56:34 - [error] serial port /dev/ttyUSB0 error: Error: Error Resource temporarily unavailable Cannot lock port  
29 Oct 10:56:34 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/)

---

<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:** [29 October 2019 18:42 UTC](https://discourse.nodered.org/t/unavailable-cannot-lock-port/17287/2 "2019-10-29T18:42:00Z")

</div>

usually this means that some other app has already opened the port, or the user you are running as does not have access to it.

---

<div class="post-metadata">

**Author:** ![kalamar194](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@kalamar194](https://discourse.nodered.org/u/kalamar194)\
**Post date:** [29 October 2019 19:03 UTC](https://discourse.nodered.org/t/unavailable-cannot-lock-port/17287/3 "2019-10-29T19:03:06Z")

</div>

i dont open other app, only node-red and disabled the node "arduino node-red" only eneable node "serial port"

---

<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:** [29 October 2019 21:16 UTC](https://discourse.nodered.org/t/unavailable-cannot-lock-port/17287/4 "2019-10-29T21:16:11Z")

</div>

I don't use the arduino node, but I see it has a config node arduino-board. Does that use the serial port? If so then if you have one of these configured then I suspect it maybe using the port. Disabling the in/out nodes will not stop that. I suggest deleting them from the flow, including the config node, and see if that helps.

---

<div class="post-metadata">

**Author:** ![kalamar194](https://avatars.discourse-cdn.com/v4/letter/k/e9bcb4/32.png) [@kalamar194](https://discourse.nodered.org/u/kalamar194)\
**Post date:** [30 October 2019 17:25 UTC](https://discourse.nodered.org/t/unavailable-cannot-lock-port/17287/5 "2019-10-30T17:25:40Z")

</div>

thanks , the serial port now open

---

<div class="post-metadata">

**Author:** ![feconkar](https://avatars.discourse-cdn.com/v4/letter/f/13edae/32.png) [@feconkar](https://discourse.nodered.org/u/feconkar)\
**Post date:** [31 July 2020 04:04 UTC](https://discourse.nodered.org/t/unavailable-cannot-lock-port/17287/6 "2020-07-31T04:04:40Z")

</div>

I have the same problem and cannot find a solution. I use serial node not the arduino node. One for incomming data from arduino and one for sending data to arduino over node-red. It took one hour of try to solve the problem but i couldn't solve it.

I am trying to control some sensors and a hydraulic system and vane with a servo via rapsberry pi and arduino. Serial port problem makes this sytem useless. Do i have to use something different than serial communication (maybe modbus or wireless) or can i solve serial problem using a function like C# or Python code which are too simple and stable?

---

<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:** [31 July 2020 08:38 UTC](https://discourse.nodered.org/t/unavailable-cannot-lock-port/17287/7 "2020-07-31T08:38:29Z")

</div>

well if it can't be locked it must be already held by something else - so you need to identify which application is already talking to the serial port and stop it - and then restart/redeploy Node-RED.

---

<div class="post-metadata">

**Author:** ![feconkar](https://avatars.discourse-cdn.com/v4/letter/f/13edae/32.png) [@feconkar](https://discourse.nodered.org/u/feconkar)\
**Post date:** [1 August 2020 04:18 UTC](https://discourse.nodered.org/t/unavailable-cannot-lock-port/17287/8 "2020-08-01T04:18:06Z")

</div>

How can i find which program uses the serial port?

Because there is nothing running in dektop of pi 4 maybe a program which is running in background can cause this. But i don't know how to find it.

---

<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:** [1 August 2020 06:52 UTC](https://discourse.nodered.org/t/unavailable-cannot-lock-port/17287/9 "2020-08-01T06:52:35Z")

</div>

There is a ton of posts on the web about this. A quick search for "linux find process using serial port" returned many results.

[This one](http://semtamtam.blogspot.com/2013/05/linux-who-is-using-my-serial-port.html?m=1) should help, but if not, Google it yourself.

---

<div class="post-metadata">

**Author:** ![feconkar](https://avatars.discourse-cdn.com/v4/letter/f/13edae/32.png) [@feconkar](https://discourse.nodered.org/u/feconkar)\
**Post date:** [3 August 2020 10:43 UTC](https://discourse.nodered.org/t/unavailable-cannot-lock-port/17287/10 "2020-08-03T10:43:33Z")

</div>

I have found the problem and fix it. There is no other program or software was using serial port /dev/ttyACM0 was being used by another flow in a passive node-red window. I have to delete that page and nodes.
