55
TECHNICAL REPORT UNIVERSITY OF TOULON & UMR CNRS LSIS SUPPORTED BY SABIOD.ORG AND SATT PACA AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & Dodotronic UM 250kHz J. Descudé, J-M. Prévot, E. Bruno, H. Glotin June 2014

AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

TECHNICAL REPORT UNIVERSITY OF TOULON & UMR CNRS LSIS SUPPORTED BY SABIOD.ORG AND SATT PACA

AMR UltraSonoc 4x Wifi Recorder

Implemented on BeagleBoard &

Dodotronic UM 250kHz

J. Descudé, J-M. Prévot, E. Bruno, H. Glotin

June 2014

Page 2: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

1 Les mots suivies de * sont définis dans le glossaire.

Keywords (Mots-clés)

Autonomous Ultrasonic recorder, Environmental survey, Bioacoustics, SABIOD, MASTODONS, AMR

cortex, Dodotronics, Beagle Board, Wifi

Introduction

Bioacoustic environmental surveys requiere autonomous broad band recordings, and if possible

real time data transmission of several channels. These data are used to monitor anthropic noise,

animals activities, in 2D or even 4D computing trajectories (demo at http://sabiod.org/tv ). Currently,

existing autonomous ultrasonic solutions use a single or at most costly stereo microphones.

In this technical report we propose an autonomous recording solution with several microphones

simultaneously optimize card to make priority sounds (Core real time), but also we establish a system

to send the data on the card placed in nature to researchers either through Wi-Fi or through

telephone network.

All codes (scripts) in this report are under the GPL.

The hardware in the project consists on most advanced material : (a) low power Debian BeagleBoard,

(b) 4 Ultramic 250 Dodotronic microphones, (c) NanoStation M5. N 2.4GHz Outdoor Access.

The BeagleBoard is an electronic card single board computer type low power. This is a free material

produced by Texas Instruments in collaboration with Digi-Key. The BeagleBoard has also been

designed keeping in mind the development of open software source. This card uses an ARM Cortex

A8 1GHz processor and 512MB of RAM. The BeagleBoard-xM map is under the operating system

Debian Linux. Debian Renowned interest for the ARM Architecture used here by its BeagleBoard

Stability. Debian has a great Community and a very good packages system.

ULTRAMIC 250K is an ultrasonic microphone with a digital to analog converter integrated with a

sampling rate of 250 kHz. The USB 2.0 port allows easy connection to PC. The device is recognized as

a microphone HID (Human Interface Device) so no driver installation is required.

The NanoStation M5 is a 2.4GHz Outdoor Access (MIMO) point with integrated antenna. It provides

data rates of up to 150Mbps LAN. The Nanostation M5 also includes a second port Ethernet option to

enable PoE.

Installations of this system in National Parc Port-Cros are currently under process, offline and in near

future online for bat, bird and batracian monitoring in Natura 2000 sites.

The following section are in french, and can be translated for any reader contacting the authors.

Acknowledgments

We thank SABIOD.ORG project of the MI CNRS MASTODONS and SATT PACAwhich granted some

material used in this project.

Page 3: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

2 Les mots suivies de * sont définis dans le glossaire.

Sommaire

I. Introduction ..................................................................................................................................... 4

1. Présentation du LSIS .................................................................................................................... 4

2. Rappel de l’existant ..................................................................................................................... 4

3. Besoin du laboratoire .................................................................................................................. 4

II. Licence des codes ............................................................................................................................ 4

III. Présentation des différents travaux ............................................................................................ 5

1. Présentation des composants ..................................................................................................... 5

a. BeagleBoard-xM ...................................................................................................................... 5

b. Ultramic250K ........................................................................................................................... 5

c. NanoStation M5 ...................................................................................................................... 6

d. Debian ..................................................................................................................................... 6

2. Mise en place d’une solution fonctionnelle ................................................................................ 7

a. Fichier de configuration .......................................................................................................... 7

b. Script de configuration de la carte « beagle_init.sh » ............................................................ 7

c. Script de gestion « record_global.sh » .................................................................................. 10

d. Script d’enregistrement audio « record_wavflacftp.sh » .................................................... 11

e. Script d’enregistrement des positions GPS « record_gps.sh » ............................................. 13

3. Schéma de fonctionnement général ......................................................................................... 14

Voici une vue du fonctionnement général lors du démarrage de la carte : ..................................... 14

4. Problématique ........................................................................................................................... 15

a. Problématique horodatage ................................................................................................... 15

b. Problématique gestion des quatre micros ............................................................................ 15

c. Problématique de compression ............................................................................................ 15

d. Problématique de transmission ............................................................................................ 16

f. Problématique d’énergie ....................................................................................................... 16

IV. Temps Réel ................................................................................................................................ 17

V. Outils ............................................................................................................................................. 18

1. Présentation des Outils ............................................................................................................. 18

a. Git .......................................................................................................................................... 18

b. Redmine ................................................................................................................................ 18

VI. Conclusion ................................................................................................................................. 19

VII. Annexes ..................................................................................................................................... 19

Page 4: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

3 Les mots suivies de * sont définis dans le glossaire.

1. Installation du système sur carte SD ......................................................................................... 19

2. Création d’une carte virtuelle pour 4 micros ............................................................................ 20

3. Fichier de configuration « record.conf »................................................................................... 22

4. Script « beagle_init.sh » ............................................................................................................ 23

5. Script « record_global.sh » ....................................................................................................... 26

6. Script « record_wavflacftp.sh » ................................................................................................ 27

7. Script « record_gps.sh » ............................................................................................................ 29

8. Test des différents codecs ......................................................................................................... 30

9. Test des différents moyens de transfert de fichier ................................................................... 31

10. Schéma Réseau ...................................................................................................................... 33

11. Rtcwake ................................................................................................................................. 33

12. Ntpdate .................................................................................................................................. 33

13. Création d’un serveur FTP ..................................................................................................... 34

14. Sécurisation du serveur FTP .................................................................................................. 35

a. SSH ......................................................................................................................................... 35

b. Fail2ban ................................................................................................................................. 36

15. Glossaire ................................................................................................................................ 37

16. Configuration des bornes Wi-Fi ............................................................................................. 38

17. Récupération automatique des fichiers ................................................................................ 41

18. Découpage des fichiers audio................................................................................................ 42

19. Schéma branchement « disque dur externe » ...................................................................... 43

20. Schéma branchement « Wi-Fi » ............................................................................................ 44

21. Sources .................................................................................................................................. 45

22. Licence GPL ............................................................................................................................ 46

Page 5: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

4 Les mots suivies de * sont définis dans le glossaire.

I. Introduction

1. Présentation du LSIS

Le LSIS a été créé en janvier 2002 par regroupement d’équipes de recherche issues du DIAM

(UPRES-EA n°2210), du LIM (FRE n°2246) et de l’ENSAM d’Aix-en-Provence. C’est une unité mixte de

recherche (UMR 7296) commune à l’Université marseillaise, l’Université de Toulon, l’ENSAM d’Aix-

en-Provence et au CNRS (Institut National des Sciences de l’Informatique et ses Interactions – INSII).

Il fédère actuellement près de 200 chercheurs, enseignants chercheurs et doctorants. De par sa

composition (chercheurs de la section 07 du CNRS, enseignants-chercheurs des sections 27 et 61 du

CNU), les activités de recherche du laboratoire recouvrent plusieurs domaines de l’Informatique, de

l’Automatique et de l’Image. A sa création, le LSIS était structuré en 6 équipes qui avaient chacune

une homogénéité scientifique tout en regroupant, pour certaines, des automaticiens et des

informaticiens.

2. Rappel de l’existant

Les chercheurs utilisent une carte électronique pouvant enregistrer des sons d'animaux sur

une ou plusieurs voies. Ils récupèrent les sons afin de les traiter pour examiner la biodiversité

présente dans le milieu, voire même faire de la trajectographie.

3. Besoin du laboratoire

Actuellement la solution existante utilise un seul microphone. Ma mission est de rendre cette

solution adaptable à un enregistrement avec plusieurs microphones en même temps, d'optimiser la

carte afin de rendre les sons prioritaires (Noyau temps réel) mais aussi de mettre en place un

système permettant d'envoyer les données présentes sur la carte placée dans la nature vers les

chercheurs soit par Wi-Fi soit par réseau téléphonique.

II. Licence des codes

Tous les codes (scripts) dans ce rapport sont sous licence GPL.

Voir annexe licence GPL.

La licence est disponible sur ce lien : http://www.gnu.org/licenses/gpl-3.0.txt

Page 6: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

5 Les mots suivies de * sont définis dans le glossaire.

III. Présentation des différents travaux

1. Présentation des composants

a. BeagleBoard-xM

La BeagleBoard est une carte électronique de type ordinateur à carte unique de faible

puissance. Il s'agit d'un matériel libre produit par Texas Instruments en collaboration avec Digi-Key.

La BeagleBoard a également été conçue en ayant à l'esprit le développement de logiciels open

source. Cette carte utilise un processeur ARM Cortex A8 à 1GHz ainsi que 512Mo de RAM.

b. Ultramic250K

Ultramic 250K est un microphone à ultrason avec un convertisseur numérique analogique

intégré avec un taux d'échantillonnage de 250 kHz. Le port USB 2.0 permet une connexion facile vers

les PC; l'appareil est reconnu comme un microphone HID (Human Interface Device) donc aucune

installation de pilote n’est nécessaire.

Il y aura 4 microphones de ce type reliés à la carte.

Page 7: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

6 Les mots suivies de * sont définis dans le glossaire.

c. NanoStation M5

Point d'accès extérieur 2.4GHz N (MIMO*) avec antenne intégrée. Celle-ci permet d'obtenir

des débits de données jusqu'à 150Mbps LAN. La Nanostation M5 intègre également un second port

Ethernet avec possibilité d'activer l'alimentation PoE* via l'interface d'administration.

d. Debian

La carte BeagleBoard-xM sera sous le système d’exploitation Debian Linux. Debian est réputé

pour sa stabilité et gère aussi l’architecture ARM ici utilisée par la carte BeagleBoard. Debian possède

aussi une très grande communauté et un très bon système de paquets.

Page 8: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

7 Les mots suivies de * sont définis dans le glossaire.

2. Mise en place d’une solution fonctionnelle

Afin de faire une solution qui puisse enregistrer avec 4 micros en même temps, les

compresser et ensuite les envoyer en Wi-Fi, plusieurs scripts écrits en Bash* vont être mis en place.

a. Fichier de configuration

Un fichier de configuration est nécessaire afin de pouvoir communiquer aux autres scripts les

différentes variables utilisés par ces derniers.

Dans ce fichier on retrouve :

Dossier de stockage des fichiers audio

Dossier de stockage des scripts

Préfixe du nom de fichier

Durée de l'enregistrement

Fréquence d'échantillonnage (Hz)

Quantification (Bits)

Le/les micro(s)

Nombre de voies

Lien symbolique pour la lecture en même temps que l'enregistrement

Présence d'un GPS (Oui/Non)

Type de capture (Fixe/Mouvement)

Lecture pendant la capture (Oui/Non)

Présence d’un GPS (Oui/Non)

Présence de Wi-Fi (Oui/Non)

Le serveur NTP

Le type de transfert (Non/FTP)

Les identifiants FTP

Quelques variables nécessaires aux scripts

b. Script de configuration de la carte « beagle_init.sh »

Le premier script (« beagle_init.sh ») qui se lance au démarrage de la carte remplira les tâches

suivantes :

Possibilité de récupérer l'heure grâce au GPS

Possibilité de récupérer l’heure grâce au NTP

Création de dossier en cas d'échec de récupération de l'heure

Mise à jour des variables utilisés dans les prochains scripts

Appel du second script

Page 9: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

8 Les mots suivies de * sont définis dans le glossaire.

Schéma de fonctionnement du script :

Page 10: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

9 Les mots suivies de * sont définis dans le glossaire.

Fonction autologinftp Fonction creationdir Fonction miseheuredate

Fonction heuredate

Page 11: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

10 Les mots suivies de * sont définis dans le glossaire.

c. Script de gestion « record_global.sh »

Le deuxième script (« record_global.sh ») se lance une fois que le premier est terminé, il remplira les

tâches suivantes :

Appel du script d’enregistrement audio

Si besoin appel du script d’enregistrement des positions GPS

Possibilité de pouvoir écouter l’enregistrement

Schéma de fonctionnement du script :

Page 12: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

11 Les mots suivies de * sont définis dans le glossaire.

d. Script d’enregistrement audio « record_wavflacftp.sh »

Le troisième script (« record_wavflacftp.sh ») est celui qui fonctionnera tout le temps, en effet c’est

celui qui a pour tâche :

Enregistrer les fichiers audio avec les 4 micros

Nommer les fichiers : « PREFIX-positionGPS-date.wav »

Compresser dans le format FLAC les enregistrements

Envoyer ou non les fichiers audio vers le serveur FTP

Mettre en veille la carte entre les enregistrements

Schéma de fonctionnement du script :

Page 13: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

12 Les mots suivies de * sont définis dans le glossaire.

Fonction dir Fonction fflac Fonction fposition

Fonction fpositionmvmnt Fonction transfert_wifi_ftp

Page 14: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

13 Les mots suivies de * sont définis dans le glossaire.

e. Script d’enregistrement des positions GPS « record_gps.sh »

Ce script sera lancé uniquement si la capture est faite en déplacement (en bateau par exemple) le

script a pour seul tâche :

Enregistrer les positions GPS

Schéma de fonctionnement du script :

Page 15: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

14 Les mots suivies de * sont définis dans le glossaire.

3. Schéma de fonctionnement général

Voici une vue du fonctionnement général lors du démarrage de la carte :

Page 16: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

15 Les mots suivies de * sont définis dans le glossaire.

4. Problématique

a. Problématique horodatage

La carte BeagleBoard ne possède pas de pile, donc à chaque démarrage celle-ci est remise à

la date du 1er janvier 1970 (date UNIX). Les fichiers devant être horodatés afin de les classer cela

pose un problème d'écrasement. Pour remédier à ce problème le script au démarrage va regarder

dans le fichier de configuration s’il y a présence de GPS, ou de Wi-Fi, si oui il va alors récupérer

l’heure. Dans le cas contraire un dossier sera alors créé ainsi les enregistrements seront dans des

dossiers différents à chaque démarrage.

Voir annexe script « beagle_init.sh »

b. Problématique gestion des quatre micros

Dans notre projet il faut capturer du son venant de 4 micros en même temps afin de parvenir

à cela on va utiliser le logiciel SoX (SOund eXchange) associé à ALSA (Advanced Linux Sound

Architecture). Pour capturer du son venant de 4 micros il faut créer une carte son virtuelle

regroupant ces 4 micros.

Voir annexe Création d'une carte virtuelle de 4 micros

c. Problématique de compression

Afin de pouvoir envoyer les fichiers audio il va falloir les compresser, en effet un

enregistrement non compressé de 5 minutes avec les 4 micros à 250KHz fait : ~600Mo.

Il existe plusieurs codec* de compression sans perte, ici on va s’intéresser à deux codecs : le FLAC et

le WavPack.

FLAC : Free Lossless Audio Codec est un codec libre de compression audio sans perte. À l’inverse de

codecs tels que MP3 ou Vorbis, il n’enlève aucune information du flux audio. Cette qualité maximale

a pour conséquence une quantité d'information plus élevée, qui tout en étant assez variable se

trouve en moyenne être de l'ordre de 50 % de la taille du même fichier au format PCM*

WavPack : est un format de fichier ainsi qu'un outil de compression audio permettant d'encoder (et

de restaurer) un flux PCM sans perte ou avec pertes et même de cumuler les deux aspects (format

hybride, voir ci-dessous). Le format est ouvert, et l'outil est libre, distribué selon les termes de la

licence BSD.

Après différents tests le codec FLAC avec l'option -–fast a été retenue.

Voir annexe Test des codecs

Page 17: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

16 Les mots suivies de * sont définis dans le glossaire.

d. Problématique de transmission

L'enregistrement audio demande énormément de capacité de stockage afin de pouvoir

laisser le système tourner pendant longtemps, une solution de transfert des fichiers audio est

nécessaire, pour cela on va utiliser deux bornes NanoStation M5 pour transférer les fichiers en Wi-Fi.

Les fichiers seront envoyés vers un serveur FTP* (File Transfert Protocol).

Voir Annexe schéma réseau et configuration des bornes Wi-Fi

e. Problématique de stockage

Comme dit précédemment les enregistrements seront envoyés par Wi-Fi, un serveur FTP doit

être donc configuré afin de pouvoir réceptionner ces fichiers.

Voir annexe création d’un serveur FTP et test des différents moyens de transfert de fichier

f. Problématique d’énergie

Le système lorsqu’il est mis en place est alimenté par des batteries. Afin de ne pas gaspiller

de l’énergie le système sera « mis en sommeil » dès qu’il aura terminé ce qu’il a à faire.

Voir annexe rtcwake

g. Problématique de découpage des fichiers audio

Afin de pouvoir être traités les fichiers audio comportant les quatre voies doivent être transformés

en soit deux fichiers de deux voies, soit quatre fichiers d’une voie. Cette étape sera effectuée sur le

serveur NAS* qui stockera les fichiers audio.

Voir annexe découpage des fichiers audio

Page 18: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

17 Les mots suivies de * sont définis dans le glossaire.

IV. Temps Réel

En informatique, un système temps réel est une application ou plus généralement un système

pour lequel le respect des contraintes temporelles dans l’exécution des traitements est aussi

important que le résultat de ces traitements.

Pour ce projet, le temps réel a été choisi car il permet de rendre prioritaire l’enregistrement audio et

d’éviter les petites coupures pouvant survenir avec un système non temps réel.

Un noyau Temps Réel est adapté à une application industrielle spécifique et ne doit pas être utilisé

pour autre chose. Dans le cas d'un Linux Temps Réel, quand les tâches Temps Réel accaparent le

processeur, le noyau Linux et l'ensemble des processus Linux n'ont plus la main et l'utilisateur qui

aura l'impression que son PC est figé alors que ce comportement est tout à fait normal. Avoir un PC

exécutant un Linux Temps Réel pour un usage de bureau n'est donc pas souhaitable.

Plusieurs solutions existent sous linux :

Xenomai

Linux-RT

RTAI

Les différents tests que j’ai effectués ont été portés sur la solution Xenomai, car c’est la solution la

plus documentée que j’ai pu trouver lors de mes recherches.

Afin de pouvoir utilisé Xenomai il faut recompiler un noyau linux. Pour cela il faut tout d’abord

télécharger les sources du noyau de base ainsi que les sources de Xenomai, une fois ces fichiers

téléchargés, il faut alors appliquer le patch Xenomai sur ces sources du noyau de base.

Ici un des problèmes rencontrés est que la BeagleBoard fonctionne sur une architecture ARM alors

que celle utilisé par le poste de travail est une architecture x86 afin de pouvoir recompiler le noyau

temps réel un outil de « cross-compilation » doit être installé.

La cross compilation consiste à compiler une application pour un environnement d’exécution

différent de celui où est effectuée la compilation.

L’outil de cross compilation utilisé ici est Buildroot, Buildroot est un outil qui simplifie et automatise

le processus de construction d’un système Linux complet pour un système embarqué. Pour atteindre

cet objectif, Buildroot est capable de générer un ensemble d’outils de cross compilation, un système

de fichier racine, une image du noyau Linux et un Bootloader*.

Une fois l’outil installé et la compilation réussie on peut enfin démarrer sur le système.

Toute fois la solution temps réel n’a pas était mise en place pour l’instant, car de nombreux

problèmes sont survenus lors de la compilation du noyau une fois le patch Xenomai mis en place.

Beaucoup de recherches et de travails restes à faire sur cette solution qui à terme devra être mise en

place afin d’améliorer grandement la qualité des enregistrements audio.

Page 19: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

18 Les mots suivies de * sont définis dans le glossaire.

V. Outils

1. Présentation des Outils

a. Git

Git est un logiciel de gestion de versions décentralisé. Il est conçu pour être efficace tant avec

les petits projets, que les plus importants. Git a spécialement été créé pour le développement du

noyau Linux. Ce projet a débuté en 2005, Linus Torvalds voulait créer une alternative au logiciel

propriétaire BitKeeper. Depuis, Git a beaucoup évolué et est utilisé par de nombreux projets.

Contrairement à des outils comme SVN ou CVS, Git fonctionne de façon décentralisée, c'est-à-dire

que le développement ne se fait pas sur un serveur centralisé, mais chaque personne peut

développer sur son propre dépôt. Git facilite ensuite la fusion (merge) des différents dépôts.

b. Redmine

Redmine est une application web de gestion de projet. C’est une solution multiplateforme et multi-

base de données.

Redmine est une solution open source distribuée sous les termes de la GNU General Public License

v2 (GPL).

A travers l’interface Redmine on retrouve des outils de pastes afin de pouvoir sauvegarder un bout

de code dans un coin par exemple, on retrouve aussi Git qui permet de stocker du code et de voir les

différentes étapes de la création du code.

Page 20: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

19 Les mots suivies de * sont définis dans le glossaire.

VI. Conclusion

Aujourd’hui, la solution fonctionne avec 4 micros enregistrant simultanément et transférant les

données récoltées vers un serveur de stockage. Les problématiques rencontrées ont étaient résolues

grâce aux fonctionnements des scripts. Seule la solution « Temps réel » n’est actuellement pas mise

en place, car d’autres recherches et d’autres tests restent à faire. Le projet est prêt à être déployé sur

le site de Port Cros en situation réelle.

VII. Annexes

1. Installation du système sur carte SD

Afin d’installer le système sur la BeagleBoard on va utiliser la carte SD. Pour ce faire il faut

préalablement mettre à jour la machine que l’on va utiliser :

root@machine:~# apt-get update && apt-get-upgrade

Ensuite installer les paquets nécessaires :

root@machine:~# apt-get install wget dofstools u-boot-tools parted git

Un script a été écrit afin de préparer la carte SD et y mettre l’image de Debian pour le télécharger :

root@machine:~# git clone git://github.com/RobertCNelson/netinstall.git root@machine:~# cd netinstall

On branche la carte SD dans la machine afin de la voir on utilise la commande :

root@machine:~# fdisk –l

Maintenant on va utiliser le script que l’on a téléchargé :

root@machine:/../netinstall# ./mk_mmc.sh –mmc /dev/sdX –dtb omap3-beagle-xm –distro wheezy-armhf

sdX où X correspond à la lettre de la carte

Une fois le script terminer la carte est prête. On peut à présent brancher la carte SD dans la

BeagleBoard et démarrer la carte.

L’installation de Debian va se lancer. Plusieurs questions vont nous être posées :

On choisit la langue

On configure le réseau

Le compte administrateur

Le compte utilisateur

Les paquets à installer (ici le minimum afin de consommer le moins possible : serveur ssh et

utilitaires usuels)

L’installation est à présent terminée, le reste des commandes seront faites en SSH*.

Page 21: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

20 Les mots suivies de * sont définis dans le glossaire.

2. Création d’une carte virtuelle pour 4 micros

Afin de créer une carte virtuelle comprenant les 4 micros il faut créer un fichier appelé « .asoundrc »

à l’emplacement personnel de l’utilisateur qui fera appel à cette carte virtuelle : « /home/user ».

Ce fichier doit contenir :

pcm.!default { type hw card 0 } ctl.!default { type hw card 0 } pcm.multidodo { type multi; slaves.a.pcm "hw:1,0"; slaves.a.channels 1; slaves.b.pcm "hw:2,0"; slaves.b.channels 1; slaves.c.pcm "hw:3,0"; slaves.c.channels 1; slaves.d.pcm "hw:4,0"; slaves.d.channels 1; bindings.0.slave a; bindings.0.channel 0; bindings.1.slave b; bindings.1.channel 0; bindings.2.slave c; bindings.2.channel 0; bindings.3.slave d; bindings.3.channel 0; } ctl.multidodo { type hw; card 5; } pcm.ttable { type route; slave.pcm "multidodo"; slave.channels 4; ttable.5.0 1; ttable.5.1 1; ttable.5.2 1; ttable.5.3 1; } ctl.ttable { type hw; card 5; }

Page 22: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

21 Les mots suivies de * sont définis dans le glossaire.

« multidodo » désigne le nom de la carte virtuelle. Pour plus d’information voir :

http://alsa.opensrc.org/MultipleCards#Multiple_devices

Afin de voir les numéros des cartes (« hw :x,x ») :

debian@arm:~$ cat /proc/asound/pcm 00-00: TWL4030 HiFi twl4030-hifi-0 : : playback 1 : capture 1 01-00: USB Audio : USB Audio : capture 1 02-00: USB Audio : USB Audio : capture 1 03-00: USB Audio : USB Audio : capture 1 04-00: USB Audio : USB Audio : capture 1

Une fois le fichier créé on redémarre le service :

root@arm:/home/debian# /etc/init.d/alsa-utils restart

Paquet nécessaire : « alsa-utils »

Page 23: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

22 Les mots suivies de * sont définis dans le glossaire.

3. Fichier de configuration « record.conf »

Afin de faciliter la configuration des différents scripts un fichier de configuration regroupant les

différentes variables a été créé :

# record.conf ######################################################################### # Ce fichier permet de renseigner les divers variables pour le fonctionnement des scripts # ######################################################################### # dossier de stockage des wav #work_dir= work_dir=/DATA # dossier contenant les scripts bin_dir=/usr/local/bin #bin_dir=3 # préfixe du nom de fichier prefix="BEAGLE" # durée du fichier (s) rec_time=20 # fréquence d'échantillonnage (Hz) sample_rate=250000 # quantification (bits) sample_size=16 # micro # Si il n'y a qu'un micro usb : cat /proc/asound/pcm pour avoir hw:x,x # Si il y a plusieurs micro renseigner la carte virtuelle : multidodo par défaut micro=multidodo # nbre de voies chan=4 # fichier wav en cours current_rec=/home/debian/enregistrement_en_cours.wav # capture fixe ou en mouvement (0=fixe 1=mouvement) depl=0 # lecture pendant la capture (0=non 1=oui) # Ne fonctionne pas encore lect=0 # GPS ? (0=non 1=oui) gps=0 # Wifi ? (0=non 1=oui) wifi=1 # NTP srvntp=ntp.univ-tln.fr # transfert ? (non/ftp) transfert=ftp # Serveur ftp srvftp=10.9.185.12 # Login ftp loginftp=ftpbeagle # Password ftp passwordftp=ftp # Dossier ftp dans lequel les sons seront stockés dirftp=AUDIO/ # Ne pas changer # nouveau dossier (0=non 1=oui) new_dir=0 # Ne pas changer # numero du nouveau dossier ndir=4 # Ne pas changer # numero du nouveau dossier mvmnt mvmnt_dir=1 export work_dir bin_dir prefix rec_time sample_rate sample_size chan current_rec depl new_dir ndir mvmnt_dir lect gps srvftp transfert loginftp passwordftp wifi srvntp dirftp

Page 24: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

23 Les mots suivies de * sont définis dans le glossaire.

4. Script « beagle_init.sh »

Script :

#!/bin/bash ####################################### # Ce script se lance au démarrage de la carte # ####################################### # Fichier de configuration source /usr/local/bin/record.conf i=0 # Initialisation de la date au 1er Janvier 2001 date 0101000001.00 # Fonction pour mettre à l'heure la carte function miseheuredate () { # new_dir=0 indique qu'il n y a pas de nouveau dossier new_dir=0 # ajout de la localisation dans le /data/gps.txt cat /tmp/gps.txt >> /DATA/gps.txt # récupération de la date et de l'heure et mise en forme tmpdate=`echo "$jour" |cut -d : -f2 && echo "$jour" |cut -d : -f1 && echo $heure |cut -d : -f1 && echo $heure |cut -d : -f2 && echo $jour |cut -d : -f3 && echo . && echo $heure |cut -d : -f3` datecomplete=`echo $tmpdate |sed 's/ //g'` # réglage de la date date --utc $datecomplete } # Fonction pour créer un dossier 1,2,3... si capture fixe ou mvmnt1,mvmnt2.... en mouvement function creationdir () { # new_dir=1 indique qu'un nouveau dossier a été créé new_dir=1 # Type de capture ? if [ $depl -eq "0" ] then # Capture fixe # Tant que le dossier existe incrémente la variable dir while [ -d /DATA/$ndir ]; do ndir=`expr $ndir + 1` done # Création du dossier mkdir /DATA/$ndir chown debian /DATA/$ndir else # Capture en mouvement while [ -d /DATA/$mvmnt_dir ]; do mvmnt_dir=`expr $mvmnt_dir + 1` done # Création du dossier mkdir /DATA/mvmnt$mvmnt_dir #chown debian /DATA/mvmnt$mvmnt_dir fi } # Fonction qui récupère l'heure et la date avec les trames GPS function heuredate () { while (( -z "$heure" || $i !=10 )) ; do # Requête GPS et extraction des trames type GPRMC gpspipe -r -n 10 |grep "GPRMC" > /tmp/gps.txt # Récupération de l’heure #heure=`gpspipe -r -n 10 |grep "GPRMC" |cut -d , -f2 |cut -d . -f1 |s$ heure=`cat /tmp/gps.txt |cut -d , -f2 |cut -d . -f1 |sed 's/../&:/g'`

Page 25: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

24 Les mots suivies de * sont définis dans le glossaire.

# Récupération de la date #jour=`gpspipe -r -n 10 |grep "GPRMC" |cut -d , -f10 |sed 's/../&:/g'` jour=`cat /tmp/gps.txt |cut -d , -f10 |sed 's/../&:/g'` # Incrémentation i=`expr $i + 1` # Temporisation sleep 1 done # Test si l’heure a été récupérée if [ $i -eq "10" ] then # Si non alors appel la fonction creationdir creationdir else # Si oui alors appel la fonction miseheuredate miseheuredate fi } # Fonction qui créer/met à jour le fichier .netrc # Ce fichier permet de se connecter directement au FTP function autologinftp () { netrc="/home/debian/.netrc" if [ -f $netrc ] then echo "$netrc existe" > /dev/null else echo "creation de $netrc" > /dev/null touch $netrc chmod 600 $netrc chown debian $netrc fi echo "machine $srvftp" > $netrc echo " login $loginftp" >> $netrc echo " password $passwordftp" >> $netrc } ######################################################################### ############################### DEBUT ################################### ######################################################################### # Regarde si il y a le Wi-fi if [ $wifi -eq "1" ] then # Tente de contacter le serveur ntp ping -c 5 $srvntp if [ $? -eq "0" ] then # En cas de réussite contacte le srv ntp ntpdate $srvntp new_dir=0 else # En cas d'echec appel la fonction creationdir creationdir fi else # Test si il y a un GPS if [ $gps -eq "1" ] then # Si oui alors # Démarrage de gpsd /usr/sbin/gpsd /dev/ttyS0 # Temporisation le temps du lancement de gpsd sleep 15

Page 26: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

25 Les mots suivies de * sont définis dans le glossaire.

# Test si le gps est bien branché gpspipe -r -n 3 |grep -q "activated" if [ $? -eq "0" ] then # Si le GPS est branché alors appel la fonction heuredate echo "GPS branché" heuredate else # Si le GPS est non branché alors appel la fonction creationdir echo "GPS non branché" creationdir fi # Selon le type de déplacement arrête ou non gpsd if [ $depl -eq "0" ] then #Arrêt de gpsd killall gpsd fi else # Si non alors appel la fonction creationdir creationdir fi fi # Test si il y a un ftp if [ $transfert = "ftp" ] then autologinftp fi # remplace les valeurs new_dir, dir et mvmnt_dir dans le fichier record.conf sed -i 's/new_dir=.*/new_dir='$new_dir'/' /usr/local/bin/record.conf sed -i 's/ndir=.*/ndir='$ndir'/' /usr/local/bin/record.conf sed -i 's/mvmnt_dir=.*/mvmnt_dir='$mvmnt_dir'/' /usr/local/bin/record.conf # Démarre le script record_global.sh nohup su - debian -c /usr/local/bin/record_global.sh >/dev/null 2>&1

Page 27: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

26 Les mots suivies de * sont définis dans le glossaire.

5. Script « record_global.sh »

Script :

#!/bin/bash source /usr/local/bin/record.conf echo "$current_rec" echo "Lancement de l'enregistrement des données WAV et/ou GPS" rm -f $current_rec # Test si la capture est faite en mouvement if [ $depl -eq "1" ] then # Si oui démarre l’acquisition GPS # Acquisition GPS echo "record_gps.sh lancé" nohup $bin_dir/record_gps.sh >/dev/null 2>&1 fi # Démarre l’acquisition WAV echo "record_wav.sh lancé" nohup $bin_dir/record_wavflacftp.sh >/dev/null 2>&1 if [ $lect -eq "1" ] then function lecture () { while [ -a $current_rec ] do play $current_rec sleep 1.5 done echo "relance de lecture" lecture } lecture fi

Page 28: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

27 Les mots suivies de * sont définis dans le glossaire.

6. Script « record_wavflacftp.sh »

Script :

#!/bin/bash ########################################################################## # Ce script permet de lancer l'enregistrement, la compression puis le transfert vers le FTP # ########################################################################## # Fichier de configuration source /usr/local/bin/record.conf # Fonction qui regarde si un nouveau dossier a été créé function fposition () { if [ $gps -eq "1" ] then # Si il y a un GPS récupère la position dans la dernière ligne de gps.txt position=`tail -1 $work_dir/gps.txt |cut -d , -f4` position=$position,`tail -1 $work_dir/gps.txt |cut -d , -f6` else position="nogps" fi } function dir () { if [ $new_dir -eq "1" ] then # Si un nouveau dossier a été créé -> change le dossier de destination work_dir=$work_dir/$ndir fi } # Fonction qui récupère la position GPS dans la dernière ligne de gps.txt function fpositionmvmnt () { position=`tail -1 $work_dir/mvmnt$mvmnt_dir/gps.txt |cut -d , -f4` position=$position,`tail -1 $work_dir/mvmnt$mvmnt_dir/gps.txt |cut -d , -f6` } # Fonction qui compresse le fichier qui vient d’être enregistré en .flac (--fast) function fflac () { flac --fast $work_dir/$prefix-$position-$name.wav rm $work_dir/$prefix-$position-$name.wav } # Fonction qui transfert le fichier compresser sur le serveur FTP # Ne pas mettre d’incrémentations ni retirer les sauts de ligne dans cette fonction cela cause des problèmes function transfert_wifi_ftp () { #HOST="srvftp" # Tente de contacter le serveur FTP ping $srvftp -c 5 if [ $? -eq "0" ] then if [ $new_dir -eq "1" ] then echo "new_dir=1" ftp -vi $srvftp << EOT prompt cd $dirftp mkdir $ndir cd $ndir lcd $work_dir mput *.flac !rm $work_dir/*.flac quit EOT else echo "ELSE" ftp -vi $srvftp << EOT prompt cd $dirftp lcd $work_dir mput *.flac

Page 29: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

28 Les mots suivies de * sont définis dans le glossaire.

!rm $work_dir/*.flac quit EOT fi fi } ######### # DEBUT # ######### # Appel de la fonction fposition fposition # Appel de la fonction dir dir # Test si la capture est faite en mouvement if [ $depl -eq "1" ] then # Si la capture est faite en mouvement alors while true;do # Récupere la date name=`date --rfc-3339=seconds | tr -d '-' | tr ' ' '_' | tr -d ':' | cut -c -15` # Appel la fonction fpositionmvmnt Fpositionmvmnt # Créer le fichier.wav dans le bon dossier touch $work_dir/mvmnt$mvmnt_dir/$prefix-$position-$name.wav ln -sf $work_dir/mvmnt$mvmnt_dir/$prefix-$position-$name.wav $current_rec echo "* enregistrement de $prefix-$position-$name.wav" # Enregistre le son grâce à la carte virtuelle multidodo qui contient les 4 micros sox -t alsa $micro -D -r $sample_rate -c $chan -b $sample_size $word_dir/mvmnt$mvmnt_dir/$prefix-$position-$name.wav trim 0 $rec_time sleep 2; rm -f $current_rec done else # Si la capture est fixe alors while true;do # Récupère la date name=`date --rfc-3339=seconds | tr -d '-' | tr ' ' '_' | tr -d ':' | cut -c -15` # Créer la fichier.wav dans le bon dossier touch $work_dir/$prefix-$position-$name.wav ln -sf $work_dir/$prefix-$position-$name.wav $current_rec #echo "* enregistrement de $work_dir/$prefix-$position-$name.wav" # Enregistre le son grâce à la carte virtuelle multidodo qui contient les 4 micro echo "* enregistrement de $work_dir/$prefix-$position-$name.wav" sox -t alsa $micro -D -r $sample_rate -c $chan -b $sample_size $work_dir/$prefix-$position-$name.wav trim 0 $rec_time # Tempo avant la compression sleep 2; # Appel de la fonction fflac qui compresse en flac --fast fflac # Tempo avant le transfert sleep 2; if [ $transfert = "ftp" ] then # Appel de la fonction qui fait le transfert vers le serveur FTP transfert_wifi_ftp fi #sleep 60; # rtcwake permet de plonger la carte dans un mode de basse consommation sudo rtcwake -m mem -s 60 rm -f $current_rec done fi

Page 30: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

29 Les mots suivies de * sont définis dans le glossaire.

7. Script « record_gps.sh »

Script :

#!/bin/bash source record.conf while true;do echo -n " >>>>>> " date +%H:%M:%S # gpspipe -w -n 5 2>/dev/null | grep "TPV" | tee -a $work_dir/gps_data_`date +%Y%m%d` # gpspipe -r -n 10 2>/dev/null | grep "GPRMC" | tee -a $work_dir/gps_data_`date +%Y%m%d` gpspipe -r -n 10 2>/dev/null |grep "GPRMC" >> $work_dir/mvmnt$mvmnt_dir/gps.txt sleep 30; done

Page 31: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

30 Les mots suivies de * sont définis dans le glossaire.

8. Test des différents codecs

573M janv. 1 2001 BEAGLE-18000.0000,00000.0000-20010101_003844.wav debian@arm:/DATA$ time flac BEAGLE-18000.0000,00000.0000-20010101_003844.wav BEAGLE-18000.0000,00000.0000-20010101_003844.wav: wrote 270620244 bytes, ratio=0,451 real 4m11.910s user 3m35.375s sys 0m10.352s 259M janv. 1 2001 BEAGLE-18000.0000,00000.0000-20010101_003844.flac debian@arm:/DATA$ time wavpack -b128 -c BEAGLE-18000.0000,00000.0000-20010101_003844.wav created BEAGLE-18000.0000,00000.0000-20010101_003844.wv (+.wvc) in 315.25 secs (lossless, 51.82%) real 5m15.287s user 4m12.273s sys 0m7.766s 81M janv. 1 00:15 BEAGLE-18000.0000,00000.0000-20010101_003844.wv 195M janv. 1 00:15 BEAGLE-18000.0000,00000.0000-20010101_003844.wvc debian@arm:/DATA$ time flac --fast -f BEAGLE-18000.0000,00000.0000-20010101_003844.wav BEAGLE-18000.0000,00000.0000-20010101_003844.wav: wrote 317905793 bytes, ratio=0,530 real 1m40.422s user 0m55.719s sys 0m10.867s debian@arm:/DATA$ time flac --best -f BEAGLE-18000.0000,00000.0000-20010101_003844.wav BEAGLE-18000.0000,00000.0000-20010101_003844.wav: wrote 265272229 bytes, ratio=0,442 real 8m42.375s user 8m0.586s sys 0m11.063s debian@arm:~/testcodec$ ls -lh total 1,7G -rw-r--r-- 1 debian debian 253M janv. 1 00:50 BEAGLE-18000.0000,00000.0000-20010101_003844_flacbest.flac -rw-r--r-- 1 debian debian 304M janv. 1 00:38 BEAGLE-18000.0000,00000.0000-20010101_003844_flacfast.flac -rw-r--r-- 1 debian debian 259M janv. 1 00:32 BEAGLE-18000.0000,00000.0000-20010101_003844_flacnormal.flac -rw-r--r-- 1 debian debian 573M janv. 1 00:28 BEAGLE-18000.0000,00000.0000-20010101_003844.wav -rw-r--r-- 1 debian debian 81M janv. 1 00:33 BEAGLE-18000.0000,00000.0000-20010101_003844.wv -rw-r--r-- 1 debian debian 195M janv. 1 00:33 BEAGLE-18000.0000,00000.0000-20010101_003844.wvc

Page 32: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

31 Les mots suivies de * sont définis dans le glossaire.

Fichier de base : 573Mo

Codec Taille du fichier Temps de

compression

Ratio

Fichier de base 573Mo / /

Flac sans option 259Mo 4m12s 0,451

Flac option best 253Mo 8m42 0,442

Flac option fast 304Mo 1m40 0,530

WavPack 276Mo (81Mo + 195Mo) 5M15 0,518

9. Test des différents moyens de transfert de fichier

Plusieurs protocoles de transfert de fichier ont été testés :

SSH grâce à la commande « scp »

FTP (File Transfert Protocol)

303M janv. 1 2001 BEAGLE-18000.0000,00000.0000-20010101_003844_flacfast.flac ################### SCP ################### scp [email protected]:/home/debian/testcodec/BEAGLE-18000.0000,00000.0000-20010101_003844_flacfast.flac /home/jules/ BEAGLE-18000.0000,00000.0000-20010101_00384 100% 303MB 6.2MB/s 00:49 ################### Utilisation CPU en % ################### debian@arm:~/testcodec$ top -b | awk '$12 == "scp" {print $9}' 7,1 7,2 7,6 7,6 7,6 7,6 7,9 7,6 7,6 7,2 7,9 7,2 7,6 7,6 7,6 7,6 ################### FTP ################### put /home/debian/testcodec/BEAGLE-18000.0000,00000.0000-20010101_003844_flacfast.flac BEAGLE-18000.0000,00000.0000-20010101_003844_flacfast.flac 317905793 bytes sent in 30.59 secs (10149.6 kB/s)

Page 33: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

32 Les mots suivies de * sont définis dans le glossaire.

################### Utilisation CPU en % ################### debian@arm:~$ top -b | awk '$12 == "ftp" {print $9}' 35,8 30,9 28,1 28,4 19,4 31,4 20,0 20,8 26,0 46,7 6,2

Récapitulatif :

Fichier de base : 303Mo

Protocole Débit Durée du transfert Utilisation CPU

SSH 6Mo/s 50s 7-8 %

FTP 10Mo/s 30s 20-40 %

Page 34: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

33 Les mots suivies de * sont définis dans le glossaire.

10. Schéma Réseau

11. Rtcwake

Rtcwake est une commande qui permet de mettre en veille le système jusqu’à une date de réveil

indiquée.

On voit dans le script « record_wavflacftp.sh »

sudo rtcwake –m mem –s 60

L’option –m sert à choisir le mode de veille. La valeur utilisée est :

mem :

Etat S3 de l’ACPI (veille). Cet état propose une économie significative puisque tout le système

est placé en état d’alimentation minimal, à l’exception de la mémoire qui est placée en mode

d’autorafraichissement pour conserver son contenu.

L’option –s sert à choisir le nombre de secondes avant le réveil.

12. Ntpdate

Ntpdate est une commande qui permet de mettre à jour le système via un serveur NTP.

On voit dans le script « beagle_init.sh »

ntpdate $srvntp

Afin que l’heure récupérée soit dans le bon fuseau horaire une manipulation est à faire :

Regarder si le fichier « /etc/localtime » est un lien symbolique et si oui à qui il est lié.

Si il n’existe pas le créer en tant que lien symbolique vers le fuseau horaire souhaité :

cd /etc && ln –s /usr/share/zoneinfo/<fuseauhoraire> localtime

Remplacer « fuseauhoraire » par votre choix.

Page 35: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

34 Les mots suivies de * sont définis dans le glossaire.

13. Création d’un serveur FTP

Installation

L’installation suivante est faite sur une debian 3.2.57-3

root@machine:~# apt-get install proftpd

Un choix se présente à nous on choisit : indépendamment

Configuration

root@machine:~# nano /etc/proftpd/protftpd.conf

Les éléments à changer sont :

useIPv6 off DefaultRoot /var/www/ Port 21

Une fois les changements effectués on redémarre protfpd

root@machine:~# /etc/init.d/proftpd restart

Connexion automatique

Dans le script « record_wavflacftp.sh » le fichier audio une fois compressé doit être envoyé vers le

serveur FTP. Afin que le script puisse se connecter automatiquement au serveur FTP le fichier

« .netrc » doit être créé à l’emplacement personnel de l’utilisateur « /home/user/ ».

La création de ce fichier est faite lors du script « beagle_init.sh »

# Fonction qui créer/met à jour le fichier .netrc # Ce fichier permet de se connecter directement au FTP function autologinftp () { netrc="/home/debian/.netrc" if [ -f $netrc ] then echo "$netrc existe" > /dev/null else echo "creation de $netrc" > /dev/null touch $netrc chmod 600 $netrc chown debian $netrc fi echo "machine $srvftp" > $netrc echo " login $loginftp" >> $netrc echo " password $passwordftp" >> $netrc }

Page 36: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

35 Les mots suivies de * sont définis dans le glossaire.

Le fichier .netrc doit avoir la syntaxe suivante :

root@machine:~# /etc/init.d/proftpd restart machine nomsrvftp login username password password

14. Sécurisation du serveur FTP

Afin d’améliorer la sécurité sur le serveur FTP plusieurs manipulations sont à faire :

a. SSH

On va tout d’abord modifier le fichier de configuration SSH :

root@machine:~# nano /etc/ssh/sshd_config

#On va désactiver le login en root. PermitRootLogin no

Au lieu d’utiliser le duo identifiant/motdepasse pour se connecter on va plutôt utiliser le duo clé

publique/clé privée :

Ces manipulations sont à faire sur le serveur et sur le poste qui pourra se connecter au serveur :

#On crée un repertoire .ssh dans notre HOME mkdir ~/.ssh #Ensuite on lui change ses droits d’accès chmod 0700 ~/.ssh

A faire uniquement sur le poste :

#On génère les clés publique et privée ssh-keygen -t dsa -f ~/.ssh/id_server

On a maintenant 2 fichiers dans .ssh :

id_server : clé privée

id_server.pub : clé publique qui ira sur le serveur

On transfère alors cette clé via scp vers le serveur :

user@machine:~$ scp ~/.ssh/id_server.pub user@serveur:~/.ssh/authorized_keys

Page 37: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

36 Les mots suivies de * sont définis dans le glossaire.

b. Fail2ban

Failt2ban lit les logs de divers serveurs (SSH, Apache, FTP…) à la recherche d’erreurs

d’authentification répétées et ajoute une règle iptables pour bannir l’adresse IP de la source.

Installation

root@machine:~# apt-get install fail2ban

root@machine:~# cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local

Il est préférable de copier le fichier « jail.conf » en « jail.local » et d'ensuite modifié ce dernier. Ce

fichier « jail.local » sera automatiquement lu lors de l’initialisation de fail2ban.

root@machine:~# nano /etc/fail2ban/jail.local

[DEFAULT] ignoreip = 127.0.0.1 findtime = 3600 bantime = 86400

[ssh] enabled = true port = ssh,sftp,”n°port” filter = sshd logpath = /var/log/auth.log maxretry = 6

En cas de modification du port ssh, il faut le rajouter car sinon il surveillera uniquement le port 22

On relance fail2ban

root@machine:~# fail2ban-client reload

On peut vérifier si les prisons sont présentent :

root@machine:~# fail2ban-client status

Page 38: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

37 Les mots suivies de * sont définis dans le glossaire.

15. Glossaire

MIMO : Multiple-Input Multiple-Output (« entrées multiples, sorties multiples ») est une technique

utilisée dans les réseaux sans fil et les réseaux mobiles permettant des transferts de données à plus

longue portée et à plus grande vitesse qu’avec des antennes utilisant la technique SISO (Single-Input

Single-Output)

PoE : Le Power over Ethernet (littéralement puissance par-dessus ethernet) (abrégé PoE, équivalent

de la norme IEEE 802.3af) permet de faire passer une tension de 48 V (jusqu'à 12 W de puissance

voire plus) en plus des données à 100 Mbit/s ou 1 Gbit/s. Cette technologie alloue deux paires (ou

plus) sur les quatre paires que contient un câble UTP ou STP afin d'alimenter certains appareils d'un

réseau ethernet tels que des téléphones IP, des disques durs réseaux, des imprimantes, des caméras

IP ou des points d'accès Wi-Fi.

SSH : Secure Shell est à la fois un programme informatique et un protocole de communication

sécurisé. Le protocole de connexion impose un échange de clés de chiffrement en début de

connexion. Par la suite, tous les segments TCP sont authentifiés et chiffrés.

FTP : File Transfert Protocol (protocole de transfert de fichiers) est un protocole de communication

destiné à l’échange informatique de fichier sur un réseau TCP/IP. Il permet, depuis un ordinateur de

copier des fichiers vers un autre ordinateur du réseau, ou encore de supprimer ou de modifier des

fichiers sur cet ordinateur.

NAS : Un serveur de stockage en réseau, également appelé stockage en réseau NAS, boîtier de

stockage en réseau ou plus simplement NAS (de l'anglais Network Attached Storage), est un serveur

de fichiers autonome, relié à un réseau dont la principale fonction est le stockage de données en un

volume centralisé pour des clients réseau hétérogènes.

Codec : Un codec est un dispositif capable de compresser et/ou de décompresser un signal

numérique. Ce dispositif peut être un circuit électronique, un circuit intégré ou un logiciel.

Bash : Bourne-Again Shell, est le shell du projet GNU.

Shell Unix : Un shell Unix est un interpréteur de commandes destiné aux systèmes d’exploitation

Unix et de type Unix qui permet d’accéder aux fonctionnalités internes du système d’exploitation. Il

se présente sous la forme d’une interface en ligne de commande accessible depuis la console ou un

terminal. L’utilisateur lance des commandes sous forme d’une entrée texte exécutée ensuite par le

shell.

NTP : Le protocole d’Heure Réseau (Network Time Protocol) est un protocole qui permet de

synchroniser, via un réseau informatique, l’horloge locale d’ordinateur sur une référence d’heure.

PCM : La modulation par impulsion et codage ou MIC, (en anglais Pulse Code Modulation,

généralement abrégé en PCM1) est une représentation numérique non compressée d'un signal

analogique via une technique d'échantillonnage. Cette technique est utilisée pour la voix en

télécommunications (RTC ou VoIP) et pour le son notamment dans les disques compacts audio, pour

l'enregistrement sur bandes DAT et Minidisc, les disques optiques à haute capacité (Blu-ray et HD

DVD), ainsi que pour les fichiers WAV, AIFF et BWF standards.

Page 39: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

38 Les mots suivies de * sont définis dans le glossaire.

16. Configuration des bornes Wi-Fi

Pour configurer les bornes Wi-Fi il faut se rendre sur leur interface web, pour cela il faut ouvrir un

navigateur et taper l’adresse de la borne. De base leur adresse IP est : 192.168.1.20

Afin que les bornes puissent communiquer ensemble il faut en configurer une en point d’accès et

l’autre en station.

Pour la borne en point d’accès :

On se connecte :

Par défaut : username : ubnt

password : ubnt

Page 40: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

39 Les mots suivies de * sont définis dans le glossaire.

Une fois connecté on se rend sur l’onglet « Wireless » :

Wireless Mode : c’est ici que l’on choisit « Access Point »

SSID : on renseigne le SSID que l’on veut

Ensuite on se rend sur l’onglet « Network »

Page 41: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

40 Les mots suivies de * sont définis dans le glossaire.

Ici il faut changer l’adresse IP de la borne afin que les deux bornes n’ai pas la même.

Enfin on se rend sur l’onglet « System »

« Device Name » nous permet de renommer la borne.

Maintenant il faut configurer l’autre borne en station.

On choisit le mode : « Station »

On remplit le SSID

On renseigne l’adresse MAC de la borne point d’accès

Page 42: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

41 Les mots suivies de * sont définis dans le glossaire.

17. Récupération automatique des fichiers

Afin que les fichiers remontent automatiquement depuis la carte vers le NAS situé dans le réseau de

l’université plusieurs commandes ont été mise en place.

Les fichiers sont donc envoyés de la carte vers le FTP grâce au script « record_wavflacftp.sh » :

function transfert_wifi_ftp () { #HOST="srvftp" # Tente de contacter le serveur FTP ping $srvftp -c 5 if [ $? -eq "0" ] then if [ $new_dir -eq "1" ] then echo "new_dir=1" ftp -vi $srvftp << EOT prompt cd $dirftp mkdir $ndir cd $ndir lcd $work_dir mput *.flac !rm $work_dir/*.flac quit EOT else echo "ELSE" ftp -vi $srvftp << EOT prompt cd $dirftp lcd $work_dir mput *.flac !rm $work_dir/*.flac quit EOT fi fi }

Puis le NAS vient prendre les fichiers du FTP grâce à une commande dans le crontab :

*/15 * * * * rsync -a -e ssh [email protected]:/var/www/ftpbeagle/AUDIO/ /NAS3/sabiod_dl/

*/15 signifie que la commande est exécutée toutes les 15 minutes

x.x.x.x : adresse IP du serveur FTP

Page 43: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

42 Les mots suivies de * sont définis dans le glossaire.

Et afin que le serveur FTP ne se remplisse pas une commande permettant de supprimer

tous les fichiers créés il y a plus de 60 minutes :

0 */1 * * * find -name *.flac -cmin +60 -exec rm {} \;

*/1 signifie que la commande sera exécutée toutes les heures

18. Découpage des fichiers audio

Les fichiers audio sont enregistrer sur quatre voies, afin que le logiciel puisse travailler sur ces

enregistrements il faut d’abord les séparer en deux fichiers de deux voies chacun.

Un script effectuera cette tache sur le serveur où seront stockés les fichiers :

#!/bin/bash for audioin in $(ls |grep -E "[0-9]{6}\.flac$") ;do echo "audioin = $audioin" audioout=$(echo "$audioin" |head -c -6) echo "audioout = $audioout" echo "Creation du fichier "$audioout"_chan1-2.flac" sox "$audioin" "$audioout"_chan1-2.flac remix 1 2 echo "Creation du fichier "$audioout"_chan3-4.flac" sox "$audioin" "$audioout"_chan3-4.flac remix 3 4 done

Page 44: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

43 Les mots suivies de * sont définis dans le glossaire.

19. Schéma branchement « disque dur externe »

Page 45: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

44 Les mots suivies de * sont définis dans le glossaire.

20. Schéma branchement « Wi-Fi »

Page 46: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

45 Les mots suivies de * sont définis dans le glossaire.

21. Sources

https://github.com/RobertCNelson

http://alsa.opensrc.org/MultipleCards#Multiple_devices

http://linux.die.net/man/5/netrc

http://korben.info/tuto-ssh-securiser.html

http://www.techinformatique.ca/tutoriels/configurer%20votre%20Nanostation%20M2.pdf

http://brunosmartins.info/xenomai-on-the-beaglebone-black-in-14-easy-steps/

http://elinux.org/BeagleBoard_Community

http://elinux.org/BeagleBoardDebian

http://beagleboard.org/Getting%20Startedhttp://beagleboard.org/Getting%20Started

http://alsa.opensrc.org/MultipleCards#Multiple_devices

http://tekeliblog.wordpress.com/2012/11/09/installing-xenomai-on-beagleboard-xm

https://rt.wiki.kernel.org/index.php/Main_Page

http://githowto.com

http://doc.ubuntu-fr.org/githttp://doc.ubuntu-fr.org/git

http://www.dodotronic.com/acoustic-devices/ultramics

http://doc.fedora-

fr.org/wiki/Mise_en_%C5%93uvre_de_Xenomai_pour_cr%C3%A9er_un_noyau_Temps_R

%C3%A9el_dur

http://www.blaess.fr/christophe/2012/08/27/xenomai-sur-raspberry-pi

http://www.blaess.fr/christophe/2012/10/12/toolchain-buildroot-pour-raspberry-pi

http://www.blaess.fr/christophe

http://www.lextronic.fr/P2645-module-gps-xbr-355-a-sortie-rs232.html

http://elinux.org/BeagleBoard_Community#OTG

http://beagleboard.org/Support/FAQ

https://groups.google.com/forum/#!topic/beagleboard/Mbaa5tsdfOk

http://elinux.org/Cip30x#OMAP_U-Boot_Utils

http://www.mjmwired.net/kernel/Documentation/power/states.txt

https://www.digitalocean.com/community/tutorials/how-to-protect-ssh-with-fail2ban-on-

ubuntu-12-04

Page 47: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

46 Les mots suivies de * sont définis dans le glossaire.

22. Licence GPL

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies

of this license document, but changing it is not allowed.

Preamble

The GNU General Public License is a free, copyleft license for

software and other kinds of works.

The licenses for most software and other practical works are designed

to take away your freedom to share and change the works. By contrast,

the GNU General Public License is intended to guarantee your freedom to

share and change all versions of a program--to make sure it remains free

software for all its users. We, the Free Software Foundation, use the

GNU General Public License for most of our software; it applies also to

any other work released this way by its authors. You can apply it to

your programs, too.

When we speak of free software, we are referring to freedom, not

price. Our General Public Licenses are designed to make sure that you

have the freedom to distribute copies of free software (and charge for

them if you wish), that you receive source code or can get it if you

want it, that you can change the software or use pieces of it in new

free programs, and that you know you can do these things.

To protect your rights, we need to prevent others from denying you

these rights or asking you to surrender the rights. Therefore, you have

certain responsibilities if you distribute copies of the software, or if

you modify it: responsibilities to respect the freedom of others.

For example, if you distribute copies of such a program, whether

gratis or for a fee, you must pass on to the recipients the same

freedoms that you received. You must make sure that they, too, receive

or can get the source code. And you must show them these terms so they

know their rights.

Developers that use the GNU GPL protect your rights with two steps:

(1) assert copyright on the software, and (2) offer you this License

giving you legal permission to copy, distribute and/or modify it.

For the developers' and authors' protection, the GPL clearly explains

that there is no warranty for this free software. For both users' and

authors' sake, the GPL requires that modified versions be marked as

changed, so that their problems will not be attributed erroneously to

authors of previous versions.

Some devices are designed to deny users access to install or run

modified versions of the software inside them, although the manufacturer

can do so. This is fundamentally incompatible with the aim of

protecting users' freedom to change the software. The systematic

pattern of such abuse occurs in the area of products for individuals to

use, which is precisely where it is most unacceptable. Therefore, we

have designed this version of the GPL to prohibit the practice for those

products. If such problems arise substantially in other domains, we

stand ready to extend this provision to those domains in future versions

of the GPL, as needed to protect the freedom of users.

Finally, every program is threatened constantly by software patents.

States should not allow patents to restrict development and use of

software on general-purpose computers, but in those that do, we wish to

avoid the special danger that patents applied to a free program could

make it effectively proprietary. To prevent this, the GPL assures that

patents cannot be used to render the program non-free.

The precise terms and conditions for copying, distribution and

modification follow.

TERMS AND CONDITIONS

0. Definitions.

Page 48: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

47 Les mots suivies de * sont définis dans le glossaire.

"This License" refers to version 3 of the GNU General Public License.

"Copyright" also means copyright-like laws that apply to other kinds of

works, such as semiconductor masks.

"The Program" refers to any copyrightable work licensed under this

License. Each licensee is addressed as "you". "Licensees" and

"recipients" may be individuals or organizations.

To "modify" a work means to copy from or adapt all or part of the work

in a fashion requiring copyright permission, other than the making of an

exact copy. The resulting work is called a "modified version" of the

earlier work or a work "based on" the earlier work.

A "covered work" means either the unmodified Program or a work based

on the Program.

To "propagate" a work means to do anything with it that, without

permission, would make you directly or secondarily liable for

infringement under applicable copyright law, except executing it on a

computer or modifying a private copy. Propagation includes copying,

distribution (with or without modification), making available to the

public, and in some countries other activities as well.

To "convey" a work means any kind of propagation that enables other

parties to make or receive copies. Mere interaction with a user through

a computer network, with no transfer of a copy, is not conveying.

An interactive user interface displays "Appropriate Legal Notices"

to the extent that it includes a convenient and prominently visible

feature that (1) displays an appropriate copyright notice, and (2)

tells the user that there is no warranty for the work (except to the

extent that warranties are provided), that licensees may convey the

work under this License, and how to view a copy of this License. If

the interface presents a list of user commands or options, such as a

menu, a prominent item in the list meets this criterion.

1. Source Code.

The "source code" for a work means the preferred form of the work

for making modifications to it. "Object code" means any non-source

form of a work.

A "Standard Interface" means an interface that either is an official

standard defined by a recognized standards body, or, in the case of

interfaces specified for a particular programming language, one that

is widely used among developers working in that language.

The "System Libraries" of an executable work include anything, other

than the work as a whole, that (a) is included in the normal form of

packaging a Major Component, but which is not part of that Major

Component, and (b) serves only to enable use of the work with that

Major Component, or to implement a Standard Interface for which an

implementation is available to the public in source code form. A

"Major Component", in this context, means a major essential component

(kernel, window system, and so on) of the specific operating system

(if any) on which the executable work runs, or a compiler used to

produce the work, or an object code interpreter used to run it.

The "Corresponding Source" for a work in object code form means all

the source code needed to generate, install, and (for an executable

work) run the object code and to modify the work, including scripts to

control those activities. However, it does not include the work's

System Libraries, or general-purpose tools or generally available free

programs which are used unmodified in performing those activities but

which are not part of the work. For example, Corresponding Source

includes interface definition files associated with source files for

the work, and the source code for shared libraries and dynamically

linked subprograms that the work is specifically designed to require,

such as by intimate data communication or control flow between those

subprograms and other parts of the work.

The Corresponding Source need not include anything that users

can regenerate automatically from other parts of the Corresponding

Source.

The Corresponding Source for a work in source code form is that

Page 49: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

48 Les mots suivies de * sont définis dans le glossaire.

same work.

2. Basic Permissions.

All rights granted under this License are granted for the term of

copyright on the Program, and are irrevocable provided the stated

conditions are met. This License explicitly affirms your unlimited

permission to run the unmodified Program. The output from running a

covered work is covered by this License only if the output, given its

content, constitutes a covered work. This License acknowledges your

rights of fair use or other equivalent, as provided by copyright law.

You may make, run and propagate covered works that you do not

convey, without conditions so long as your license otherwise remains

in force. You may convey covered works to others for the sole purpose

of having them make modifications exclusively for you, or provide you

with facilities for running those works, provided that you comply with

the terms of this License in conveying all material for which you do

not control copyright. Those thus making or running the covered works

for you must do so exclusively on your behalf, under your direction

and control, on terms that prohibit them from making any copies of

your copyrighted material outside their relationship with you.

Conveying under any other circumstances is permitted solely under

the conditions stated below. Sublicensing is not allowed; section 10

makes it unnecessary.

3. Protecting Users' Legal Rights From Anti-Circumvention Law.

No covered work shall be deemed part of an effective technological

measure under any applicable law fulfilling obligations under article

11 of the WIPO copyright treaty adopted on 20 December 1996, or

similar laws prohibiting or restricting circumvention of such

measures.

When you convey a covered work, you waive any legal power to forbid

circumvention of technological measures to the extent such circumvention

is effected by exercising rights under this License with respect to

the covered work, and you disclaim any intention to limit operation or

modification of the work as a means of enforcing, against the work's

users, your or third parties' legal rights to forbid circumvention of

technological measures.

4. Conveying Verbatim Copies.

You may convey verbatim copies of the Program's source code as you

receive it, in any medium, provided that you conspicuously and

appropriately publish on each copy an appropriate copyright notice;

keep intact all notices stating that this License and any

non-permissive terms added in accord with section 7 apply to the code;

keep intact all notices of the absence of any warranty; and give all

recipients a copy of this License along with the Program.

You may charge any price or no price for each copy that you convey,

and you may offer support or warranty protection for a fee.

5. Conveying Modified Source Versions.

You may convey a work based on the Program, or the modifications to

produce it from the Program, in the form of source code under the

terms of section 4, provided that you also meet all of these conditions:

a) The work must carry prominent notices stating that you modified

