nope just in the other nodes you were trying
Craig
nope just in the other nodes you were trying
Craig
What about this ??
Craig
This looks very promising. So to make sure I have the general idea right.
Use npm in command line to install the Node.js wrapper for smbclient
In Node-RED download node-red-contrib-npm
From there I configure the npm
node to call the functions from the wrapper? These are the settings I'm thinking are correct:
NPM Module: node-samba-client
Module Style: Not sure if Module Function or Custom
If Module Function, for the function parameter would I use
await client.getFile('someRemotePath/file', 'destinationFolder/name');
Am I on the right track?
Not necessary.
Just use the setup
tab to import nodes
node-red will download the package.
Then in the function node, write code.
This is much simpler. I vaguely remember reading where I needed to adjust my settings.js file for this to work. Is that still the case?
So looking at the API on the Github page, when I run a command such as
await client.getFile('someRemotePath/file', 'destinationFolder/name');
It will map the remote file to the destination folder? Is this basically dynamic mounting like @craigcurtin mentioned?
I edited this post as I was able to use it correctly. I had to remove the first line as the "require" is not needed. Then I had to adjust "SambaClient" to "sambaClient to match the setup. It moved my file correctly.
I would still prefer if I could read the contents of the file without having to transfer/mount it. Is this possible?
Don't use require. That's what the setup tab does.
I wasn't expecting such a quick response so my edit doesn't make much sense now but I think the point still gets across. The function works properly and is pretty neat. But I am still wondering if there is a way to read the contents of the file without mounting/transferring the file. Should I give up on that?
Yes there is no concept of a "dynamic" link so it does have to be mounted/unmounted
When you finish would you post up your flow so others can see and benefit also
Craig
Just to clarify there's no way on the Pi to replicate what I'm able to do from Windows-Windows where I can essentially open/read the file without mounting?
Last question is am I in the same boat when it comes to reading Pi-Pi files on a network? No way to open/read files without mounting?
Windows just lets you think you are accessing the files with magic - what it actually does is store the credentials for access in the Credential store and then use those on an ongoing basis.
There is not the same concept in Linux - unless you do a public share that is read/write on Samba and then you basically get the same thing
Craig
So if I create a public Samba share on a Pi how would I then access it in a similar manner to Windows?
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.