3 Streaming mediaserver:DLNA realize the use of computer or mobile phone playing the mediafiles that were placed in the sharingdirectory.

The steps are as follows.

1 Preparation work

1.1 Write the OS image fileRaspbian for LeMaker Guitar

1.2The preparation of hardware

(1)Use the power supply to supply power for the hard drive

(2)Connect the hard drive to the USB on theLeMaker Guitar by conversion line

(3)Plug in an RJ-45 Ethernet

(4)Plugging in the mains adapter power on the LeMaker Guitar.

1.3 Formatthe hard driveto create a new partition and mount the root directory to thehard drive

(1)Format the hard drive to create a newpartition

Run the sudo fdisk /dev/sda command. Use the o command todelete all partition of hard drive and use the n commandto add one new partition. Use the w command to savechange.

Run the sudo mkfs.ext4 /dev/sda1 command to format the new created partition ofhard drive as ext4.

(2) Mount the root directory to your hard drive

When we mount the root directory to the hard drive, the file system will start in the hard drive. This setting is a good way to protect LeMakerGuitar, when we need a long time to use the system .Specific methods are as follows

Create a temporary directory inthe root directory

mkdir temp

sudo fdisk –l

Copy the Code

Mount the /dev/mmcblk0p2 to the temp directory

sudo mount /dev/mmcblk0p2 /temp

Copy the Code

Copy the file system to the hard drive partition

sudo mount /dev/sda1 /mnt

cp –aP/temp /mnt

Copy the Code

Edit the /media/misc/uEnv.txt,

sudo nano uEnv.txt

Copy the Code

Change the contentroot=/dev/mmcblk0p2 as follow

root=/dev/sda1

Copy the Code

1.4 Close the GUI

sudonano /etc/X11/default-display-manager

Copy the Code

Add false in the file

Reboot the systemthen graphical interface is no longer present.Automatically runin the CUI mode when the system reboot. The machine does not need to usethe GUI.Thegraphical interfacefor the LeMaker Guitar was closed to save computational resources.

2Createa file server

Use the file server can achieve LAN file sharing. Through this function we can upload files to the shared directory or download files from the shared directory.Here we use the samba software to realize our LANsharing.

2.1Setup static IP

Edit/etc/network/interfaces

sudo nano /etc/network/interfaces

Copy the Code

Change the iface eth0 inet dhcp as follow

iface eth0 inet static

Copy the Code

Add the content as follow

address 192.168.1.15

netmask 255.255.255.0

gateway 192.168.1.1

Copy the Code

Andthen delete iface default inet dhcp

Here thestatic IP is set to 192.168.1.15. Restart the network or reboot the system to finish it.

sudo /etc/init.d/networking restart

Copy the Code

2.2 Installation of samba services

sudo apt-get update

sudo apt-get install samba

sudo apt-get installsamba-common-bin

Copy the Code

2.3Add user and create the download directory

sudouseradd maker

Copy the Code

To set a password for the new user, this is set to 123

sudo passwd maker

sudo mkdir/aria2download/download

sudo chown –R maker/aria2download/download

Copy the Code

2.4Editthe samba configuration file

sudo nano /etc/samba/smb.conf

Copy the Code

To find out the security = user and delete the symbol#in front of the sentence.

Add the content at the end of the file.

[aria2share]

comment=my family’s share

path=/aria2download/download

valid users=maker

public=no

writable=yes

browseable=yes

create mask=0777

directory mask=0777

Copy the Code

Aria2share is the sharing file's name that we can see on the computer

2.5Add Samba user

Here we set Samba password is 123

sudo smbpasswd -a maker

sudo service samba restart

Copy the Code

So far we have establishedthe file server based on samba.Type the Winkey+R and input our IP address of the server.Then we will see our sharing file on the computer.On the mobilephone use software ES file explorer to view the sharing file. In mynetwork page of the ES file explorer click the newoption and input thepath of our sharing file likeIP/sharing filenametheninput username with password. Here I input 192.168.1.15/aria2share. User name is makerand password is 321.We can manage our shared file in our phone now.

Lastfind out the default minidlna database and log files then delete it to avoidconfusion

rm–r /var/lib/minidlna

rm–r /var/log

Copy the Code

4.3 Restart minidna

sudo/etc/init.d/minidlna restart

Copy the Code

To seewhether aria2 is running

/etc/init.d/minidlnastatus

Copy the Code

Wehave successfully established a streaming media server.But we need toturn off the firewall or allow the Windows Media Player through the firewallbefore we use it. Now we can see the sharing streaming media files by theWindows Media Playerin the LAN.

Wealso can see it on our mobile phone via the streaming media player software.Here I use moliplayer.

NAShome server finally completed! We can put the server on a corner of homeworking for us, now.