Manual installation can be carried after installing the operating system and establishing Internet connection.
Update the software repository for the operating system and upgrade all installed packages into their latest version.
Software-level Instruction
* sudo apt-get update && sudo apt-get upgrade
Command-level Instruction
* yes | sudo DEBIAN_FRONTEND=noninteractive apt-get -yq update && yes | sudo DEBIAN_FRONTEND=noninteractive apt-get -yq upgrade
Raspbian Jessie default screen saver is ten minutes and then goes to soft shut-down within the next 30 minutes. Pedge, need to have the operating system to be always available unless the user turned it off. Hence, general energy saving features should not active.
/etc/xdg/lxsession/LXDE-pi/autostart
and Add These Lines@xset -dpms
@xset s noblank
@xset s off
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
sudo /bin/sh -c 'printf "\n@xset s noblank\n@xset s off\n@xset -dpms" >> /etc/xdg/lxsession/LXDE-pi/autostart'
/etc/xdg/lxsession/LXDE-pi/autostart
and Add These Lines@xset -dpms
@xset s noblank
@xset s off
sudo nano /etc/xdg/lxsession/LXDE/autostart
sudo /bin/sh -c 'printf "\n@xset s noblank\n@xset s off\n@xset -dpms" >> /etc/xdg/lxsession/LXDE/autostart'
/home/pi/.bashrc
and Add setterm -blank 0 -powerdown 0
sudo nano /home/pi/.bashrc
setterm -blank 0 -powerdown 0
.sudo /bin/sh -c 'printf "\nsetterm -blank 0 -powerdown 0" >> /home/pi/.bashrc'
/etc/lightdm/lightdm.conf
and Replace #xserver-command=X
with xserver-command=X -s 0 -dpms
sudo nano /etc/lightdm/lightdm.conf
#xserver-command=X
with xserver-command=X -s 0 -dpms
.sudo sed -ie "s/#xserver-command=X/xserver-command=X -s 0 -dpms/g" /etc/lightdm/lightdm.conf
/etc/kbd/config
and Replace BLANK_TIME=30
with BLANK_TIME=0
sudo nano /etc/kbd/config
BLANK_TIME=30
with BLANK_TIME=0
.sudo sed -ie "s/BLANK_TIME=30/BLANK_TIME=0/g" /etc/kbd/config
/etc/kbd/config
and Replace POWERDOWN_TIME=30
with POWERDOWN_TIME=0
sudo nano /etc/kbd/config
POWERDOWN_TIME=30
with POWERDOWN_TIME=0
.sudo sed -ie "s/POWERDOWN_TIME=30/POWERDOWN_TIME=0/g" /etc/kbd/config
LIRC is a library for Linux to interface general infrared devices. Although mostly related to TV infrared remote, LIRC can be used to assign infrared signals to running program. However, the infrared signals need to be assigned into constants those refer to TV infrared remote. In this setup I set to assign three infrared signals into constants (KEY_1
, KEY_2
, KEY_3
).
/etc/modules
and Add These Lineslirc_dev
lirc_rpi gpio_in_pin=23 gpio_out_pin=22
sudo nano /etc/modules
sudo /bin/sh -c 'printf "\n\nlirc_dev\nlirc_rpi gpio_in_pin=23 gpio_out_pin=22" >> /etc/modules'
/etc/lirc/hardware.conf
, Create/etc/lirc/hardware.conf
, and Add These Lines########################################################
# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS=\"--uinput\"
# Do not start lircmd even if there seems to be a good config file
# START_LIRCMD=false
# Do not start irexec, even if a good config file seems to exist.
# START_IREXEC=false
# Try to load appropriate kernel modules
LOAD_MODULES=true
# Run \"lircd --driver=help\" for a list of supported drivers.
DRIVER=\"default\"
# usually /dev/lirc0 is the correct setting for systems using udev
DEVICE=\"/dev/lirc0\"
MODULES=\"lirc_rpi\"
# Default configuration files for your hardware if any
LIRCD_CONF=\"\"
LIRCMD_CONF=\"\"
########################################################
sudo rm /etc/lirc/hardware.conf
sudo nano /etc/lirc/hardware.conf
sudo /bin/sh -c 'printf "\n########################################################\n# /etc/lirc/hardware.conf\n#\n# Arguments which will be used when launching lircd\nLIRCD_ARGS=\"--uinput\"\n\n# Do not start lircmd even if there seems to be a good config file\n# START_LIRCMD=false\n\n# Do not start irexec, even if a good config file seems to exist.\n# START_IREXEC=false\n\n# Try to load appropriate kernel modules\nLOAD_MODULES=true\n\n# Run \"lircd --driver=help\" for a list of supported drivers.\nDRIVER=\"default\"\n# usually /dev/lirc0 is the correct setting for systems using udev\nDEVICE=\"/dev/lirc0\"\nMODULES=\"lirc_rpi\"\n\n# Default configuration files for your hardware if any\nLIRCD_CONF=\"\"\nLIRCMD_CONF=\"\"\n########################################################" > /etc/lirc/hardware.conf'
/boot/config.txt
and Add dtoverlay=lirc-rpi,gpio_in_pin=23,gpio_out_pin=22
sudo nano /boot/config.txt
dtoverlay=lirc-rpi,gpio_in_pin=23,gpio_out_pin=22
.sudo /bin/sh -c 'printf "\ndtoverlay=lirc-rpi,gpio_in_pin=23,gpio_out_pin=22" >> /boot/config.txt'
/etc/lirc/lircd.conf
, Create /etc/lirc/lircd.conf
, and Add These Lines# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.9.0-pre1(default) on Sat Jan 7 22:45:56 2017
#
# contributed by
#
# brand: /home/pi/lircd.conf
# model no. of remote control:
# devices being controlled by this remote:
#
begin remote
name pysoc
bits 13
flags RC5|CONST_LENGTH
eps 30
aeps 100
one 924 840
zero 924 840
plead 970
gap 113287
toggle_bit_mask 0x0
begin codes
KEY_1 0x1001
KEY_2 0x1002
KEY_3 0x1003
end codes
end remote
sudo nano /boot/config.txt
sudo /bin/sh -c 'printf "# Please make this file available to others\n# by sending it to <lirc@bartelmus.de>\n#\n# this config file was automatically generated\n# using lirc-0.9.0-pre1(default) on Sat Jan 7 22:45:56 2017\n#\n# contributed by \n#\n# brand: /home/pi/lircd.conf\n# model no. of remote control: \n# devices being controlled by this remote:\n#\nbegin remote\n name pysoc\n bits 13\n flags RC5|CONST_LENGTH\n eps 30\n aeps 100\n one 924 840\n zero 924 840\n plead 970\n gap 113287\n toggle_bit_mask 0x0\n begin codes\n KEY_1 0x1001\n KEY_2 0x1002\n KEY_3 0x1003\n end codes\nend remote" > /etc/lirc/lircd.conf'
/home/pi/.lircrc
, Create /home/pi/.lircrc
, and Add These Linesbegin
button = KEY_1
config = KEY_1
prog = pysoc
end
begin
button = KEY_2
config = KEY_2
prog = pysoc
end
begin
button = KEY_3
config = KEY_3
prog = pysoc
end
rm /home/pi/.lircrc
nano /home/pi/.lircrc
sudo /bin/sh -c 'printf "\nbegin\n button = KEY_1\n config = KEY_1\n prog = pysoc\nend\nbegin\n button = KEY_2\n config = KEY_2\n prog = pysoc\nend\nbegin\n button = KEY_3\n config = KEY_3\n prog = pysoc\nend" > /home/pi/.lircrc'
/etc/lirc/lircrc
, Create /etc/lirc/lircrc
, and Add These Linesbegin
button = KEY_1
config = KEY_1
prog = pysoc
end
begin
button = KEY_2
config = KEY_2
prog = pysoc
end
begin
button = KEY_3
config = KEY_3
prog = pysoc
end
sudo rm /etc/lirc/lircrc
sudo nano /etc/lirc/lircrc
sudo /bin/sh -c 'printf "\nbegin\n button = KEY_1\n config = KEY_1\n prog = pysoc\nend\nbegin\n button = KEY_2\n config = KEY_2\n prog = pysoc\nend\nbegin\n button = KEY_3\n config = KEY_3\n prog = pysoc\nend" > /etc/lirc/lircrc'
sudo /etc/init.d/lirc stop
sudo /etc/init.d/lirc start
sudo /etc/init.d/lirc stop && sudo /etc/init.d/lirc start
Raspberry PI has two ways to connect camera: USB web cam and PICamera. USB web cam is the usual USB web cam you can find in general consumer electronics store. PICamera is a ribbon cabled camera that is low powered and smaller than common USB web cam. However, despite PICamera has its driver pre-installed in Raspbian Jessie, it different setup route than USB web cam.
/boot/config.txt
and Add gpu_mem=128
sudo nano /boot/config.txt
.gpu_mem=128
.sudo /bin/sh -c 'printf "\ngpu_mem=128" >> /boot/config.txt'
/boot/config.txt
and Replace start_x=0
with start_x=1
sudo nano /boot/config.txt
.start_x=0
with start_x=1
.sudo sed -ie "s/start_x=0/start_x=1/g" /boot/config.txt
PyAudio is a high level library to interface sound input and output. PyAudio works across common desktop operating system, Linux, MacOS, and Windows. However, there is a problem in one of its dependency, PortAudio. Hence, to solve this issue, you need to recompile the stable version of PortAudio.
wget
to home/pi
wget http://www.portaudio.com/archives/pa_stable_v19_20140130.tgz
wget http://www.portaudio.com/archives/pa_stable_v19_20140130.tgz -P /home/pi
tar
to home/pi
tar xf /home/pi/pa_stable_v19_20140130.tgz -C
tar xf /home/pi/pa_stable_v19_20140130.tgz -C /home/pi
cd /home/pi/portaudio
./configure
make
sudo make install
cd /home/pi
cd /home/pi/portaudio
./configure
make
sudo make install
cd /home/pi
cd /home/pi/portaudio && ./configure && make && sudo make install && cd /home/pi
/home/pi/.bashrc
and Add These LinesLD_LIBRARY_PATH=\"/usr/local/lib\"
LD_RUN_PATH=\"/usr/local/lib\"
PATH=$PATH:/usr/local/lib/
export LD_LIBRARY_PATH
export LD_RUN_PATHexport PATH
sudo nano /home/pi/.bashrc
sudo /bin/sh -c 'printf "\nLD_LIBRARY_PATH=\"/usr/local/lib\"\nexport LD_LIBRARY_PATH\nLD_RUN_PATH=\"/usr/local/lib\"\nexport LD_RUN_PATH\nPATH=$PATH:/usr/local/lib/\nexport PATH" >> /home/pi/.bashrc'
/etc/asound.conf
, Create /etc/asound.conf
, and Add These Linespcm.!default{
type hw card 1
}
ctl.!default{
type hw card 1
}
sudo rm /etc/asound.conf
sudo nano /etc/asound.conf
sudo /bin/sh -c 'printf "\npcm.!default{\n type hw card 1\n}\nctl.!default{\n type hw card 1\n}" > /etc/asound.conf'
/home/pi/.asoundrc
, Create /home/pi/.asoundrc
, and Add These Linespcm.!default{
type hw card 1
}
ctl.!default{
type hw card 1
}
rm /home/pi/.asoundrc
nano /home/pi/.asoundrc
sudo /bin/sh -c 'printf "\npcm.!default{\n type hw card 1\n}\nctl.!default{\n type hw card 1\n}" > /home/pi/.asoundrc'
/usr/share/alsa/alsa.conf
and Replace defaults.ctl.card 0
with defaults.ctl.card 1
sudo nano /usr/share/alsa/alsa.conf
defaults.ctl.card 0
with defaults.ctl.card 1
.sudo sed -ie "s/defaults.ctl.card 0/defaults.ctl.card 1/g" /usr/share/alsa/alsa.conf
/usr/share/alsa/alsa.conf
and Replace defaults.pcm.card 0
with defaults.pcm.card 1
sudo nano /usr/share/alsa/alsa.conf
defaults.pcm.card 0
with defaults.pcm.card 1
.sudo sed -ie "s/defaults.pcm.card 0/defaults.pcm.card 1/g" /usr/share/alsa/alsa.conf
/usr/share/alsa/alsa.conf
and Replace defaults.pcm.device 0
with defaults.pcm.device 1
sudo nano /usr/share/alsa/alsa.conf
defaults.pcm.device 0
with defaults.pcm.device 1
.sudo sed -ie "s/defaults.pcm.device 0/defaults.pcm.device 1/g" /usr/share/alsa/alsa.conf
/usr/share/alsa/alsa.conf
and Replace defaults.pcm.subdevice 0
with defaults.pcm.subdevice 1
sudo nano /usr/share/alsa/alsa.conf
defaults.pcm.subdevice 0
with defaults.pcm.subdevice 1
.sudo sed -ie "s/defaults.pcm.subdevice 0/defaults.pcm.subdevice -1/g" /usr/share/alsa/alsa.conf
/home/pi
git clone https://github.com/notalentgeek/pedge
cd /home/pi && git clone https://github.com/notalentgeek/pedge --depth 1
pip3
sudo pip3 install aubio
sudo pip3 install docopt
sudo pip3 install flask
sudo pip3 install flask-socketio
sudo pip3 install numpy
sudo pip3 install pyaudio
sudo pip3 install pyinstaller
sudo pip3 install python-lirc
sudo pip3 install rethinkdb
sudo pip3 install tzlocal
sudo pip3 install virtualenv
sudo pip3 install -r /home/pi/pedge/req/req_raspbian_jessie.txt
txt`