hydra3333
Posts: 101
Joined: Thu Jan 10, 2013 11:48 pm

Re: How-To: Raspberry Pi media SERVER (easy)

Fri Feb 20, 2015 5:08 am

Nice guide, thanks. I wish I'd seen this before rolling my own.

For completeness - there's a very similar approach used at the link below, which also explains how to use a variant of this Pi media server to serve well-formed MP4s over to your ChromeCast devices connected to your TVs (upon initiation from an android tablet or phone on your LAN).

http://www.raspberrypi.org/forums/viewt ... 76#p694676

Rextob
Posts: 2
Joined: Thu Feb 19, 2015 9:09 am

Re: How-To: Raspberry Pi media SERVER (easy)

Tue Mar 03, 2015 2:20 pm

Hi i am able to stream from my network but but there no audio coming out
help please

thanks

revestroke
Posts: 8
Joined: Wed Mar 18, 2015 4:36 am

Re: How-To: Raspberry Pi media SERVER (easy)

Mon Mar 23, 2015 12:50 pm

Very interesting tutorial. I did it using my RPi_2. However I want to do its vice-versa. I mean I want to send videos in real time to RPi (attached with a HDMI TV screen) at any time instance from my Windows_7 PC through a internet network. I already interfaced OpenElec with Chorus to send videos but then I have to transfer downloaded videos to RPi's SD card using FTP and then can see them using Chorus.
Can I send videos to RPi screen in real time as and when I want, like advertisements appear while playing YouTube videos.

Suggestions and advice are welcome. :)

Robot_1X
Posts: 3
Joined: Sun May 03, 2015 2:10 am

Re: How-To: Raspberry Pi media SERVER (easy)

Mon May 18, 2015 10:37 pm

Hello all, I'm posting this in hopes that someone can help me with a problem I've encountered while following this tutorial. I'm able to access my Pi via SMB, but I cannot access the connected external hard drive. I'm new to Samba, and Linux distros not based on Ubuntu, so I apologize if I make any dumb mistakes or fail to provide any needed information. I'm assuming I need to post the contents of my smb.conf file and I will provide that when I get a chance to access my Pi again (For some reason, I can't access it via SSH anymore. Not sure what happened there.).

Thanks in advance for any help,
Robot_1X

Robot_1X
Posts: 3
Joined: Sun May 03, 2015 2:10 am

Re: How-To: Raspberry Pi media SERVER (easy)

Fri Sep 04, 2015 8:43 pm

Hello,
After four long months of attempting (and failing) to find one of my spare keyboards, being broke and unable to buy another one, and forgetting to get one, I have finally gotten another keyboard for my Pi and managed to get my smb.conf to paste here.

Code: Select all

#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which 
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
#  - When such options are commented with ";", the proposed setting
#    differs from the default Samba behaviour
#  - When commented with "#", the proposed setting is the default
#    behaviour of Samba but the option is considered important
#    enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic 
# errors. 
# A well-established practice is to name the original file
# "smb.conf.master" and create the "real" config file with
# testparm -s smb.conf.master >smb.conf
# This minimizes the size of the really used smb.conf file
# which, according to the Samba Team, impacts performance
# However, use this with caution if your smb.conf file contains nested
# "include" statements. See Debian bug #483187 for a case
# where using a master file is not a good idea.
#

#======================= Global Settings =======================

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
   server string = %h server

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
#   wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
;   wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
   dns proxy = no

# What naming service and in what order should we use to resolve host names
# to IP addresses
;   name resolve order = lmhosts host wins bcast

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
;   interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself.  However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
;   bind interfaces only = yes



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
   max log size = 1000

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
#   syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
   syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
   panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
#   security = user

# You may wish to use password encryption.  See the section on
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.
   encrypt passwords = true

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.  
   passdb backend = tdbsam

   obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
   unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
   pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
   map to guest = bad user

########## Domains ###########

# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the 'domain master' setting to no
#
;   domain logons = yes
#
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of the user's profile directory
# from the client point of view)
# The following required a [profiles] share to be setup on the
# samba server (see below)
;   logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
#   logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
;   logon drive = H:
#   logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
;   logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe.  The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

# This allows machine accounts to be created on the domain controller via the 
# SAMR RPC pipe.  
# The following assumes a "machines" group exists on the system
; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.  
; add group script = /usr/sbin/addgroup --force-badname %g

########## Printing ##########

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
#   load printers = yes

# lpr(ng) printing. You may wish to override the location of the
# printcap file
;   printing = bsd
;   printcap name = /etc/printcap

# CUPS printing.  See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
;   printing = cups
;   printcap name = cups

############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
;   include = /home/samba/etc/smb.conf.%m

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
# for details
# You may want to add the following on a Linux system:
#         SO_RCVBUF=8192 SO_SNDBUF=8192
#   socket options = TCP_NODELAY

# The following parameter is useful only if you have the linpopup package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and samba.
;   message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

# Domain Master specifies Samba to be the Domain Master Browser. If this
# machine will be configured as a BDC (a secondary logon server), you
# must set this to 'no'; otherwise, the default behavior is recommended.
#   domain master = auto

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
;   idmap uid = 10000-20000
;   idmap gid = 10000-20000
;   template shell = /bin/bash

# The following was the default behaviour in sarge,
# but samba upstream reverted the default because it might induce
# performance issues in large organizations.
# See Debian bug #368251 for some of the consequences of *not*
# having this setting and smb.conf(5) for details.
;   winbind enum groups = yes
;   winbind enum users = yes

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 (default) means that usershare is disabled.
;   usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
   usershare allow guests = yes

#======================= Share Definitions =======================

[homes]
   comment = Home Directories
   browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
   read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
   create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
   directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# The following parameter makes sure that only "username" can connect
# to \\server\username
# This might need tweaking when using external authentication schemes
   valid users = %S

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   guest ok = yes
;   read only = yes

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin

# A sample share for sharing your CD-ROM with others.
;[cdrom]
;   comment = Samba server's CD-ROM
;   read only = yes
;   locking = no
;   path = /cdrom
;   guest ok = yes

# The next two parameters show how to auto-mount a CD-ROM when the
#	cdrom share is accesed. For this to work /etc/fstab must contain
#	an entry like this:
#
#       /dev/scd0   /cdrom  iso9660 defaults,noauto,ro,user   0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#
# If you don't want to use auto-mounting/unmounting make sure the CD
#	is mounted on /cdrom
#
;   preexec = /bin/mount /cdrom
;   postexec = /bin/umount /cdrom

[media]
comment = Media share
path = /media/USBHDD1
valid users = @users
force group = users
create mask = 0660
director mask = 0771
read only = no

user = pi
public = no
writeable = no
readable = yes
path = /home
I'd appreciate it if someone here is able to tell me where I went wrong from this file.

Thanks for any help,
~Robot_1X

User avatar
DougieLawson
Posts: 30450
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: How-To: Raspberry Pi media SERVER (easy)

Sat Sep 05, 2015 7:48 am

Try running
testparm /etc/samba/smb.conf

That should show your errors.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

Robot_1X
Posts: 3
Joined: Sun May 03, 2015 2:10 am

Re: How-To: Raspberry Pi media SERVER (easy)

Wed Oct 21, 2015 6:37 am

DougieLawson wrote:Try running
testparm /etc/samba/smb.conf

That should show your errors.
Thanks for the help. I was able to correct my errors, but was unable to fix my problem, so I decided to wipe the SD card and start from scratch. After completing the tutorial on a fresh Raspbian installation, I was able to stream media from my Pi perfectly. So thanks to jelleke60 for making this tutorial. :D

wusupchuck
Posts: 1
Joined: Thu Jan 14, 2016 8:03 pm

Re: How-To: Raspberry Pi media SERVER (easy)

Thu Jan 14, 2016 8:09 pm

For people not really familiar with Linux like me, could you modify the following lines so they start with "sudo"?

