Igniting innovation with microcomputing, 1Crore Projects in Chennai specializes in Raspberry Pi-based projects that bring ideas to life. Our expert team provides hands-on guidance in developing projects for IoT, robotics, home automation, and more, using the versatile Raspberry Pi platform. We help you turn your concepts into functional prototypes, ensuring practical and scalable solutions. With a focus on real-world applications, we offer tailored support to enhance your learning and problem-solving skills. Our center is equipped with cutting-edge resources to bring out the best in your Raspberry Pi projects. Choose 1Crore Projects in Chennai for expert assistance and innovative Raspberry Pi solutions.
About The Project In this project, we’ll learn about the home automation process with the Raspberry Pi Pico. Now-a-days, demand for automation has increased exponentially as most people want a comfortable life. With the current growth in the electronics industry with its creative design and powerful programming...
Getting Started with a Home Automation System
To develop an advanced home automation system, we need to have the following things...
Using PI 4 GPIO signals to control a 74LS00 NAND Gate
Raspberry PI project Simple little project showing how NAND gate integrated circuit works. The circuit is built on a breadboard which will be connected to a Raspberry PI 4 using GPIO signals. The code to control the circuit is written in python.
Since getting besotted with the Raspbbery Pi 2, I took up to putting it to productive uses. Here is the first one. I don’t intend this post to be the definitive tutorial on making an always-on torrent box, as a quick search on Google will allow you to take various approaches. Which brings me to the purpose of this post - I’m sharing my approach here and hopefully some of you find it useful.
Why a Raspberry Pi torrent box?
It will soon become evident that creating a torrent box out of your Raspberry Pi is not something for the uninitiated. But, if one persists the benefits are quite noticeable. The humble Pi is an extremely low power computer that can run all day and all night without creating a dent on your power bills. For instance, a Pi will consume around 2 watts of power playing 1080p HD video while a Mac Mini will consume around 10 watts when idle. Secondly, a Raspberry Pi is inexpensive and can be deployed for multiple purposes by simply swapping microSD cards, making it extremely versatile. Third, at least to me, there is a certain satisfaction to making something myself learning along the way.
Transforming the Pi into a always-on torrent box
If you have a fresh out-of-the-oven Raspberry Pi on your hands, read about how I got started before moving forward. If you already have Raspbian OS running and are comfortable with it, let us get cracking.
Run the following commands to check for and install any updates to Rasbian
sudo apt-get update sudo apt-get upgrade
Installing Samba
Before installing a torrent client, it's best we install support for Samba. Samba enables sharing the downloaded files with other computers within your home network or even to download directly to a network location.
To install Samba, execute the following code in the terminal window
sudo apt-get install samba samba-common-bin
Once it is successfully downloaded and installed, execute the following command to stop the service, and edit the configuration file to setup the folders that will show up on other computers and to control access
sudo service samba stop sudo nano /etc/samba/smb.conf
Scroll down to the bottom of the file and type in the following code to share a folder as public
[Public] comment = Public Files path = /home/pi/Public Share read only = No browseable = Yes writeable = Yes only guest = No create mask = 0777 directory mask = 0777 public = Yes
...and the following code to share a folder as a private folder
[Private] comment = Private Files path = /home/pi/Private Share read only = No browseable = Yes writeable = Yes only guest = No create mask = 0777 directory mask = 0777 public = No
The text within the square brackets [ ] is the name the directory under path will show as to other machines accessing the Pi. The paths I've mentioned are what I have configured. You may create or name folders as per your requirements and modify the path alone in the configuration above. Note that Samba users are NOT the same as the Raspberry Pi login users, which means explicit access to Samba is to provided for the users. To provide access to user pi, execute the following code
sudo smbpasswd -a pi
You will be prompted to enter a password once and confirm it again. This will be the username and password to access folders over the network from other machines. In my case, for the sake of simplicity, I retained the password raspberry. If you are feeling adventurous and want to experiment with other more esoteric features that Samba offers, click this link.
Once you make all the required configuration changes, start the service by executing the following code
sudo service samba start
Now the Raspbbery Pi's must automatically appear in your Windows Explorer or Mac Finder.
In the off case your Raspberry Pi doesn't appear, please check the workgroup configuration of your Windows or Mac and enter the same in the configuration file; stop the service before making changes to the configuration file. Find the lines for workgroup and WINS Support and configure as below
workgroup = WORKGROUP wins support = Yes
WORKGROUP is the default workgroup chosen in Windows, and I have left it at that. You may replace it with the setting in your network. To finalise the configuration changes, restart the service by executing the code below
sudo service samba start
Now you can read and write files from and to your Raspberry Pi.
Installing DLNA
With Samba installed, we can move on to installing DLNA. Similar to Samba, DLNA makes accessing files over the network easy, but since it is a file sharing and access standard supported by smart TVs and smart phones, it makes accessing the downloaded content easier at home without the need for much setup.
To install DLNA, execute the following code in the terminal window
sudo apt-get install minidlna
Once it is successfully downloaded and installed, execute the following command to stop the service, and edit the configuration file to setup authentication and separate folders based on media type to streamline and standardise access across devices
sudo service minidlna stop sudo nano /etc/minidlna.conf
As you scroll down the text file, you'll see a line media_dir for configuring media directories, even based on the types of media it is expected to contain. For a specific type of media prefix the path with M, (for music), P, (for pictures), and V, (for video). The configuration on my system is as below; be sure to verify your path
If you don't want to configure a folder for a specific type of media ignore the prefix and just enter the path.
NOTE: If you have separate folders for movies, TV series and music videos, place them within the folder configured as a media directory for videos. Same goes for the other two categories of media. It is best to place sub-directories and configure the upper-level directory as the designated directory for that type of media.
Other useful parameters are
friendly_name = [name for your device] inotify = Yes
friendly_name gives your Raspberry Pi a custom name. By default it is raspberrypi. inotify, when set to yes, allows miniDLNA to update the media listings in the client device as the shared directories are modified in the Raspberry Pi. To finalise the configuration, the miniDLNA service needs to be restarted with either
sudo service minidlna force-restart
...or
sudo service minidlna start
The difference between the two option is that the first option is required if the path of the shared directories is changed in the configuration file. Else, either will do.
Installing Transmission Daemon
Now your Raspberry Pi is ready for installing one of many torrent clients. Transmission is extremely light on system resources but it is also lightly featured - the only sort of useful customization you can perform is change the order of the queue and set bandwidth limits. For multi files torrents, you don't get the option to control the which files to download and which not. All said and done getting started with Transmission is extremely easy and if you are using your Raspberry Pi as a computer in addition to downloading torrents, then using Transmission might be the least resource hungry way to get your job done.
Run the following commands to check for and install any updates to Rasbian
sudo apt-get update sudo apt-get upgrade
Now, we shall create the folders required for managing downloads. This is the system I follow; you may modify these directories as per your preference.
Change the ownership of the Torrents directory and all subdirectories for all users to read and write using the command below
sudo chmod -R 777 /home/pi/Torrents
With the folders ready, we can install the torrent client. Execute the following code to install the Transmission daemon
sudo apt-get install transmission-daemon
On successful installation, we will custmomize the daemon. But, first we have to stop the daemon. Use the code below below to stop transmission using this command
sudo service transmission-daemon stop
Now we shall open the settings file
sudo nano /etc/transmission-daemon/settings.json
While you can customise all of Transmission's features from here, I will concentrate on a couple of important ones as below. The commands in the settings file are in alphebetical order and I'll follow the same to make it easy for you to follow. If you don't find a line, feel free to add it preferably in alphebetical order to maintain standard.
The comma is required for every line except the last line of the settings file. While the commands may be obvious to some, I'll explain in brief for the benefit of others. The first line sets the directory where the completed downloads will be placed. The second line points to where incomplete downloads will be placed and the fourth line enables transmission to use a separate folder for incomplete downloads. The last two lines point to the watch folder and enables transmission to monitor the watch folder. Any .torrent file in the designated watch folder will automatically be picked up by Transmission and downloaded.
At this point one can begin downloading, but Transmission downloads files as debian-transmission which can create complications when trying to edit or delete downloaded files when logged in as user pi. To make Transmission download as user pi, open the start-up file by executing the following code
sudo nano /etc/init.d/transmission-daemon
Change the USER to pi
USER=pi
Now the ownership of the files have to be assigned to user pi. Enter the following code to perform that
On successfull installation and setup, start the service using
sudo service transmission-daemon start
... and then you can access the Web UI of Transmission to monitor progress by pointing your browser on any remote device on the same network, including your smartphone, to
http://[Raspberry Pi IP]:9091
Start adding your (legal) torrents to the designated watch directory and download away!
All the while I have focussed exclusively on using the onboard microSD card as the only storage to the Raspberry Pi for both downloading and sharing the files. This will become infeasible if you intend to build a large repository of various types of media for home sharing. I'll add another post of how to use USB storage - hard disk or flash drive - and auto-mount it on startup.
If you already have a mounted USB drive, use the mount point for creating the required directories and configure Transmission daemon's settings file to use the external storage.