# Failed serial connection to Arduino: No such file or directory error

**URL:** https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970
**Category:** General
**Tags:** docker, node-red-node-serialport
**Created:** [22 December 2023 20:02 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970 "2023-12-22T20:02:03Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![amooro\_123](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@amooro\_123](https://discourse.nodered.org/u/amooro_123)
#### Post date: [22 December 2023 20:02 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970/1 "2023-12-22T20:02:03Z")

</div>

I cannot get the serial node to connect to my Arduino Uno on a Zimaboard running Debian 11.

Node-red v3.1.3  
node.js v16.20.2

This is the error message I get in the debug window when I deploy:  
"[serialconfig:0f496120833bbdad] serial port /dev/ttyACM0 error: Error: Error: No such file or directory, cannot open /dev/ttyACM0"

I have combed through the forums and made sure permissions are set correctly, my username is in the dialout group, and added a udev rule for good measure (following the guidelines on the Arduino forum). I can connect with the Arduino IDE to program and even interact through the serial monitor. The program is closed out when attempting to connect through node-red to ensure the port isn't taken.

Confirmed that I can connect to this Arduino with the same USB cable with node-red v3.1.3 and Node.js v20.10.0 on a PC running Windows 11 Home. I was surprised the Node.js version wasn't a problem!

Any help with next steps would be greatly appreciated! Thank you.

Output of ls -l /dev/ttyACM0:  
crw-rw----+ 1 root dialout 166, 0 Dec 22 12:22 /dev/ttyACM0

Output of lsof /dev/ttyACM0:  
lsof: WARNING: can't stat() overlay file system /var/lib/docker/overlay2/8ea64174b98be2ba96997329824cf7fbf7c725de2b6d0ead19e892ad014228e1/merged  
Output information may be incomplete.  
lsof: WARNING: can't stat() overlay file system /var/lib/docker/overlay2/0558710d382a04799edaf01350ba3e3487cd9a61a2735700c32252dfa76ffa06/merged  
Output information may be incomplete.  
lsof: WARNING: can't stat() nsfs file system /run/docker/netns/default  
Output information may be incomplete.  
lsof: WARNING: can't stat() nsfs file system /run/docker/netns/93f5d6514cfd  
Output information may be incomplete.  
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME  
java 670685 casaos 104u CHR 166,0 0t0 473 /dev/ttyACM0

NOTE: I tried killing the process above and redeploying, with same error.

Output of lsusb -v for the Arduino:  
Bus 001 Device 004: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)  
Device Descriptor:  
bLength 18  
bDescriptorType 1  
bcdUSB 1.10  
bDeviceClass 2 Communications  
bDeviceSubClass 0  
bDeviceProtocol 0  
bMaxPacketSize0 8  
idVendor 0x2341 Arduino SA  
idProduct 0x0043 Uno R3 (CDC ACM)  
bcdDevice 0.01  
iManufacturer 1 Arduino (www.arduino.cc)  
iProduct 2  
iSerial 220 95237323834351F0A1E1  
bNumConfigurations 1  
Configuration Descriptor:  
bLength 9  
bDescriptorType 2  
wTotalLength 0x003e  
bNumInterfaces 2  
bConfigurationValue 1  
iConfiguration 0  
bmAttributes 0xc0  
Self Powered  
MaxPower 100mA  
Interface Descriptor:  
bLength 9  
bDescriptorType 4  
bInterfaceNumber 0  
bAlternateSetting 0  
bNumEndpoints 1  
bInterfaceClass 2 Communications  
bInterfaceSubClass 2 Abstract (modem)  
bInterfaceProtocol 1 AT-commands (v.25ter)  
iInterface 0  
CDC Header:  
bcdCDC 10.01  
CDC ACM:  
bmCapabilities 0x06  
sends break  
line coding and serial state  
CDC Union:  
bMasterInterface 0  
bSlaveInterface 1  
Endpoint Descriptor:  
bLength 7  
bDescriptorType 5  
bEndpointAddress 0x82 EP 2 IN  
bmAttributes 3  
Transfer Type Interrupt  
Synch Type None  
Usage Type Data  
wMaxPacketSize 0x0008 1x 8 bytes  
bInterval 255  
Interface Descriptor:  
bLength 9  
bDescriptorType 4  
bInterfaceNumber 1  
bAlternateSetting 0  
bNumEndpoints 2  
bInterfaceClass 10 CDC Data  
bInterfaceSubClass 0  
bInterfaceProtocol 0  
iInterface 0  
Endpoint Descriptor:  
bLength 7  
bDescriptorType 5  
bEndpointAddress 0x04 EP 4 OUT  
bmAttributes 2  
Transfer Type Bulk  
Synch Type None  
Usage Type Data  
wMaxPacketSize 0x0040 1x 64 bytes  
bInterval 1  
Endpoint Descriptor:  
bLength 7  
bDescriptorType 5  
bEndpointAddress 0x83 EP 3 IN  
bmAttributes 2  
Transfer Type Bulk  
Synch Type None  
Usage Type Data  
wMaxPacketSize 0x0040 1x 64 bytes  
bInterval 1  
can't get debug descriptor: Resource temporarily unavailable  
Device Status: 0x0000  
(Bus Powered)

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [22 December 2023 20:15 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970/2 "2023-12-22T20:15:55Z")

