Saving Files to Network Drive via NodeRED (Raspberry Pi)

Recently I needed to save a csv file to a network location in NodeRED. After searching various places on how to mount my drive I finally found a method that uses cifs.

1. Create a location you want to map your drive.

cd /
 mkdir mnt
 mkdir /mnt/

2.Find the local IP address of the computer/drive you want to mount, if you know it skip this step. If you know the computer/drives name you can ping it in terminal and get its IP address.

ping
ping "name of your pc/drive"

The local IP address of the target computer will be displayed.

3. Edit your /etc/fstab. I like to use the graphical file manager instead of locating the file in terminal and opening it.

sudo pcmanfm


This opens File Manager as root

Navigate to your main directory then to /etc and find the file named fstab. My prefered editor is Geany, since you ran file manager as root you can just click open with Geany and you will fstab with root privileges.

4. Add the following code to your fstab file.
If there are spaces in your path name replace them with \040

//[IPaddress/folder to mount] [location to mount] username=[username],password=[password],iocharset=utf8,sec=ntlm 0 0

5. Update and load your fstab file.

mount -a

6. Navigate to [location to mount] and you should see your network drive. Since we edited the fstab file this will automatically mount on boot.

7. Go to your node red flow and add the path you want to save to just like it was a physical location on your Pi. I have the option to change my file name so mine is formatted in a function node that outputs msg.filename to a file node.

There you go and now your RPi’s data is being saved to a network location to be accessed by every one with access to that computer. This is good if multiple people want use the data collected by your Pi but you don’t want them to ssh/vnc/or have access to other files on your Pi.

Related Posts

WiFi Scale (ESP-8266 MQTT Scale)

A DIY Mass Flow Meter for Process Measurement

Ultrasonic Level Sensor for Water Level Measurement (Arduino Nano + HC-SRF05)

This is a level sensor I built for my Raspberry Pi PLC for Membrane Filtration. Here is a comparison of a SEIMENS SITRANS Ultrasonic level sensor and my…

Raspberry Pi Laboratory R&D Automation

How I built a custom PLC system and sensors for process data collection and control.

This Post Has 16 Comments

  1. Just desire to say your article is as amazing. The clarity in your post is simply great and i can assume you’re an expert on this subject. Well with your permission let me to grab your feed to keep updated with forthcoming post. Thanks a million and please carry on the gratifying work.

  2. Just desire to say your article is as amazing. The clarity in your post is simply great and i can assume you’re an expert on this subject. Well with your permission let me to grab your feed to keep updated with forthcoming post. Thanks a million and please carry on the gratifying work.

  3. Just desire to say your article is as amazing. The clarity in your post is simply great and i can assume you’re an expert on this subject. Well with your permission let me to grab your feed to keep updated with forthcoming post. Thanks a million and please carry on the gratifying work.

  4. Just desire to say your article is as amazing. The clarity in your post is simply great and i can assume you’re an expert on this subject. Well with your permission let me to grab your feed to keep updated with forthcoming post. Thanks a million and please carry on the gratifying work.

  5. fantastic publish, very informative. I wonder why the other experts of this sector don’t understand this. You should continue your writing. I’m confident, you have a huge readers’ base already!

  6. fantastic publish, very informative. I wonder why the other experts of this sector don’t understand this. You should continue your writing. I’m confident, you have a huge readers’ base already!

Leave a ReplyCancel reply

Exit mobile version