Raspberry Pi Intercomm System and NAS Server for Home Automation

From ArduinoInfo
Jump to navigation Jump to search

SETTING UP NAS SERVER (MEDIA CENTRE) ON RASPBERRY PI


1. Attach and external drive (such as a flash drive or Hard Disk Drive) to the raspberry pi before booting it up. Afterwards, run the command below to enable NTFS support in order to mount the hard drive which would be attached to the raspberry pi containing the media. Run the following command:
$ sudo apt-get install ntfs-3g
2. Obtain the address of your external hardisk which you attached to the raspberry pi. The address (directory) of the SD Card is /dev/mmcblkop2 and /dev/mmcblkop1. You should be looking for /dev/sda<number>, where "<number>" represents the number of the directory which you want to use (e.g. /dev/sda4). You can determine this by checking the size of that partition. Run the following command:
$ sudo fdisk -l
3. Create a directory to mount the hard disk to. You can call it whatever you choose, but remember the directory you create it at. Run the following command:
$ sudo mkdir /media/NAS_HDD1
4. Create a user with read and write access to the directory. Replace "<name>" with the username you want to use, e.g. $ sudo useradd kufy -m -G users
$ sudo useradd <name> -m -G users
5. Set up a password for the user you created. Replace "<name>" with the user you created:
$ sudo passwd <name>
When you receive a prompt for you password, type your password and then confirm it.
6. To get the uid (user id) of the user you just created, type the following command and take note of the number it returns:
$ id -u <name>
7. To get the gid (group id) where the user you just created belongs, type the following command and take note of the number it returns:
$ id -g <name>
8. Make the drive mount on boot up with proper permissions
$ sudo nano /etc/fstab
Add the following line to the bottom of the script:
/dev/sda1 /media/NAS_HDD1 auto uid=1002,gid=1002,noatime 0 0
Note: The "/dev/sda4" is the address of the external hard disk drive which was mounted unto the raspberry pi. Use the address that corresponds with the drive you want to use as your media center. The uid number is the number obtained from step 6 while the gid number is the number obtained from step 7. Replace these values with your own numbers. After editing this script, save and exit. (ctrl+x, then y, then ENTER)
9. Reboot the Raspberry Pi. Execute the following command:
$ sudo reboot
10. Run this command to install the SAMBA Media Center
$ sudo apt-get install samba samba-common-bin
11. Create a backup for the SAMBA config. file:
$ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.old
12. Edit the config file using nano editor
$ sudo nano /etc/samba/smb.conf

First of all, find and remove the ash before "security = user".
Tip: Press ctrl+W then type in "security = user" to find this line. Ctrl+W is used for search and find in the nano text editor

Add the following lines to the bottom of the smb.conf script:

[pihome]

comment = Pi Home
path = /media/NAS_HDD1
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
read only = no

Save and exit. (ctrl+x, then y, then ENTER)
13. Restart the samba server
$ sudo /etc/init.d/samba restart
14. Add a user and enter password
$ sudo smbpasswd -a <name>

That's it! Now the Media Center has been set up on the raspberry pi. Next, access it from a PC, Mac, or Android phone. Ensure that they are all connected to the same LAN (Local Areal Network). The file server is named RASPBERRYPI by default. If you're using a windows system, it will appear in the windows network work group called WORKGROUP

-----------------------SETTING UP VOIP FOR VOICE COMMUNICATION\
1. $ sudo apt-get install mumble-server

2. $ sudo dpkg-reconfigure mumble-server configure the server by following the prompts and setting a user name and password
3. $ ip addr show to get the current IP address of the raspberry pi. The number next to "inet" is the IP address
4. $ sudo nano /etc/mumble-server.ini to edit the settings to suite you. take note of the port number chosen and it should be > 1024. take note of your server password
5. $ sudo nano /etc/init.d/mumble-server restart to restart the mumble server service
6. Download mumble client software/softphone app for windows, mac, or pc from https://www.mumble.com/. You can also download plumble for android
7. Ensure that the devices to be connected are on the same LAN. With your computer, access the raspberry pi server by typing in the IP address of the raspberry pi followed by the port of the mumble service you set
8. Add A new server which the username is superuser, IP address is that of the pi, and you can pick any name for the label. As the superuser, you can create channels and you have control over everything


9. Log in as "superuser" and create a channel. Use these credentials to invite others to the network

REFERENCE: www.pimylifeup.com