i have been searching on way to find path of usb. i found out this node
but it requires node v0.8 - v4.x+.
is there any other way ??
Have you tried actually installing it? The readme just suggests those are the ranges they prebuild binaries for - so should still be installable (with the appropriate prereqs in place).
I suspect you are missing the necessary build tools to allow it to build on install. As it says in the log you've shown - you'd need to install the Visual Studio build tools.
Aside from that, to answer your original question, I have no idea how you'd do that on Windows. There may be some command you can use the Exec node to run, but that's as much as I can suggest. May be worth exploring that route - how would you do this with just a command prompt window.
I am not aware of a native way in NR - but in powershell it is relatively trivial
You could therefore call an Exec node to do this and return the result
Craig
You can also use the WMI to get info. There are commands that will query WMI directly or you can execute via PowerShell:
Get-WmiObject -Class Win32_logicaldisk -Filter "DriveType = '2'"
Will return the drive details for removable drives.
To get even more info, try one of the following PowerShell commands:
(Get-WmiObject -Class Win32_logicaldisk -Filter "DriveType = 2").getrelated('Win32_Volume') | select *
(Get-WmiObject -Class Win32_volume -Filter "DriveType = 2") | select *
You can replace the filter to use the drive letter as well if you like.
It isn't I want to hi-jack the thread, but it has tweaked my interest.
I am using a USB thumb drive on a couple of my machines too and have/had a similar problem.
I want to write log files to the USB stick only that if the memory dies, I don't lose the whole lot. Only the USB stick.
Writing log files is a lot of I/O and could/will wear out the memory. (you know what I mean)
So sacrificing a USB stick's memory is better than the SD card.
Reading about the node node-red-contrib-usbhid
I'm confused.
(may I should ask the person who wrote it. . . . . but)
I set a flow
variable with the path to the USB stick and append the file name.
I'm not running as root
and can quite happily read/write to the USB stick.
What's the problem this node solves?
I'm not seeing it.
Well, if you don't have backups it won't make any difference if it's the usb stick or the sd card, as has been said before. You will still lose data.
If you have multiple pi's (which i believe you do) you should set up multiple usb sticks (or ssd etc) (one on each pi), then cross backup all your data. All of which NR can do.
You will then have a fairly well backed up system, along with the backups of your sd cards.
Sorry, didn't know I was.
I was just trying to assist you in developing a good backup routine, something which you haven't seemed willing to implement in the past.
This node has nothing to do with USB storage devices. It is for accessing usb hid devices such as mice,.keyboard and joysticks.
Thanks Nick. I got confused. (Typical for me)
Also, never forget when thinking about backups that all of your backups do you little good if they are all in the same place. Fire/flood/theft/etc will wipe them all out regardless.
You need at least 2 backups in different locations for important data.
Thank goodness for Iron Mountain