Adventures with Raspberry Pi - Part 2
Continuing from the previous post, let us now put the Pi to some practical uses.
File Server
The Pi can serve as a file server for home use. One could use it to store files for use across multiple computers, backup files, share media (songs, photos and videos) etc. As most of us use Windows at home, you can setup a Samba file server. You can read/write files easily from Windows computers. In addition, there are Apps for iOS and Android, so you can access these files from mobile/tablets too.
- You can SSH into the Pi and run the following commands to install Samba
- sudo apt-get update
- sudo apt-get upgrade
- sudo apt-get install samba samba-common-bin
- You could give all access to the Public folder under /home/pi/ folder using the command - chmod +777.
- Create a Samba user and password using the command - sudo smbpasswd -a pi
- Configure Samba as shown below -
- Edit the Samba configuration - sudo vi /etc/samba/smb.conf
- [share]
- Comment = Pi shared folder
- Path = /home/pi/Public
- Browseable = yes
- Writeable = Yes
- only guest = no
- create mask = 0777
- directory mask = 0777
- Public = yes
- Guest ok = yes
- Finally, restart and reload Samba using the command - sudo /etc/init.d/samba restart.
The above steps are just a one-off. Whenever the Pi is restarted, the Samba server will be up. From a a Windows computer, you can use the following address in Explorer to access the file share - \\[Pi Name]\Public. The files from the computer can now be copied to the above shared folder that you have just created.
Media Server
Digital Living Network Alliance (DLNA) was initially created by a group of consumer electronic companies. It's aim was to promote inter-operability among gadgets produced by various electronics manufacturers.
Suppose, you have copied some media files (audio and video) to the above shared folder on the Pi. You can setup a DLNA software server in the Pi. Using the DLNA server, this media can be streamed to other devices within your network.
- Install Mini DLNA server using the command - sudo apt-get install minidlna.
- Edit the DLNA configuration - sudo nano /etc/minidlna.conf.
- media_dir=A,/home/pi/Public/Music
- media_dir=V,/home/pi/Public/Movies
- friendly_name=Pi-Media-Server
- sudo service minidlna restart
- sudo service minidlna force-reload
These steps are again a one-off. The DLNA server will show up as "Pi-Media-Server" in all the clients such as a Smart TV's, Mobile/Tablet Apps etc. You can verify the DLNA server by opening the URL in browser - http://[Pi Name]:8200/, you should see the status page below.
For a more advanced media server, one can also install the Plex Media Server on the Raspberry Pi. In the Plex Server, one can also enable it to be accessed from the internet. The official Plex app is available for iOS, Android and Smart TV devices. This means that all the movies, TV shows and songs in the Plex App can be accessed on the go wherever you are. The Plex server and apps are all free to download and use. Plex server can be downloaded and installed from here. The Plex mobile apps will be available int he respective app stores.
Plex App in iPhone connected to the Raspberry Pi |
|
You can buy wireless external hard drives that come with the same features (Samba, Plex etc.) as above. These drives normally come bundled with the Plex media/DLNA server and cost anywhere from INR Rs 16000 upwards in the online shopping sites such as Amazon (India). It cost me about INR Rs 6000 to create the same using the Pi.
So, not only do you get to save some money but also have fun in the process! More coming up in the next post.
So, not only do you get to save some money but also have fun in the process! More coming up in the next post.
Comments
Post a Comment