cp /etc/samba/smb.conf /etc/samba/smb.conf.bak //Make a backup of the config file
nano /etc/samba/smb.conf

Thanks!

keptsecret
Posts: 1
Joined: Tue May 31, 2016 2:03 pm

Re: How-To: Raspberry Pi media SERVER (easy)

Tue May 31, 2016 2:05 pm

And is there a way to add more media content to the server after it's been set up?

coloop
Posts: 7
Joined: Tue Jun 07, 2016 10:55 am
Location: iran
Contact: Website

Re: How-To: Raspberry Pi media SERVER (easy)

Tue Jun 07, 2016 10:58 am

Hi
Is there any limitation for the number of clients connected to PI server ?!

sorry for my bad english ! :|

ChriseyJ
Posts: 1
Joined: Thu Jun 09, 2016 11:14 pm

Re: How-To: Raspberry Pi media SERVER (easy)

Thu Jun 09, 2016 11:16 pm

Hey, I unfortunately got a problem,

if I want to acces my files with kido I can choose RASPBERRYPI and I can also click on media. But if I type in the username and the password I'm still unable to open the folder media. Instead another folder called after my username pops up but there's nothing in there.
When I tried accessing my files with another Player it told me that it wouldn't have the permission to get the files after I typed in Username and Password. It tells me that the User I typed in has no rights to acces the folder media.
Can anybody help?

Chris

Gary72
Posts: 1
Joined: Tue Sep 20, 2016 8:02 am

Re: How-To: Raspberry Pi media SERVER (easy)

Tue Sep 20, 2016 8:07 am

Hi all,

very new to Pi and have followed the instructions but appear to have permissions issues.

During the setup I couldn't make changes to the smb-conf file without starting the command with sudo.

Also now I have completed the setup I cant access the media file displayed, I receive the message access denied.

I am using the user name and password I have setup.

Can anyone help?

ejolson
Posts: 1053
Joined: Tue Mar 18, 2014 11:47 am

Re: How-To: Raspberry Pi media SERVER (easy)

Fri Sep 23, 2016 5:36 am

Gary72 wrote: During the setup I couldn't make changes to the smb-conf file without starting the command with sudo.
In to creating the samba user and password did you enable the user? After doing "smbpasswd -a username" to add the user you also need "smbpasswd -e username" to enable the user. You can check things with smbclient on the Pi. If smbclient works on the Pi but not remote, you may need to specify the workgroup to connect.

enotar
Posts: 3
Joined: Sun Jan 01, 2017 8:11 pm

Re: How-To: Raspberry Pi media SERVER (easy)

Sun Jan 01, 2017 8:33 pm

Maybe someone can still help me; I got all working but remote server, it is a little hard to setup I have HG8345 router and checking my IP with the Pi it is manual so it should be static. Is it enough to make it work:



I am not sure I did forward port as needed, I understand I should use range 64000-64040 but if I understand it is port 80 from my ip address forwarded to this range. In the forward screen I dont have FTP but TCP/udp
Any help or link how to do it?
Thank you

Forestry
Posts: 2
Joined: Thu Jan 12, 2017 6:50 pm
Location: Toronto
Contact: Website

Re: How-To: Raspberry Pi media SERVER (easy)

Thu Jan 12, 2017 7:00 pm

Can anyone share guide how to make home proxy server with Raspberry Pi ?

Cirelli94
Posts: 4
Joined: Wed May 18, 2016 11:00 am

Re: How-To: Raspberry Pi media SERVER (easy)

Mon Jan 23, 2017 9:46 pm