it, and giving a relevant date.

b) The work must carry prominent notices stating that it is

released under this License and any conditions added under section

7. This requirement modifies the requirement in section 4 to

"keep intact all notices".

c) You must license the entire work, as a whole, under this

License to anyone who comes into possession of a copy. This

License will therefore apply, along with any applicable section 7

additional terms, to the whole of the work, and all its parts,

regardless of how they are packaged. This License gives no

permission to license the work in any other way, but it does not

invalidate such permission if you have separately received it.

Page 50: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

49 Les mots suivies de * sont définis dans le glossaire.

d) If the work has interactive user interfaces, each must display

Appropriate Legal Notices; however, if the Program has interactive

interfaces that do not display Appropriate Legal Notices, your

work need not make them do so.

A compilation of a covered work with other separate and independent

works, which are not by their nature extensions of the covered work,

and which are not combined with it such as to form a larger program,

in or on a volume of a storage or distribution medium, is called an

"aggregate" if the compilation and its resulting copyright are not

used to limit the access or legal rights of the compilation's users

beyond what the individual works permit. Inclusion of a covered work

in an aggregate does not cause this License to apply to the other

parts of the aggregate.

6. Conveying Non-Source Forms.

You may convey a covered work in object code form under the terms

of sections 4 and 5, provided that you also convey the

