How to stream files from Raspberry Pi to a smartphone

User authentication

Since we've given the ownership of the /mnt/usb/public directory to the transmission user, it'll automatically create any new directories. While the downloaded torrents are public, you can ensure that not everyone can queue torrents for downloads.

Pi connect

One way of doing this is by asking users to authenticate themselves before allowing them access to Transmission. For this, first change the "rpc-authentication-required": false parameter to "rpc-authentication-required": true if necessary and then, define a password in the "rpc-password": "" parameter, which Transmission will automatically encrypt.

Now, save the file and start the Transmission daemon with:

$ sudo service transmission-daemon start

By default, Transmission runs at port 9091. In our example, the complete URL for Transmission's web user interface would be 192.168.3.100:9091. Launch a browser and head to that address.

If you've enabled the password parameter, you'll be asked for login credentials. The username is transmission and the password is the one you specified in the configuration file.

Before you can download a torrent, you need the location of the .torrent file. Go to Transmission's web interface and click the Open Torrent button. Paste the URL in the window that pops up and click Upload to start.

The interface is easy to navigate. By default, it shows all added torrents, but you can use the pull-down menus to view torrents as per their download state or trackers. When you right-click on a listed torrent, it displays a context menu.

Once a torrent has been downloaded, as per our configuration, it'll automatically be moved to the publicly accessible /mnt/usb/public/downloads/complete directory. The easiest way to access a share in Linux is to enter its address in the default file manager. Most modern Linux file managers, such as Gnome's Nautilus, support Samba. Launch Nautilus and press [Ctrl] + [L] to access the address bar.

Now enter smb:// followed by the IP address of the RPi running Samba. In our case, this would besmb://192.168.3.100. To access a particular share, you can also append its name to the end of the address, such as smb://192.168.3.100/documents.

Or you can mount the share from the command line:

# mount -t cifs -o username=pi,password=raspberry //192.168.3.100/usb/downloads/mnt/downloads

To mount this share automatically, you can add it to the /etc/fstab file:

//192.168.3.100/usb/downloads /mnt/downloads cifs username=pi,password=raspberry 0 0

You can map the remote USB device on a Windows box. On a Windows 10 PC open File Explorer and navigate to This PC. Click the Map Network Drive button. In the window that pops up, select a drive letter, and enter the location of the network folder. Here, this would be something like192.168.3.100\usb\videos. You'll be asked for your authentication information, and then the drive will show up in File Explorer.

Accessing shares on an Android device

Search and install

1. Search and install

The Android Play store is full of file managers that can work with Samba shares. We use the popular ES File Explorer File Manager.

Configure

2. Configure

In the app, change View from Local to Network > LAN, and then tap the + button to enter your Pi's IP address and folder share into the Server box, plus your user connection and authentication details.

Browse and stream

3. Browse and stream

Depending on your permissions, you'll be able to download, upload and stream files and access public and private areas on the share.

Mayank Sharma

With almost two decades of writing and reporting on Linux, Mayank Sharma would like everyone to think he’s TechRadar Pro’s expert on the topic. Of course, he’s just as interested in other computing topics, particularly cybersecurity, cloud, containers, and coding.