diff --git a/doc/COMPILING.rst b/doc/COMPILING.rst index c6d20a2..6edbbd9 100644 --- a/doc/COMPILING.rst +++ b/doc/COMPILING.rst @@ -4,45 +4,47 @@ Compiling the project Dependencies ------------ -Installation on a new Raspberry Pi image (Raspbian Jessie) +Installation on a new Raspberry Pi image (Raspbian Jessie Lite) - sudo add-apt-repository ppa:ubuntu-toolchain-r/test - sudo add-apt-repository ppa:ubuntu-sdk-team/ppa - sudo apt-get update - sudo apt-get dist-upgrade - sudo apt-get install git g++-4.8 ubuntu-sdk libportaudiocpp0 libportaudio-dev libavfilter-dev libavformat-dev libavcodec-dev cmake - +Divers +~~~~~~ + +First, let's download the basic tools for compilation, plus the server's dependencies, from the official repo:: + + $ sudo apt-get install build-essential git liboscpack-dev libqt5serialport5-dev librtaudio-dev libsndfile1-dev qt5-default qt5-qmake wiringpi + +Extra CMake Modules +~~~~~~~~~~~~~~~~~~~ + +Then, we need the Extra CMake Modules to compile KArchive. +The problem is that the version in the official repositories is not enough up-to-date, so we need to compile a more recent verion:: + + $ sudo apt-get install cmake + $ git clone git://anongit.kde.org/extra-cmake-modules + $ cd extra-cmake-modules + $ mkdir build && cd build && cmake .. && make && sudo make install + +KArchive +~~~~~~~~~~ -Build latest CMake and KDE Frameworks 5 Archive : - -* CMake -``` - mkdir ~/kf5 - cd ~/kf5 - wget http://www.cmake.org/files/v3.0/cmake-3.0.0.tar.gz - tar -zxf cmake-3.0.0.tar.gz - cd cmake-3.0.0 - (mkdir build; cd build; cmake ..; make; make install) -``` -* Extra CMake modules -``` - git clone git://anongit.kde.org/extra-cmake-modules - cd extra-cmake-modules - (mkdir build; cd build; cmake ..; make; make install) -``` -* KArchive -``` - wget http://download.kde.org/stable/frameworks/5.0.0/karchive-5.0.0.tar.xz - tar -xf karchive-5.0.0.tar.xz - cd karchive-5.0.0.tar.xz - (mkdir build; cd build; cmake ..; make; make install) -``` - -And build. +Now, we can compile KArchive:: + + $ wget http://download.kde.org/stable/frameworks/5.17/karchive-5.17.0.tar.xz + $ tar -xf karchive-5.17.0.tar.xz + $ cd karchive-5.17.0 + $ mkdir build && cd build && cmake .. && make && sudo make install + +Additional notes +~~~~~~~~~~~~~~~~ + +If there is any problem with those dependencies, or if you can't download the ``liboscpack-dev`` from the official Raspbian repo, you can download the sources from our git repo : _ Building the program -------------------- +Compilation +~~~~~~~~~~~ + First, clone the repository on the Raspberry Pi, either directly from Github or using the Git CLI:: $ git clone https://github.com/hixe33/boiteselec-server @@ -51,5 +53,11 @@ Then, we need to generate the Makefile from the QMake file before finally compil $ mkdir boiteselec-server/build $ qmake -config release -o boiteselec-server/build/Makefile boiteselec-server/src/be-server.pro - $ cd boiteselec-server/build - $ make + $ cd boiteselec-server/build && make + +Now you're all set to test the program ! + +Additional notes +~~~~~~~~~~~~~~~~ + +If there is any ``#include`` problem at compilation, don't forget to check where all the libraries are installed (``.h`` and ``.so`` files) and to update the QMake file (``src/be-server.pro``) according to their locations. diff --git a/doc/HOME.rst b/doc/HOME.rst index dd74ba8..c228ded 100644 --- a/doc/HOME.rst +++ b/doc/HOME.rst @@ -5,16 +5,19 @@ Boîtes électriques - Server Table of content ================ -*HOME* +*1 - HOME* Presentation of the application. + +*2 - PI* + How to correctly set up the Raspberry Pi -*SETUP* - How to install and setup the server. - -*COMPILING* +*3 - COMPILING* How to build the program from the source. -*API* +*4 - SETUP* + How to install and setup the server's program. + +*5 - API* How client and server interact with each other. (Description of the protocol) diff --git a/doc/INSTALL BOITES PI.txt b/doc/INSTALL BOITES PI.txt deleted file mode 100755 index 55f9d9c..0000000 --- a/doc/INSTALL BOITES PI.txt +++ /dev/null @@ -1,72 +0,0 @@ -#pour ajouter une liste de packets -sudo nano /etc/apt/sources.list et remplacer jessie par testing -puis sudo apt-get update && sudo apt-get dist-upgrade - -#pour trouver une librairie -sudo apt-cache search nom_du_package - -#changer timezone -dpkg-reconfigure tzdata - -#mise à jour -sudo apt-get update && sudo apt-get upgrade -#sudo rpi-update - -#preparer le pi -sudo apt-get install libqt5core5a -sudo apt-get install qt5-qmake -sudo apt-get install qtbase5-dev -sudo apt-get install libqt5webkit5-dev -sudo apt-get install build-essential - -sudo apt-get install cmake -http://osdevlab.blogspot.fr/2015/12/how-to-install-latest-cmake-for.html -wget https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz -tar -xvzf cmake-3.4.1.tar.gz -cd cmake-3.4.1/ -cmake-3.4.1 $ sudo ./bootstrap -cmake-3.4.1 $ sudo make -cmake-3.4.1 $ sudo make install - - -sudo apt-get install extra-cmake-modules -git clone git://anongit.kde.org/extra-cmake-modules -cd extra-cmake-modules -(mkdir build; cd build; cmake ..; make; make install) - - - - -sudo apt-get install libbz2-1.0 libbz2-dev -sudo apt-get install liblzma5 liblzma-dev - -KArchive -sudo apt-get install libkf5archive5 libkf5archive-dev -ou -wget http://download.kde.org/stable/frameworks/5.17/karchive-5.17.0.tar.xz -tar -xf karchive-5.17.0.tar.xz -cd karchive-5.17.0.tar.xz -mkdir build -cd build -sudo cmake .. -sudo make -sudo make install - - - - - -sudo apt-get install librtaudio-dev -sudo apt-get install libqt5serialport5 libqt5serialport5-dev -sudo apt-get install liboscpack1 liboscpack-dev liboscpack-dbg -sudo apt-get install ffmpeg -sudo apt-get install libsndfile1 libsndfile1-dev - - -#pour karchive -sudo nano .bashrc et rajouter a la fin : export QT-SELECT=5 - -compiler -cd travail -qmake -config release -o Makefile ../src/InterfaceQt.pro -make diff --git a/doc/PI.rst b/doc/PI.rst index 1a777b4..a06b791 100644 --- a/doc/PI.rst +++ b/doc/PI.rst @@ -4,33 +4,6 @@ Configuration Pi Distrib : Raspbian Jessie Lite Install (pour install auto : ajouter silentinstall au début de boot/commandline.txt, puis connexion SSH). -NOT SO SURE ---------------------------------------------------------------------------------------- -On passe sur ``testing`` pour avoir tous les packages : ``/etc/apt/sources.list``:: - - deb http://mirrordirector.raspbian.org/raspbian/ **jessie** main contrib non-free rpi - -Devient:: - - deb http://mirrordirector.raspbian.org/raspbian/ **testing** main contrib non-free rpi - - - $ sudo apt-get update && sudo apt-get dist-upgrade ----------------------------------------------------------------------------------------- - -Git:: - $ sudo apt-get install git - $ git clone https://github.com/hixe33/boiteselec-server - - -Building:: - - $ sudo apt-get install build-essential qt5-qmake qt5-default libqt5serialport5-dev libsndfile1-dev liboscpack-dev librtaudio-dev - -WiringPi:: - -KF5Archive:: - Activate SPI:: # raspi-config diff --git a/doc/SETUP.rst b/doc/SETUP.rst index 525c5fe..603fb51 100644 --- a/doc/SETUP.rst +++ b/doc/SETUP.rst @@ -9,11 +9,17 @@ Basic Installation Just clone the repository on the Raspberry Pi and follow the instructions of the ``COMPILING.rst`` page. +To test the program, copy the ``share/run.sh`` script to the executable (``be-server``) directory, and run it (don't forget to ``chmod +x`` it if it doesn't want to be executed. + +WARNING : Be sure SPI has been activated, using the ``rapsi-config`` tool (cf ``PI.rst`` file for more details about how to set up the Raspberry Pi), or the server won't work. + .. _daemonized: Daemonizing ~~~~~~~~~~~ +WARNING : ``root`` access is required for the following section. + To make the server running in the background automatically on the RasPi startup, it's possible to daemonize it with a few steps. First, copy the ``be-server`` executable file to ``/opt/boites-electriques/``, and the ``be-server.sh`` script (located in the repo's ``share/`` directory) to ``/etc/init.d/be-server``:: @@ -47,19 +53,19 @@ Then, we give the right permissions to the daemonizing script and reload the sys We can then test the script:: - # /etc/init.d/be-server start + # systemctl start be-server [ ok ] Starting be-server (via systemctl): be-server.service - # /etc/init.d/be-server stop + # systemctl stop be-server [....] Stopping be-server (via systemctl): be-server.service And add it to the startup scripts:: - # update-rc.d be-server defaults + # systemctl enable be-server To remove it:: - # update-rc.d -f be-server remove + # systemctl enable be-server Configuration -------------