machine-readable Corresponding Source under the terms of this License,

in one of these ways:

a) Convey the object code in, or embodied in, a physical product

(including a physical distribution medium), accompanied by the

Corresponding Source fixed on a durable physical medium

customarily used for software interchange.

b) Convey the object code in, or embodied in, a physical product

(including a physical distribution medium), accompanied by a

written offer, valid for at least three years and valid for as

long as you offer spare parts or customer support for that product

model, to give anyone who possesses the object code either (1) a

copy of the Corresponding Source for all the software in the

product that is covered by this License, on a durable physical

medium customarily used for software interchange, for a price no

more than your reasonable cost of physically performing this

conveying of source, or (2) access to copy the

Corresponding Source from a network server at no charge.

c) Convey individual copies of the object code with a copy of the

written offer to provide the Corresponding Source. This

alternative is allowed only occasionally and noncommercially, and

only if you received the object code with such an offer, in accord

with subsection 6b.

d) Convey the object code by offering access from a designated

place (gratis or for a charge), and offer equivalent access to the

Corresponding Source in the same way through the same place at no

further charge. You need not require recipients to copy the

Corresponding Source along with the object code. If the place to

copy the object code is a network server, the Corresponding Source

may be on a different server (operated by you or a third party)

that supports equivalent copying facilities, provided you maintain

