Help with Filesystem

Hello,

I am running Node-RED on a raspberry pi 4. For future projects I would like a reliable way to read files from other raspberry pi's on the same network, as well as, windows 10 computers.

To give a little context, I have a different node-RED program running on a Windows 10 PC that uses the file in node to read the contents of a file on another Windows 10 PC on our network. In the file in path I use "\\hostname\C$\path-to-file" to access the contents of the file. This works as expected.
I'm not able to use this method for Windows-Pi, Pi-Windows, or Pi-Pi. It only works Windows-Windows.

Is there another format that will allow me to do this? Or is there a limitation using the file in node?

I have also tried using node-red-contrib-scp to read Pi-Pi, and Pi-Windows with no luck.

I know about how to setup share folders both on the Windows side and the Pi side but this is not an acceptable solution in my situation.

Is there a node package or method that will allow me to achieve this task?

You can't get a C: path on a pi becase the linux fs's don't use drive letters. The reason you can't access the c$ windows device path from a pi will be because node-red is running under a user id that isn't allowed access to the Windows C: drive.

You should create a new shared drive on the windows device and give permission for the pi user to access it.

requires the pi's filing system to already have the shared drive mounted.

requires you to have set up OpenSSH on the Windows device.

Since you are running NR on Winodws, why not use it to stream the data over on request?

1 Like

Thank you for the reply. I should have made a couple of things more clear.

  1. Creating a shared folder isnt really an option I'd like to pursue since our IT department is very strict on that sort of thing. That's why I'm trying to find another way.

  2. I was using the PC for a different project when I used the other method. In this project I won't have a dedicated PC to use.

I have the user credentials that has access to the computer and files I need if there is another way?

I'm rather rusty on SAMBA but did you try a uri like smb://hostip/...?

That is something I wabted to try but I wasn't sure if Samba requires any setup on the PC side that I am reading the files from?

Samba is the Linux implementation of Windows SMB file sharing protocols. The smb: uri's only work on the Linux side. You don't need anything special on the Windows side as SMB is native to Windows.

So on the Pi do I need to configure anything besides having Samba installed?

In general, no. Only if you want to make use of NETBIOS names which these days shouldn't be needed.

Ok I will give this a try this week and post the results. Thank you.

I was able to access a share on a PC using the Pi's file manager pointed to the address smb://hostname/share a prompt opened asking me to enter the user, domain, and password. I entered my credentials and was able to access the subsequent folders and files successfully. However I have not been able to access using Node-RED.

I tried using node-red-contrib-filebrowser and node-red-contrib-smb and couldn't get either of them working. For the file path on each of them I tried various iterations such as \\hostname\share, //hostname/share, smb://hostname/share, but none of them were able to access the share. I realize this explanation is a little vague but I wanted to see if someone could suggest the right way, rather than me explain details of all the wrong ways I have tried. But I will provide detailed steps I've tried if it will help.

It appears to me after doing some investigation that both of the packages I mentioned in my last post have not been updated for over 2 years. I have seen others run into the same issues I have with no resolutions and the authors of the packages are nowhere to be found.

Is there another convenient way to access the smb share? I would like to stay away from mounting and using a local address because it could be possible that I would need to mount up to 56 different shares at a time and that sounds messy.

Sorry to blow up the feed but I just read on another forum post that if I use the general reply at the bottom rather than the reply to your post you won't get notified. Sorry about that.

's OK. People will see a notification that there is an unread message in the thread if they've left the thread set to "watching" which is the default if you have responded to the thread.

I don't have an answer to your last question though I'm afraid.

So to your knowledge there is no other way to access the share in Node-RED?

At this point, Id probably gather these 56 locations into a DFS and then mount 1 point

Alternatively, make a script that mounts all of these these at startup.

Once mounted, it is simple file read / file write nodes!

My last attempt to avoid mounting, is there any way to use an smb uri or something to access the location? Is there any point in posting the errors I get when using the node packages I've mentioned?

Otherwise, I'm not familiar with DFS. Could you give me some direction?

Also when I first accessed the smb share using the file manager on the Pi, it created a shortcut on the desktop that allows me to access that share again quickly. I usually mount through the command line but I just wanted to verify that this is not an alternative way to mount?

try cifs://sharename instead of smb:// would be my only other thought

It really is not that messy to mount all the shares at once in Linux though - you would have them mount at startup and have each mount under a single mountpoint (say) /mnt/Windows/1, /mnt/Windows/2 etc etc

Craig

Where would you try that? In a file in node? I see there is a node-red-contrib-cifs I will try that as well.

Just to clarify the smb file path works in the file manager on the Pi. I just haven't found a way to replicate it in Node-RED.

One other thing I thought of is using a function node or an exec node, but I'm not sure that will be any less messy. And I have no idea where to start.

Well you could use an exec node and run a bash script and do a dynamic mount and pass it the parameter for the CIFS mount but really not sure that is going to do much for you

Craig

Yeah that doesn't seem any better. I was thinking more like running something like an smbclient command and return the output of the directory/file. But I've already talked myself out of that idea.

When you first mentioned using cifs:// were you meaning in a file in node?