I'm using my Raspberry Pi 1 mod. B to stream film ~2GB, but it so laggy it become useless!
I tried both sftp and ftp!
I tried even copying the film on the sd card. No way.
I checked with iperf3 and this is the results:
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 208 KBytes 1.70 Mbits/sec 1 32.5 KBytes
[ 4] 1.00-2.00 sec 124 KBytes 1.02 Mbits/sec 1 25.5 KBytes
[ 4] 2.00-3.00 sec 56.6 KBytes 463 Kbits/sec 0 29.7 KBytes
[ 4] 3.00-4.00 sec 60.8 KBytes 498 Kbits/sec 0 31.1 KBytes
[ 4] 4.00-5.00 sec 93.3 KBytes 765 Kbits/sec 0 31.1 KBytes
[ 4] 5.00-6.00 sec 89.1 KBytes 730 Kbits/sec 0 32.5 KBytes
[ 4] 6.00-7.00 sec 97.6 KBytes 799 Kbits/sec 1 12.7 KBytes
[ 4] 7.00-8.00 sec 134 KBytes 1.10 Mbits/sec 0 35.4 KBytes
[ 4] 8.00-9.00 sec 74.9 KBytes 614 Kbits/sec 1 28.3 KBytes
[ 4] 9.00-10.00 sec 74.9 KBytes 614 Kbits/sec 0 29.7 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-10.00 sec 1014 KBytes 831 Kbits/sec 4 sender
[ 4] 0.00-10.00 sec 966 KBytes 791 Kbits/sec receiver

Someone is doing this successfuly?
What's your bandwidth?

Cirelli94
Posts: 4
Joined: Wed May 18, 2016 11:00 am

Re: How-To: Raspberry Pi media SERVER (easy)

Mon Jan 23, 2017 9:48 pm

Forestry wrote:Can anyone share guide how to make home proxy server with Raspberry Pi ?
Try to google it or make a post. You're going OT.

Cirelli94
Posts: 4
Joined: Wed May 18, 2016 11:00 am

Re: How-To: Raspberry Pi media SERVER (easy)

Mon Jan 23, 2017 9:49 pm

enotar wrote:Maybe someone can still help me; I got all working but remote server, it is a little hard to setup I have HG8345 router and checking my IP with the Pi it is manual so it should be static. Is it enough to make it work:

I am not sure I did forward port as needed, I understand I should use range 64000-64040 but if I understand it is port 80 from my ip address forwarded to this range. In the forward screen I dont have FTP but TCP/udp
Any help or link how to do it?
Thank you
What platform are you using? Windows? Linux?
Try to check your LAN if the raspberry pi is already visible.
For linux:

Code: Select all

sudo nmap -sS 192.168.0.1/24

enotar
Posts: 3
Joined: Sun Jan 01, 2017 8:11 pm

Re: How-To: Raspberry Pi media SERVER (easy)

Sun Feb 12, 2017 4:05 am

I think I got static address but can someone help me here:

"important! Now go into your Router settings and forward port 64000 to 64040, to the local IP of your raspberry. Make sure everything has a static address, if you don't know how to do it then lookup another tutorial, there are plenty."
plenty yes but dont explain very well and I am a little lost, I have a router Huawei HG8245 and what port I have to forward to what port? Internal external start end etc.... this is complex. Do I have to forward only port 64000 to 64040 or 80 to 64000? Do I use custom or application, which one? Another question why /24?
I post the router screen
New Bitmap Image.gif
New Bitmap Image.gif (31.52 KiB) Viewed 2350 times
I appreciate the help and sorry to bother.
Thank you

enotar
Posts: 3
Joined: Sun Jan 01, 2017 8:11 pm

Re: How-To: Raspberry Pi media SERVER (easy)

Sun Feb 19, 2017 2:40 pm

AS I discover is this guide is not for 99% of us as we have a dynamic IP and there is no way around that so remote is not possible!
Too bad

Moose187
Posts: 1
Joined: Tue Sep 19, 2017 6:35 pm

Re: How-To: Raspberry Pi media SERVER (easy)

Tue Sep 19, 2017 6:43 pm

I'm trying to make a Wi-Fi free server, I want to use this setup with hostapd and a custom static ip. I also have setup as a wireless hotspot so you can find and link to it but I cant get the server to allow access to the media. I also have minidlna setup on there as well.

Return to “Teaching and learning resources”

Who is online

Users browsing this forum: No registered users and 2 guests