clear directions next to the object code saying where to find the

Corresponding Source. Regardless of what server hosts the

Corresponding Source, you remain obligated to ensure that it is

available for as long as needed to satisfy these requirements.

e) Convey the object code using peer-to-peer transmission, provided

you inform other peers where the object code and Corresponding

Source of the work are being offered to the general public at no

charge under subsection 6d.

A separable portion of the object code, whose source code is excluded

from the Corresponding Source as a System Library, need not be

included in conveying the object code work.

A "User Product" is either (1) a "consumer product", which means any

tangible personal property which is normally used for personal, family,

or household purposes, or (2) anything designed or sold for incorporation

into a dwelling. In determining whether a product is a consumer product,

doubtful cases shall be resolved in favor of coverage. For a particular

product received by a particular user, "normally used" refers to a

typical or common use of that class of product, regardless of the status

of the particular user or of the way in which the particular user

actually uses, or expects or is expected to use, the product. A product

Page 51: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

50 Les mots suivies de * sont définis dans le glossaire.

is a consumer product regardless of whether the product has substantial

commercial, industrial or non-consumer uses, unless such uses represent

the only significant mode of use of the product.

"Installation Information" for a User Product means any methods,

procedures, authorization keys, or other information required to install

and execute modified versions of a covered work in that User Product from

