Menu

Description Server Box Temperature sensors SD Card install Network connection FCALLBOX Software install Remote control install Web Radio config MP3 Player config Digital photos frame config weather forecast config Stock exchange config Phone configuration Temperature sensor Config MAIN configuration User guide Historic and news Home

FCALLBOX3 Server System 

    FCALLBOX Software installation    

Below the method to connect and to transfert files to the FCALLBOX Server, this method will be the same to apply to load new applications.



   CONNECT TO THE BOX   
   

Connect to the FCALLBOX Server in SSH with a tool like PuTTY :





Log on the box with the login and password defined during the SD card installation :





Update the firmware .. by typing :


   sudo rpi-update
   sudo reboot
   sudo apt-get update                
   sudo apt-get upgrade
   sudo reboot



   INSTALLATION   
   

- I have written a python installation program which creates the directories, install the softwares, load Fcallbox files ...

- It is named fcallbox-MAIN_Install.py It can be downloaded here


Connect in SCP with the tool WinSCP for example to transfert the file :





Copy the file fcallbox-MAIN_Install.py in /home/pi :




NOTE 1 : By default the IR remote control is installed, if you want another one, edit the file and replace in the section if DEVICE == MAIN :

REMOTE = INFRARED by :

- REMOTE = RADIO for Radio type

- REMOTE = 2 to not install remote control


NOTE 2 : The IP address is set in the section set IP address FCALLBOX_MAIN followed by the one of the server and FCALLBOX_DISPLAY if used


Connect to the FCALLBOX Serveur in SSH, edit the file if needed, then launch the script (this will take about 10mn):


   cd /home/pi          
   sudo python fcallbox-MAIN_Install.py
   sudo reboot



