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

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)

Hi @amooro_123 !
Welcome to this forum!

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.

1 Like

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.

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

If in doubt - add to dialout :singer:

sudo usermod -a -G dialout <user>

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)

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

"No such file or directory"

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

Nothing shown in debug window with this:

image

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

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:

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!

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

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

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 :man_shrugging:

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!

2 Likes

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