Serial-in in Debian

I am migrating my Node-Red flows from an older 1.x Node-Red that was running in a rPi, to the current version running in a PC with Debian.
I am using RFLink 443Mhz receiver board which is connected over USB.
My flow had a serial-in connected to /dev/ttyUSB0.

In my new setup, it says "not connected". When I got to the wizard, I can see the /dev/ttyUSB0 port in the dropdown when I search.
I think it is connected correctly because I see this:

NodeRedServer:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

And this:

NodeRedServer:~$ sudo dmesg | grep tty
[    0.053967] printk: console [tty0] enabled
[    0.821566] 00:01: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    0.823223] 0000:00:16.3: ttyS1 at I/O 0xf0a0 (irq = 19, base_baud = 115200) is a 16550A
[    2.373245] systemd[1]: Created slice system-getty.slice.
[    2.812173] usb 1-5: ch341-uart converter now attached to ttyUSB0

Is it possible that it works different in Debian as in Raspbian?

Look at:

and try one of those paths. That way, you wont get caught out if it changes.

Also, did you copy over your .node-red folder to the PC - complete with node_modules folder? Because if you did, it won't work. You need to do cd ~/.node-red && npm rebuild.

No, it is a brand new install. I install Node-Red with the install script, added the nodes manually, and imported my flows one-by-one.

I get an error that this port not exists, if I am trying to use that ID.

"[serialconfig:744e8e141f50c2da] serial port /dev/serial/usb-1a86_USB2.0-Serial-if00-port0 error: Error: Error: No such file or directory, cannot open /dev/serial/usb-1a86_USB2.0-Serial-if00-port0"

Damn, the pi user on the rpi set up with all access conveniently.
But this time I had to add myself to the dialout group to have access to serial:

sudo adduser second_user dialout

It works now :slight_smile:

1 Like

OK, check the permissions next I think?

So if you are using the usual ttyUSBx devices, the user running Node-RED needs to be a member of the dialout group (assuming your config is the same). But if using the by-id devices, you shouldn't need any special permissions.

Ah, I see we crossed posts.

That should be /dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0 as @TotallyInformation suggested.


Thanks you. Yes it is working now. This is a very good tip. I had 2 USB serial devices in the past and it made me mad whenever they changes places (ttyUSB0 <> ttyUSB1).

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