a modified version of its Corresponding Source. The information must

suffice to ensure that the continued functioning of the modified object

code is in no case prevented or interfered with solely because

modification has been made.

If you convey an object code work under this section in, or with, or

specifically for use in, a User Product, and the conveying occurs as

part of a transaction in which the right of possession and use of the

User Product is transferred to the recipient in perpetuity or for a

fixed term (regardless of how the transaction is characterized), the

Corresponding Source conveyed under this section must be accompanied

by the Installation Information. But this requirement does not apply

if neither you nor any third party retains the ability to install

modified object code on the User Product (for example, the work has

been installed in ROM).

The requirement to provide Installation Information does not include a

requirement to continue to provide support service, warranty, or updates

for a work that has been modified or installed by the recipient, or for

the User Product in which it has been modified or installed. Access to a

network may be denied when the modification itself materially and

adversely affects the operation of the network or violates the rules and

protocols for communication across the network.

Corresponding Source conveyed, and Installation Information provided,

in accord with this section must be in a format that is publicly

documented (and with an implementation available to the public in

source code form), and must require no special password or key for

unpacking, reading or copying.

7. Additional Terms.

"Additional permissions" are terms that supplement the terms of this

License by making exceptions from one or more of its conditions.

Additional permissions that are applicable to the entire Program shall