BELOW THE DESCRIPTION OF THE STEPS OF THE INSTALLATION OF THE SCRIPT :


   IP address defines for the server and the display if needed   
   


   ############          
   # set IP address #
   ############          
   sudo echo 'FCALLBOX_DISPLAY 192.168.0.90' > /var/tmp/FCALLBOXconfig.txt
   sudo echo 'FCALLBOX_MAIN 192.168.0.43' >> /var/tmp/FCALLBOXconfig.txt



   Create directories   
   


   ##############                
   # create directories #                
   ##############                
   mkdir -p /home/pi/FCALLBOX               
   mkdir -p /home/pi/temp                
   sudo mkdir -p /var/www/photos                
   sudo chown -R www-data:www-data /var/www/photos                
   sudo chmod 777 /var/www/photos                
   sudo mkdir -p /var/www/radio                
   sudo chown -R www-data:www-data /var/www/radio                
   sudo chmod 777 /var/www/radio                
   sudo mkdir -p /phone                
   sudo chown -R www-data:www-data /phone                
   sudo chmod 777 /phone                
   sudo mkdir -p /var/www/phone                
   sudo chown -R www-data:www-data /var/www/phone                
   sudo chmod 777 /var/www/phone                
   sudo mkdir -p /bourse                
   sudo chown -R www-data:www-data /bourse                
   sudo chmod 777 /bourse                
   sudo mkdir -p /var/www/bourse                
   sudo chown -R www-data:www-data /var/www/bourse                
   sudo chmod 777 /var/www/bourse                
   sudo mkdir -p /var/www/music/                
   sudo chown -R www-data:www-data /var/www/music/                
   sudo chmod 777 /var/www/music/                



   Set the hostname and the host (useful to identify the box)    
   


   #################                
   # set Hostname and host #                
   #################                
   sudo sh -c "echo main > /etc/hostname"               
   sudo sh -c "echo 127.0.1.1 main >> /etc/hosts"               



   Disable the system message on the console   
   


   Edit /etc/inittab               
   replace T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100 by #T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100               
                  
   Edit /boot/cmdline.txt               
   Delete console=ttyAMA0 and kgdboc=ttyAMA0               



   Change video mode   
   


   Edit /boot/config.txt               
   replace #sdtv_mode=2 by sdtv_mode=2\nstdv_aspect=3 # 16/9               



   Disable screensaver   
   


   Edit the files /etc/xdg/lxsession/LXDE/autostart and /etc/xdg/lxsession/LXDE-pi/autostart               
   And add :               
   @xscreensaver -no-splash               
   @xset s off               
   @xset -dpms               
                  
   Edit /etc/lightdm/lightdm.conf               
   Add xserver-command=X -s 0 dpm after the section after [SeatDefaults]               



   Install MPC MPD for MP3 player and for the web radio   
   


   Installation :               
   sudo apt-get install mpd mpc -qq                
   sudo apt-get git-core binutils mpd mpc -qq                
   sudo BRANCH=fiq_split rpi-update               
                  
   Edit the file /etc/mpd.conf               
   Replace format "44100:16:2" # optional by #format "44100:16:2" # optional               
   Change the directory described in music_directory by /var/www/music/               



   Install the GPIO librairies (for hardware control)   
   


   wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.25.tar.gz --output-document=/home/pi/FCALLBOX/bcm2835-1.25.tar.gz"               
   sudo tar zxvf /home/pi/FCALLBOX/bcm2835-1.25.tar.gz -C /home/pi/FCALLBOX/               
   rm -f /home/pi/FCALLBOX/bcm2835-1.25.tar.gz               
   cd /home/pi/FCALLBOX/bcm2835-1.25 ; ./configure               
   cd /home/pi/FCALLBOX/bcm2835-1.25 ; sudo make               
   cd /home/pi/FCALLBOX/bcm2835-1.25 ; sudo make check               
   cd /home/pi/FCALLBOX/bcm2835-1.25 ; sudo make install               
   cd /home/pi/               



   Install SMARTMONTOOLS to monitor the hard drives   
   


   sudo apt-get install smartmontools -qq                



   Set the programs to launch at startup    
   


   Edit /etc/rc.local and add the folowing lines before the line exit 0               
   su -l pi -c "env FRAMEBUFFER=/dev/fb1 startx &"               
   sudo /home/pi/FCALLBOX/FcallServer &                
                  
   Edit the files /etc/xdg/lxsession/LXDE/autostart and /etc/xdg/lxsession/LXDE-pi/autostart               
   Add at the end of the file :                
   @sudo python /home/pi/FCALLBOX/fcallbox.py               



   Install the FCALLBOX binary files   
   


   sudo rm /home/pi/temp/*               
   wget fcallbox.free.fr//MAIN_INSTALL/ --output-document=/home/pi/temp/MAIN_BIN.zip                
   unzip /home/pi/temp/MAIN_BIN.zip -d /home/pi/temp/MAIN_BIN.zip                
   sudo rm /home/pi/temp/MAIN_BIN.zip                
   cp /home/pi/temp/* /home/pi/FCALLBOX                
   sudo chmod +x /home/pi/FCALLBOX/*                
   rm -f /home/pi/temp/*                



   Install Appache web server and PHP   
   


   sudo apt-get install apache2 -qq                
   sudo aptitude install php5 -yq               



   Install the CGI files for the FCALLBOX webserver   
   


   sudo rm /home/pi/temp/MAIN_CGI.zip               
   wget fcallbox.free.fr//MAIN_INSTALL/MAIN_CGI.zip --output-document=/home/pi/temp/MAIN_CGI.zip               
   unzip /home/pi/temp/MAIN_CGI.zip -d /home/pi/temp/                
   sudo rm /home/pi/temp/MAIN_CGI.zip               
   sudo rm -f /usr/lib/cgi-bin/*                
   sudo cp /home/pi/temp/* /usr/lib/cgi-bin                
   sudo chown -R www-data:www-data /usr/lib/cgi-bin/*                
   sudo chmod +x /usr/lib/cgi-bin/*                
   rm -f /home/pi/temp/*                



   Install the pictures for the FCALLBOX webserver   
   


   sudo rm /home/pi/temp/MAIN_WWW.zip                
   wget fcallbox.free.fr//MAIN_INSTALL/MAIN_WWW.zip --output-document=/home/pi/temp/MAIN_WWW.zip                
   unzip /home/pi/temp/MAIN_WWW.zip -d /home/pi/temp/                
   sudo rm /home/pi/temp/MAIN_WWW.zip                
   sudo cp /home/pi/temp/* /var/www/                
   sudo cp /home/pi/temp/avatar.jpg /var/www/phone/                
   rm -f /home/pi/temp/*                



   Install the remote control (Radio or IR)   
   

The method is described here



   Pi TFT 2.8" screen installation   
   


   Edit the file /etc/modules and add :                
   fbtft_device custom name=pitft speed=32000000 rotate=90 bgr=1                
                   
   Edit the file /boot/config.txt                
   Replace #dtparam=spi=on by dtparam=spi=on                
                   
   Edit the file /boot/cmdline.txt                
   add fbcon=map:10                
                   
   Enter :                
   sudo mv /usr/share/X11/xorg.conf.d/99-fbturbo.conf ~                


Copyright François Callanquin, September 2015

Contact : fcallbox@free.fr