Node-red-contrib-fs not finding /dev/ttyUSB0

On a Pi (Zero) running Raspbian Buster when I do
ls /dev/tty*
I see lots of entries, including ttyUSB0, provided something appropriate is plugged in. However, when I try to find that with node-red-contrib-fs it does not find it. In fact it doesn't seem to find anything in /dev except linked entries added by udev rules. Is this expected?

Node-RED version: v1.0.3
Node.js version: v10.18.0

node-red-contrib-fs 1.2.0
I saw this is a recent release and tried downgrading to the previous one to no avail.

@zenofmud worked on this exact part of the node. I'm trying to remember if I saw anything that could explain this when I last worked on this node. It might have to do that files in /dev/ aren't regular files, and for NodeJS to treat them differently, but I'd have to dive in the NodeJS docs to see for sure.

currently it only works with Files and Folders. The tty* are character special files. Let me take a look at what it would take to list them to.

Ah, ok. It isn't actually an issue for me as I realised I would be better to use a udev rule to ensure that the device (a 3D printer) always mounts as a unique device (/dev/ttyEnder3) and the node does find /dev/ttyEnder3, presumably as is a link rather than the special file type. I am testing for it present in order to automatically connect Octoprint to the printer when it is plugged in.

Not related to this question but I appear to have found a rather nasty issue with version 1.2.0 of node-red-contrib-fs if Show Hidden Files is selected. After hitting it a couple of dozen times it crashes node red. The previous version does not have this problem.

1 Like

Are you hitting the inject because you didn't get response or do you wait for it to respond before hitting it again?

I am waiting for it to come back, it is not that multiple calls are happening at once.

In your flow you use a file pattern of fred what is that?

It isn't anything in particular, there is no such file. It doesn't make any difference which directory you search or what you look for as far as I can see. The critical thing is the hidden files.

v1.3.1 is now released that fixes Colin's issue.

As mentioned, the current version of fs doesn't list dev "files", if you'd like that option, please raise an issue, it isn't hard to add.

Now you know why I did support and not development :stuck_out_tongue_closed_eyes:

@Colin One thing to be aware of is when you want to avoid looking in a folder. Say you have
and you want to look everywhere buy in /dev The way to do it would to configure the folder pattern as *,!dev with a level of 2. In english that would be "Start at / and look down two levels but ignore the 'dev' folder and it's dependencies"

Just something to keep in mind.