be treated as though they were included in this License, to the extent

that they are valid under applicable law. If additional permissions

apply only to part of the Program, that part may be used separately

under those permissions, but the entire Program remains governed by

this License without regard to the additional permissions.

When you convey a copy of a covered work, you may at your option

remove any additional permissions from that copy, or from any part of

it. (Additional permissions may be written to require their own

removal in certain cases when you modify the work.) You may place

additional permissions on material, added by you to a covered work,

for which you have or can give appropriate copyright permission.

Notwithstanding any other provision of this License, for material you

add to a covered work, you may (if authorized by the copyright holders of

that material) supplement the terms of this License with terms:

a) Disclaiming warranty or limiting liability differently from the

terms of sections 15 and 16 of this License; or

b) Requiring preservation of specified reasonable legal notices or

author attributions in that material or in the Appropriate Legal

Notices displayed by works containing it; or

c) Prohibiting misrepresentation of the origin of that material, or

requiring that modified versions of such material be marked in

reasonable ways as different from the original version; or

d) Limiting the use for publicity purposes of names of licensors or

authors of the material; or

e) Declining to grant rights under trademark law for use of some

trade names, trademarks, or service marks; or

f) Requiring indemnification of licensors and authors of that

Page 52: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

51 Les mots suivies de * sont définis dans le glossaire.

