While you can add files via scp to a Raspberry Pi, it is not always convenient. Of course you can shut it down and then plug the SSD into another PC. This is great for bulk loading but it is often helpful to be able to load a file to a running Raspberry Pi via the local LAN, cable or WiFi. It is not even necessary to stop the running PiPresents show.
This solution is compatible with any PC that can access SMB shares. Definitely Microsoft and Linux, not sure about Apple but it would seem logical for them as well. I have no Mac experience.
Let’s begin.
Install requisite software:
1 |
sudo apt-get install -y samba samba-common-bin |
A share needs to be created. This config will share /home/pi/pp_home/media to anyone. Secure shares will not be covered here.
1 2 3 4 5 6 7 8 9 10 11 12 |
sudo sed -i "$ a [media]\\ comment = media share\\ path = \/home\/pi\/pp_home\/media\\ browsable = yes\\ guest ok = yes\\ read only = no\\ force create mode = 0644\\ create mask = 0644\\ force directory mode = 0755\\ directory mask = 0755\\ force user = nobody\\ force group = nogroup" /etc/samba/smb.conf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
sudo nano /etc/samba/smb/conf Copy and paste lines below [media] comment = pp_home path = /home/pi/pp_home/media browsable = yes guest ok = yes read only = no force create mode = 0644 create mask = 0644 force directory mode = 0755 directory mask = 0755 force user = nobody force group = nogroup Save and exit nano |
1 |
sudo /etc/init.d/samba restart |
1 |
sudo service --status-all | grep samba |
After a few seconds you should get the above. If there is ‘[ – ]’ anywhere then:
1 |
sudo update-rc.d smbd defaults |
Your Raspberry Pi should now share the media folder.
No user name or password is required to access the share over your LAN.
From a PC on the network file browse to ‘\\your-raspberry-pi-ipaddress\media’.
Windows 10 insists on having credentials to connect. On the W10 PC go to:
- Control Panel >
- Credential Manager >
- Windows Credentials >
- Add a Windows Credential >
- Enter the ipaddress of the Raspberry Pi >
- Enter anything for User and Password. (windows wants them but they are not used)
Read write access should now be available over the LAN.