Skip to content

Commit

Permalink
Updated Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
carlou33 committed Sep 15, 2016
1 parent f7c4d21 commit a9573df
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 144 deletions.
78 changes: 43 additions & 35 deletions doc/COMPILING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 : <https://github.com/hixe33/boiteselectriques-server-deps>_

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
Expand All @@ -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.
15 changes: 9 additions & 6 deletions doc/HOME.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
72 changes: 0 additions & 72 deletions doc/INSTALL BOITES PI.txt

This file was deleted.

27 changes: 0 additions & 27 deletions doc/PI.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 10 additions & 4 deletions doc/SETUP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``::
Expand Down Expand Up @@ -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
-------------
Expand Down

0 comments on commit a9573df

Please sign in to comment.