material by anyone who conveys the material (or modified versions of

it) with contractual assumptions of liability to the recipient, for

any liability that these contractual assumptions directly impose on

those licensors and authors.

All other non-permissive additional terms are considered "further

restrictions" within the meaning of section 10. If the Program as you

received it, or any part of it, contains a notice stating that it is

governed by this License along with a term that is a further

restriction, you may remove that term. If a license document contains

a further restriction but permits relicensing or conveying under this

License, you may add to a covered work material governed by the terms

of that license document, provided that the further restriction does

not survive such relicensing or conveying.

If you add terms to a covered work in accord with this section, you

must place, in the relevant source files, a statement of the

additional terms that apply to those files, or a notice indicating

where to find the applicable terms.

Additional terms, permissive or non-permissive, may be stated in the

form of a separately written license, or stated as exceptions;

the above requirements apply either way.

8. Termination.

You may not propagate or modify a covered work except as expressly

provided under this License. Any attempt otherwise to propagate or

modify it is void, and will automatically terminate your rights under

this License (including any patent licenses granted under the third

paragraph of section 11).

However, if you cease all violation of this License, then your

license from a particular copyright holder is reinstated (a)

provisionally, unless and until the copyright holder explicitly and

finally terminates your license, and (b) permanently, if the copyright