</div>

Hi @amooro_123 !  
Welcome to this forum!

> [@amooro\_123](#):
>
> /var/lib/docker/overlay2/8ea64174b98be2ba96997329824cf7fbf7c725de2b6d0ead19e892ad014228e1/merged

This gives the impression you're running NR from a docker container.  
If so, you'd need to apply configuration to allow the container access to this port.

---

<div class="post-metadata">

### Author: ![amooro\_123](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@amooro\_123](https://discourse.nodered.org/u/amooro_123)
#### Post date: [22 December 2023 20:54 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970/3 "2023-12-22T20:54:13Z")

</div>

Hi ralphwetzel!

Thank you for the welcome and your feedback!

The Zimaboard has CasaOS and I my plan is to run NR on Docker soon. However, this installation is NOT in a Docker container.

---

<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: [22 December 2023 21:00 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970/4 "2023-12-22T21:00:24Z")

</div>

Is the user running Node-RED part of the dial out group ?

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [22 December 2023 21:08 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970/5 "2023-12-22T21:08:00Z")

</div>

> [@dceejay](#):
>
> Is the user running Node-RED part of the dial out group ?

If in doubt - add to dialout 🧑‍🎤

```auto
sudo usermod -a -G dialout <user>

```

---

<div class="post-metadata">

### Author: ![amooro\_123](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@amooro\_123](https://discourse.nodered.org/u/amooro_123)
#### Post date: [22 December 2023 21:31 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970/6 "2023-12-22T21:31:27Z")

</div>

Definitely! Checked that box. I may have done that following one of dceejay's comments on another post about serial connection problems.

Output of id:  
casaos@CasaOS:~$ id  
uid=1000(casaos) gid=1000(casaos) groups=1000(casaos),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),106(kvm),109(netdev),113(bluetooth),118(scanner)

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [22 December 2023 21:39 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970/7 "2023-12-22T21:39:56Z")

</div>

In Node RED, using an `exec` node, execute the following : `ls /dev` (attach to `debug`)

If you do not see `ttyACM0`, then the OS layer you are using be it `Docker`, `HA` whatever it might be, is not setup to access the correct serial devices, or the OS has some strange permissions, which you need to investigate

Example using Node RED without using any HA/Docker complex setup

 ![Screenshot 2023-12-22 at 21.41.42](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/4/048d3adff819dcd85469792ed5e77d62325b2e99.png)

---

<div class="post-metadata">

### Author: ![amooro\_123](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@amooro\_123](https://discourse.nodered.org/u/amooro_123)
#### Post date: [22 December 2023 21:51 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970/8 "2023-12-22T21:51:35Z")

</div>

"No such file or directory"

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

Error message was referring to something else...sorry for the confusion.

Nothing shown in debug window with this:

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

If NR is running in Debian 11, what would be the next place to look or group to talk to?

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [22 December 2023 21:56 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970/9 "2023-12-22T21:56:03Z")

</div>

try `ls /` in the `exec` node

if `dev` is not listed - your setup is clearly using some special container, that you will need to seek support from - from the top of my head:

- Docker : [https://forums.docker.com](https://forums.docker.com)
- Home Assistant : [https://community.home-assistant.io](https://community.home-assistant.io)

---

<div class="post-metadata">

### Author: ![amooro\_123](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@amooro\_123](https://discourse.nodered.org/u/amooro_123)
#### Post date: [22 December 2023 21:59 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970/10 "2023-12-22T21:59:21Z")

</div>

Nothing shows up in the debug with `ls /` in the `exec` node.

Looks like I have some hunting to do with CasaOS and/or Docker.

Thank you for your help!

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [22 December 2023 22:00 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970/11 "2023-12-22T22:00:39Z")

</div>

I would say so, sorry - but it doesn't seem to be related to Node RED.

---

<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: [23 December 2023 07:45 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970/12 "2023-12-23T07:45:07Z")

</div>

Check all the outputs of the exec node, with debug nodes outputting full message.

---

<div class="post-metadata">

### Author: ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)
#### Post date: [23 December 2023 08:23 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970/13 "2023-12-23T08:23:11Z")

</div>

And something else I just spotted - debug is connected to `stderr` , connect to `stdout` - the first pin  
especially when checking `/` - there should be directories there (root of the volume)

So may be `/dev` is named differently for this os since you did get **No such file or directory** 🤷‍♂️

---

<div class="post-metadata">

### Author: ![amooro\_123](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@amooro\_123](https://discourse.nodered.org/u/amooro_123)
#### Post date: [23 December 2023 16:16 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970/14 "2023-12-23T16:16:25Z")

</div>

Thank you for all of your feedback. The fact that I wasn't getting any response on the `exec` node made me zoom out. Turns out Node Red was running on Debian AND running in a Docker container. The docker was auto-launching at startup and I didn't know. When I was making all of the changes in Linux it had no effect because the localhost:1880 connection defaulted to the Docker instance. Once I uninstalled the Docker container, it all started working.

The `exec` node was a huge help for testing what access I had. Much appreciated!

---

<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: [6 January 2024 16:16 UTC](https://discourse.nodered.org/t/failed-serial-connection-to-arduino-no-such-file-or-directory-error/83970/15 "2024-01-06T16:16:25Z")

</div>

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