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.

  1. You can SSH into the Pi and run the following commands to install Samba
    1. sudo apt-get update
    2. sudo apt-get upgrade
    3. sudo apt-get install samba samba-common-bin
  2. You could give all access to the Public folder under /home/pi/ folder using the command - chmod +777.
  3. Create a Samba user and password using the command - sudo smbpasswd -a pi
  4. Configure Samba as shown below -
    1. Edit the Samba configuration - sudo vi /etc/samba/smb.conf
    2. [share]
    3. Comment = Pi shared folder
    4. Path = /home/pi/Public
    5. Browseable = yes
    6. Writeable = Yes
    7. only guest = no
    8. create mask = 0777
    9. directory mask = 0777
    10. Public = yes
    11. Guest ok = yes
  5. 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.

  1. Install Mini DLNA server using the command - sudo apt-get install minidlna.
  2. Edit the DLNA configuration - sudo nano /etc/minidlna.conf.
  3. media_dir=A,/home/pi/Public/Music
  4. media_dir=V,/home/pi/Public/Movies
  5. friendly_name=Pi-Media-Server
  6. sudo service minidlna restart
  7. 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

Plex App in iPad 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.


Popular posts from this blog

Cloudera Quick Start VM in Hyper-V

Book Review - The Price of Being Fair

Meta Prompting for Success