Skip to content

Commit

Permalink
Pi setup doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Théo CHASSAIGNE committed Sep 15, 2016
1 parent a9573df commit 0e9aa9d
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 20 deletions.
12 changes: 12 additions & 0 deletions doc/HOME.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ Table of content
General informations
====================

Licenses
~~~~~~~~

This documentation is formatted using the `reStructuredText <http://docutils.sourceforge.net/rst.html>`_ syntax, and is distributed under the Creative Commons BY-SA 4.0 license.

The `Open Sound Control (OSC) packet manipulation library <http://www.rossbencina.com/code/oscpack>`_ is written and distributed under the `MIT license <https://opensource.org/licenses/mit-license.phpl>`_, with the following addition :
Expand All @@ -33,3 +36,12 @@ The `Open Sound Control (OSC) packet manipulation library <http://www.rossbencin
The `libaudiotool audio framework <https://github.com/jcelerier/libaudiotool>`_ is distributed under the `GNU GPL v3 <https://www.gnu.org/licenses/gpl-3.0.html>`_.

The application itself is distributed under the `Zlib License <https://opensource.org/licenses/Zlib>`_.

Notation
~~~~~~~~

In that document, you will often see commands that you can enter in an terminal, beginning either with a ``$`` or a ``#``, that you MUST NOT type.

If the command starts with a ``$``, you just have to be a regular user to perform it (by default, ``pi``).

If it's a ``#``, you NEED ``root`` privileges (sometimes, the ``sudo`` command is enough, but not always).
105 changes: 85 additions & 20 deletions doc/PI.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,50 @@
Configuration Pi
================

Distrib : Raspbian Jessie Lite
Install (pour install auto : ajouter silentinstall au début de boot/commandline.txt, puis connexion SSH).
Raspbian installation
---------------------

The installation will be done on a Raspberry Pi, powered by the `*Raspbian Jessie Lite* <https://www.raspberrypi.org/downloads/raspbian/>`_ image.

You can follow the installation instructions for more information about how to write the image on an `SD Card <https://www.raspberrypi.org/documentation/installation/installing-images/README.md>`.

If you have a screen and a USB keyboard
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you have a screen with a HDMI port, connect it to your Raspberry Pi and do the same with a USB keyboard. Then power your Raspberry Pi on and follow the onscreen instructions to perform the installation.

If you don't
~~~~~~~~~~~~

If you don't have both a screen and a keyboard, you can still access it through SSH.

To do that, once the image has been written on the card, mount its ``boot`` partition, open the ``commandline.txt`` file and add ``silentinstall`` at the beginning of the first line.

Then, connect the Pi to your network (or directly to your computer, creating a local network !) with an Ethernet cable and power it on. You can scan your network with the ``nmap`` command to find your Pi IP address and connect you to it through SSH (default password : ``raspberry``)::

$ ssh pi@<your pi's IP>

Server's requirements
---------------------

SPI
~~~

For the Boîtes Électriques Server's executable to be able to run correctly, you need to activate the SPI interface on the Pi. To do that, just type::

Activate SPI::
# raspi-config
-> 9 Advanced Options -> A5 SPI -> <Yes> -> <Ok> -> <Finish>
Bugs::
Then go to: ``9 Advanced Options`` -> ``A5 SPI`` -> ``<Yes>`` -> ``<Ok>`` -> ``<Finish>``

Si Setting locale failed : `Solution <https://www.thomas-krenn.com/en/wiki/Perl_warning_Setting_locale_failed_in_Debian>`_
# dpkg-reconfigure locales
Warning : this must be done before executing the server (``be-server``), else it won't run.

SETUP WIFI BRIDGE::
Wifi bridge setup
-----------------

Network and tools
~~~~~~~~~~~~~~~~~

Dans /etc/network/interfaces::
First, edit the ``/etc/network/interfaces`` file, and replace it with this::
#config pont
iface eth0 inet dhcp
Expand All @@ -31,11 +58,14 @@ Dans /etc/network/interfaces::

iface default inet dhcp

Puis les utilitaires::
Then, we need Hostapd and DNSMasq to setup the bridge and attribute IPs automatically::

$ sudo apt-get install hostapd dnsmasq (iptables ?)
$ sudo apt-get install hostapd dnsmasq
Dans /etc/hostapd/hostapd.conf::
Hostapd configuration
~~~~~~~~~~~~~~~~~~~~~

Edit the ``/etc/hostapd/hostapd.conf`` file and replace it with this::

interface=wlan0
driver=nl80211
Expand All @@ -53,7 +83,26 @@ Dans /etc/hostapd/hostapd.conf::
rts_threshold=2347
fragm_threshold=2346
Dans /etc/dnsmasq.conf::
Then ``/etc/default/hostapd``to make it run on startup::

DAEMON_CONF="/etc/hostapd/hostapd.conf"
Test it::

# systemctl start hostapd
You can check the service status with the following command::

# systemctl status hostapd
And enable it with ``systemctl``::

# systemctl enable hostapd
DNSMasq
~~~~~~~

Edit the ``/etc/dnsmasq.conf`` file and replace it with this::

interface=wlan0
listen-address=192.170.0.1
Expand All @@ -62,12 +111,28 @@ Dans /etc/dnsmasq.conf::
domain-needed
bogus-priv
dhcp-range=192.170.0.50,192.170.0.150,12h

Test it::

Dans /etc/default/hostapd (pour hostapd au démarrage):
# systemctl start dnsmasq
You can check the service status with the following command::

DAEMON_CONF="/etc/hostapd/hostapd.conf"
# systemctl status dnsmasq
And enable it with ``systemctl``::

On teste::
# systemctl enable dnsmasq

Bugs
----

If you have the following error::
Setting locale failed
You can check the `following page <https://www.thomas-krenn.com/en/wiki/Perl_warning_Setting_locale_failed_in_Debian>`_, and run::
# dpkg-reconfigure locales
sudo service dnsmasq start
sudo service hostapd start
Then select the correct locales.

0 comments on commit 0e9aa9d

Please sign in to comment.