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

**URL:** <https://discourse.nodered.org/t/node-red-contrib-fs-not-finding-dev-ttyusb0/20262>\
**Category:** General\
**Created:** [13 January 2020 14:32 UTC](https://discourse.nodered.org/t/node-red-contrib-fs-not-finding-dev-ttyusb0/20262 "2020-01-13T14:32:15Z")\
**Posts on this page:** 11\
**Page:** 1

<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:** [13 January 2020 14:32 UTC](https://discourse.nodered.org/t/node-red-contrib-fs-not-finding-dev-ttyusb0/20262/1 "2020-01-13T14:32:15Z")

</div>

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.

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

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [13 January 2020 15:34 UTC](https://discourse.nodered.org/t/node-red-contrib-fs-not-finding-dev-ttyusb0/20262/2 "2020-01-13T15:34:10Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 January 2020 16:03 UTC](https://discourse.nodered.org/t/node-red-contrib-fs-not-finding-dev-ttyusb0/20262/3 "2020-01-13T16:03:37Z")

</div>

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.

---

<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:** [13 January 2020 16:09 UTC](https://discourse.nodered.org/t/node-red-contrib-fs-not-finding-dev-ttyusb0/20262/4 "2020-01-13T16:09:07Z")

</div>

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.

---

<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:** [13 January 2020 16:11 UTC](https://discourse.nodered.org/t/node-red-contrib-fs-not-finding-dev-ttyusb0/20262/5 "2020-01-13T16:11:43Z")

</div>

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.

> <https://github.com/TotallyInformation/node-red-contrib-fs/issues/18>
>
> Software and Package Versions
> 
> Software
> Version
> 
> 
> Node.JS
> 10.18.1
> 
> npm
> 6.13.4
> 
> Node-RED
> 1.0.2
> 
> fs node
> 1.2.0
> 
> OS
> Ubuntu 19.10
> 
> Browser
> Waterfox Classic
> 
> 
> Note that a browser version less than current-2 or IE \< v11 very unlikely to...

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 January 2020 16:26 UTC](https://discourse.nodered.org/t/node-red-contrib-fs-not-finding-dev-ttyusb0/20262/6 "2020-01-13T16:26:03Z")

</div>

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

---

<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:** [13 January 2020 17:00 UTC](https://discourse.nodered.org/t/node-red-contrib-fs-not-finding-dev-ttyusb0/20262/7 "2020-01-13T17:00:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 January 2020 17:06 UTC](https://discourse.nodered.org/t/node-red-contrib-fs-not-finding-dev-ttyusb0/20262/8 "2020-01-13T17:06:27Z")

</div>

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

---

<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:** [13 January 2020 17:13 UTC](https://discourse.nodered.org/t/node-red-contrib-fs-not-finding-dev-ttyusb0/20262/9 "2020-01-13T17:13:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [13 January 2020 20:53 UTC](https://discourse.nodered.org/t/node-red-contrib-fs-not-finding-dev-ttyusb0/20262/10 "2020-01-13T20:53:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 January 2020 21:27 UTC](https://discourse.nodered.org/t/node-red-contrib-fs-not-finding-dev-ttyusb0/20262/11 "2020-01-13T21:27:01Z")

</div>

Now you know why I did support and not development 😝

@Colin One thing to be aware of is when you want to avoid looking in a folder. Say you have  
/  
/dev  
/tmp  
/user  
/user/colin  
/user/paul  
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.