holder fails to notify you of the violation by some reasonable means

prior to 60 days after the cessation.

Moreover, your license from a particular copyright holder is

reinstated permanently if the copyright holder notifies you of the

violation by some reasonable means, this is the first time you have

received notice of violation of this License (for any work) from that

copyright holder, and you cure the violation prior to 30 days after

your receipt of the notice.

Termination of your rights under this section does not terminate the

licenses of parties who have received copies or rights from you under

this License. If your rights have been terminated and not permanently

reinstated, you do not qualify to receive new licenses for the same

material under section 10.

9. Acceptance Not Required for Having Copies.

You are not required to accept this License in order to receive or

run a copy of the Program. Ancillary propagation of a covered work

occurring solely as a consequence of using peer-to-peer transmission

to receive a copy likewise does not require acceptance. However,

nothing other than this License grants you permission to propagate or

modify any covered work. These actions infringe copyright if you do

not accept this License. Therefore, by modifying or propagating a

covered work, you indicate your acceptance of this License to do so.

10. Automatic Licensing of Downstream Recipients.

Each time you convey a covered work, the recipient automatically

receives a license from the original licensors, to run, modify and

propagate that work, subject to this License. You are not responsible

for enforcing compliance by third parties with this License.

An "entity transaction" is a transaction transferring control of an

organization, or substantially all assets of one, or subdividing an

organization, or merging organizations. If propagation of a covered

work results from an entity transaction, each party to that

transaction who receives a copy of the work also receives whatever

licenses to the work the party's predecessor in interest had or could

give under the previous paragraph, plus a right to possession of the

Page 53: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

52 Les mots suivies de * sont définis dans le glossaire.

Corresponding Source of the work from the predecessor in interest, if

the predecessor has it or can get it with reasonable efforts.

You may not impose any further restrictions on the exercise of the

rights granted or affirmed under this License. For example, you may

not impose a license fee, royalty, or other charge for exercise of

rights granted under this License, and you may not initiate litigation

(including a cross-claim or counterclaim in a lawsuit) alleging that

any patent claim is infringed by making, using, selling, offering for

sale, or importing the Program or any portion of it.

11. Patents.

A "contributor" is a copyright holder who authorizes use under this

License of the Program or a work on which the Program is based. The

work thus licensed is called the contributor's "contributor version".

A contributor's "essential patent claims" are all patent claims

owned or controlled by the contributor, whether already acquired or

hereafter acquired, that would be infringed by some manner, permitted

by this License, of making, using, or selling its contributor version,

but do not include claims that would be infringed only as a

consequence of further modification of the contributor version. For

purposes of this definition, "control" includes the right to grant

patent sublicenses in a manner consistent with the requirements of

this License.

Each contributor grants you a non-exclusive, worldwide, royalty-free

patent license under the contributor's essential patent claims, to

make, use, sell, offer for sale, import and otherwise run, modify and

propagate the contents of its contributor version.

In the following three paragraphs, a "patent license" is any express

agreement or commitment, however denominated, not to enforce a patent

(such as an express permission to practice a patent or covenant not to

sue for patent infringement). To "grant" such a patent license to a

party means to make such an agreement or commitment not to enforce a

patent against the party.

If you convey a covered work, knowingly relying on a patent license,

and the Corresponding Source of the work is not available for anyone

to copy, free of charge and under the terms of this License, through a

publicly available network server or other readily accessible means,

then you must either (1) cause the Corresponding Source to be so

available, or (2) arrange to deprive yourself of the benefit of the

patent license for this particular work, or (3) arrange, in a manner

consistent with the requirements of this License, to extend the patent

license to downstream recipients. "Knowingly relying" means you have

actual knowledge that, but for the patent license, your conveying the

covered work in a country, or your recipient's use of the covered work

in a country, would infringe one or more identifiable patents in that

country that you have reason to believe are valid.

If, pursuant to or in connection with a single transaction or

arrangement, you convey, or propagate by procuring conveyance of, a

covered work, and grant a patent license to some of the parties

receiving the covered work authorizing them to use, propagate, modify

or convey a specific copy of the covered work, then the patent license

you grant is automatically extended to all recipients of the covered

work and works based on it.

A patent license is "discriminatory" if it does not include within

the scope of its coverage, prohibits the exercise of, or is

conditioned on the non-exercise of one or more of the rights that are

specifically granted under this License. You may not convey a covered

work if you are a party to an arrangement with a third party that is

in the business of distributing software, under which you make payment

to the third party based on the extent of your activity of conveying

the work, and under which the third party grants, to any of the

parties who would receive the covered work from you, a discriminatory

patent license (a) in connection with copies of the covered work

conveyed by you (or copies made from those copies), or (b) primarily

for and in connection with specific products or compilations that

contain the covered work, unless you entered into that arrangement,

or that patent license was granted, prior to 28 March 2007.

Nothing in this License shall be construed as excluding or limiting

Page 54: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

53 Les mots suivies de * sont définis dans le glossaire.

any implied license or other defenses to infringement that may

otherwise be available to you under applicable patent law.

12. No Surrender of Others' Freedom.

If conditions are imposed on you (whether by court order, agreement or

otherwise) that contradict the conditions of this License, they do not

excuse you from the conditions of this License. If you cannot convey a

covered work so as to satisfy simultaneously your obligations under this

License and any other pertinent obligations, then as a consequence you may

not convey it at all. For example, if you agree to terms that obligate you

to collect a royalty for further conveying from those to whom you convey

the Program, the only way you could satisfy both those terms and this

License would be to refrain entirely from conveying the Program.

13. Use with the GNU Affero General Public License.

Notwithstanding any other provision of this License, you have

permission to link or combine any covered work with a work licensed

under version 3 of the GNU Affero General Public License into a single

combined work, and to convey the resulting work. The terms of this

License will continue to apply to the part which is the covered work,

but the special requirements of the GNU Affero General Public License,

section 13, concerning interaction through a network will apply to the

combination as such.

14. Revised Versions of this License.

The Free Software Foundation may publish revised and/or new versions of

the GNU General Public License from time to time. Such new versions will

be similar in spirit to the present version, but may differ in detail to

address new problems or concerns.

Each version is given a distinguishing version number. If the

Program specifies that a certain numbered version of the GNU General

Public License "or any later version" applies to it, you have the

option of following the terms and conditions either of that numbered

version or of any later version published by the Free Software

Foundation. If the Program does not specify a version number of the

GNU General Public License, you may choose any version ever published

by the Free Software Foundation.

If the Program specifies that a proxy can decide which future

versions of the GNU General Public License can be used, that proxy's

public statement of acceptance of a version permanently authorizes you

to choose that version for the Program.

Later license versions may give you additional or different

permissions. However, no additional obligations are imposed on any

author or copyright holder as a result of your choosing to follow a

later version.

15. Disclaimer of Warranty.

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY

APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT

HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY

OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,

THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR

PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM

IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF

ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

16. Limitation of Liability.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING

WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS

THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY

GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE

USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF

DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD

PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),

EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF

SUCH DAMAGES.

17. Interpretation of Sections 15 and 16.

Page 55: AMR UltraSonoc 4x Wifi Recorder Implemented on BeagleBoard & …sabiod.univ-tln.fr/documents/Recording_sol-Descude.pdf · 2014-12-01 · Besoin du laboratoire ..... 4 II. Licence

54 Les mots suivies de * sont définis dans le glossaire.

If the disclaimer of warranty and limitation of liability provided

above cannot be given local legal effect according to their terms,

reviewing courts shall apply local law that most closely approximates

an absolute waiver of all civil liability in connection with the

Program, unless a warranty or assumption of liability accompanies a

copy of the Program in return for a fee.

END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest

possible use to the public, the best way to achieve this is to make it

free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest

to attach them to the start of each source file to most effectively

state the exclusion of warranty; and each file should have at least

the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>

Copyright (C) <year> <name of author>

This program is free software: you can redistribute it and/or modify

it under the terms of the GNU General Public License as published by

the Free Software Foundation, either version 3 of the License, or

(at your option) any later version.

This program is distributed in the hope that it will be useful,

but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

GNU General Public License for more details.

You should have received a copy of the GNU General Public License

along with this program. If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

If the program does terminal interaction, make it output a short

notice like this when it starts in an interactive mode:

<program> Copyright (C) <year> <name of author>

This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.

This is free software, and you are welcome to redistribute it

under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate

parts of the General Public License. Of course, your program's commands

might be different; for a GUI interface, you would use an "about box".

You should also get your employer (if you work as a programmer) or school,

if any, to sign a "copyright disclaimer" for the program, if necessary.

For more information on this, and how to apply and follow the GNU GPL, see

<http://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program

into proprietary programs. If your program is a subroutine library, you

may consider it more useful to permit linking proprietary applications with

the library. If this is what you want to do, use the GNU Lesser General

Public License instead of this License. But first, please read

<http://www.gnu.org/philosophy/why-not-lgpl.html>.