diff --git a/README.md b/README.md index 42b4187..c0532ae 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,8 @@ The goal of this repository is to provide a: - Main components of the odr-mmbTools suite used in a transmission chain - [Supervisor](http://supervisord.org/) package - Simple yet functional dab configuration sample that you can adapt to your needs -- Vagrantfile that allows you to quickly setup a lite debian bullseye virtual environment over which to test ODR-mmbTools +- Vagrantfile that allows you to quickly run a DAB/DAB+ ensemble through a lite debian bullseye virtual environment +- Docker files that allow you to quickly run a DAB/DAB+ ensemble through containers # ODR-mmbTools components - Encoder-manager: provides a web interface to manage audio streams and their related PAD data @@ -22,6 +23,8 @@ The goal of this repository is to provide a: - Modulator: creates a modulation with the multiplexer data and sends it to a transmitter # Repository structure +## install +This folder contains the installation/removal shell script. Please check the **README.md** file inside this directory to run the installation shell script ## config This folder contains the sample configuration files. If you use the provided installation script, it will be copied on your system: - config/odr-dabmod.ini: ODR-DabMod configuration @@ -29,10 +32,10 @@ This folder contains the sample configuration files. If you use the provided ins - config/supervisor/ODR-encoders.conf: supervisor configuration file for all encoders (audio + PAD) - config/supervisor/ODR-encoders.conf: supervisor configuration file for all other odr-mmbTools excluding the encoders - config/mot/: folder with the dls and slide files -## install -This folder contains the installation/removal shell script. Please check the **README.md** file inside this directory to run the installation shell script +## docker +This folder contains Docker-related files. Please check the **README.md** file inside this directory to setup and run a DAB/DAB+ ensemble through docker. ## vagrant -This folder contains Vagrant-related files. Please check the **README.md** file inside this directory to setup and run a Vagrant box. +This folder contains Vagrant-related files. Please check the **README.md** file inside this directory to setup and run a DAB/DAB+ ensemble though a Vagrant box. # Operations In this section: diff --git a/config/supervisor/ODR-encoders.conf b/config/supervisor/ODR-encoders.conf index 362a41b..ee97392 100644 --- a/config/supervisor/ODR-encoders.conf +++ b/config/supervisor/ODR-encoders.conf @@ -1,6 +1,6 @@ # P01 [program:odr-padencoder-defee58a-f768-4ca9-a0f7-88f08b2e8748] -command=/usr/local/bin/odr-padenc +command=odr-padenc --dir=/home/pi/config/mot/P01/slide --sleep=0 --dls=/home/pi/config/mot/P01/INFO.dls @@ -17,7 +17,7 @@ stdout_logfile=/var/log/supervisor/odr-padencoder-defee58a-f768-4ca9-a0f7-88f08b # P01 [program:odr-audioencoder-defee58a-f768-4ca9-a0f7-88f08b2e8748] -command=/usr/local/bin/odr-audioenc +command=odr-audioenc --vlc-uri=http://radiomonaco.ice.infomaniak.ch/radiomonaco-128.mp3 --drift-comp --silence=60 @@ -28,7 +28,7 @@ command=/usr/local/bin/odr-audioenc --pad=34 --pad-socket=defee58a-f768-4ca9-a0f7-88f08b2e8748 --write-icy-text=/home/pi/config/mot/P01/INFO.dls - -e tcp://127.0.0.1:9001 + --edi tcp://127.0.0.1:9001 --stats=/var/tmp/P01.stats autostart=false autorestart=false @@ -40,7 +40,7 @@ stdout_logfile=/var/log/supervisor/odr-audioencoder-defee58a-f768-4ca9-a0f7-88f0 # P02 [program:odr-padencoder-7158c498-1ef1-4580-b385-23a3c06ba985] -command=/usr/local/bin/odr-padenc +command=odr-padenc --dir=/home/pi/config/mot/P02/slide --sleep=0 --dls=/home/pi/config/mot/P02/INFO.dls @@ -57,7 +57,7 @@ stdout_logfile=/var/log/supervisor/odr-padencoder-7158c498-1ef1-4580-b385-23a3c0 # P02 [program:odr-audioencoder-7158c498-1ef1-4580-b385-23a3c06ba985] -command=/usr/local/bin/odr-audioenc +command=odr-audioenc --vlc-uri=http://media-ice.musicradio.com/CapitalMP3 --drift-comp --silence=60 @@ -68,7 +68,7 @@ command=/usr/local/bin/odr-audioenc --pad=34 --pad-socket=7158c498-1ef1-4580-b385-23a3c06ba985 --write-icy-text=/home/pi/config/mot/P02/INFO.dls - -e tcp://127.0.0.1:9002 + --edi tcp://127.0.0.1:9002 --stats=/var/tmp/P02.stats autostart=false autorestart=false diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..73bbbf4 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,42 @@ +# Introduction +[Docker](https://www.docker.com) packages software into standardized units for development, shipment and deployment. + +This folder brings you the files needed to run the encoders (audio and PAD), the multiplexer and the modulator through containers. 3 docker images are available from the [docker registry](https://hub.docker.com). They can be ran on amd64, arm64 and arm/v7 architectures: +- [opendigitalradio/encoders](https://hub.docker.com/r/opendigitalradio/encoders) +- [opendigitalradio/dabmux](https://hub.docker.com/r/opendigitalradio/dabmux) +- [opendigitalradio/dabmod](https://hub.docker.com/r/opendigitalradio/dabmod) + +# One-time setup +1. Install Docker on the host that will run the containers +1. Clone this repository or copy the dab-scripts/docker directory on the host +1. Adapt file `config/odr-dabmod.ini` to match your transceiver hardware and local RF spectrum +1. Adapt file `odr.env` to suit your configuration. Then run the following command: + ``` + source odr.env + ``` + +# Customized setup (changing the sample configuration) +1. Adapt file `config/ODR-encoders.conf` to suit your needs +1. Adapt file `config/odr-dabmux.info` to match the content of file `config/ODR-encoders.conf` +1. Adapt the structure of directory `config/mot` to match the content of file `config/ODR-encoders.conf` + +# Operations +1. Create a docker volume, named `odr` with the configuration files: + ``` + docker run \ + --interactive \ + --tty \ + --rm \ + --volume $(pwd)/config:/mnt/source \ + --volume odr:/mnt/dest \ + ubuntu:22.04 \ + bash -c "cd /mnt/source ; cp -R * /mnt/dest" + ``` +1. Start broadcasting the DAB/DAB+ ensemble (3 containers, named `odr-encoders`, `odr-dabmux` and `odr-dabmod`) + ``` + docker compose up --detach + ``` +1. Stop broadcasting the DAB/DAB+ ensemble + ``` + docker compose down + ``` diff --git a/docker/compose.yaml b/docker/compose.yaml new file mode 100644 index 0000000..f25dc68 --- /dev/null +++ b/docker/compose.yaml @@ -0,0 +1,50 @@ +services: + + encoders: + image: opendigitalradio/encoders + container_name: odr-encoders + depends_on: + - multiplexer + environment: + - TZ=${TZ} + ports: + - "8001:8001" + volumes: + - "odr:/config" + command: /config + + multiplexer: + image: opendigitalradio/dabmux + container_name: odr-dabmux + environment: + - TZ=${TZ} + ports: + - "9001-9016:9001-9016" + - "9201:9201" + - "12720-12722:12720-12722" + volumes: + - "odr:/config" + command: /config/odr-dabmux.info + + modulator: + image: opendigitalradio/dabmod + container_name: odr-dabmod + depends_on: + - multiplexer + environment: + - TZ=${TZ} + ports: + - "9400:9400" + volumes: + - "odr:/config" + devices: + - "${MOD_DEV}" + command: /config/odr-dabmod.ini + +networks: + odr: + external: true + +volumes: + odr: + external: true \ No newline at end of file diff --git a/docker/config/mot/P01/INFO.dls b/docker/config/mot/P01/INFO.dls new file mode 100755 index 0000000..e69de29 diff --git a/docker/config/mot/P01/slide/P01-logo.jpg b/docker/config/mot/P01/slide/P01-logo.jpg new file mode 100644 index 0000000..50bb69f Binary files /dev/null and b/docker/config/mot/P01/slide/P01-logo.jpg differ diff --git a/docker/config/mot/P02/INFO.dls b/docker/config/mot/P02/INFO.dls new file mode 100755 index 0000000..e69de29 diff --git a/docker/config/mot/P02/slide/P02-logo.jpg b/docker/config/mot/P02/slide/P02-logo.jpg new file mode 100644 index 0000000..cb40994 Binary files /dev/null and b/docker/config/mot/P02/slide/P02-logo.jpg differ diff --git a/docker/config/odr-dabmod.ini b/docker/config/odr-dabmod.ini new file mode 100644 index 0000000..8fcdafd --- /dev/null +++ b/docker/config/odr-dabmod.ini @@ -0,0 +1,41 @@ +[remotecontrol] +telnet=0 +telnetport=2121 +zmqctrl=0 +zmqctrlendpoint=tcp://0.0.0.0:9400 + +[log] +syslog=0 +filelog=0 +filename=odr-dabmod.log + +[input] +transport=edi +source=tcp://odr-dabmux:9201 + +[modulator] +gainmode=var +digital_gain=0.8 +rate=4096000 + +[cfr] +enable=0 +clip=50.0 +error_clip=0.1 + +[firfilter] +enabled=1 + +[poly] +enabled=0 +polycoeffile=polyCoefs + +[output] +output=soapysdr + +[soapyoutput] +device=driver=hackrf +master_clock_rate=32768000 +txgain=23 +channel=5A +bandwidth=1750000 diff --git a/docker/config/odr-dabmux.info b/docker/config/odr-dabmux.info new file mode 100644 index 0000000..447c058 --- /dev/null +++ b/docker/config/odr-dabmux.info @@ -0,0 +1,99 @@ +general { + dabmode 1 + nbframes 0 + syslog false + tist false + managementport 12720 +} + +remotecontrol { + telnetport 12721 + zmqendpoint tcp://lo:12722 +} + +ensemble { + id 0x4fff + ecc 0xe1 + local-time-offset auto + international-table 1 + reconfig-counter hash + label "Micro DAB" + shortlabel "M DAB" +} + +services { + srv-01 { + id 0xb1c7 + ecc 0xe2 + label "RADIO MONACO" + shortlabel "MONACO" + pty 10 + pty-sd static + language 0x0f + } + srv-02 { + id 0xc479 + ecc 0xe1 + label "CAPITAL LONDON" + shortlabel "CAPITAL" + pty 10 + pty-sd static + language 0x09 + } +} + +subchannels { + sub-01 { + type dabplus + bitrate 128 + id 1 + protection 3 + inputproto edi + inputuri "tcp://0.0.0.0:9001" + buffer-management prebuffering + buffer 40 + prebuffering 20 + } + sub-02 { + type dabplus + bitrate 128 + id 2 + protection 3 + inputproto edi + inputuri "tcp://0.0.0.0:9002" + buffer-management prebuffering + buffer 40 + prebuffering 20 + } +} + +components { + comp-01 { + service srv-01 + subchannel sub-01 + user-applications { + userapp "slideshow" + } + } + comp-02 { + service srv-02 + subchannel sub-02 + user-applications { + userapp "slideshow" + } + } +} + +outputs { + edi { + destinations { + edi_tcp { + protocol tcp + listenport 9201 + } + } + } + + ; Throttle output to real-time (one ETI frame every 24ms) + throttle "simul://" +} diff --git a/docker/config/supervisor/ODR-encoders.conf b/docker/config/supervisor/ODR-encoders.conf new file mode 100644 index 0000000..eb2f9fb --- /dev/null +++ b/docker/config/supervisor/ODR-encoders.conf @@ -0,0 +1,79 @@ +# P01 +[program:P01-padencoder] +command=odr-padenc + --dir=/config/mot/P01/slide + --sleep=0 + --dls=/config/mot/P01/INFO.dls + --output=P01 + --label=12 + --label-ins=1200 +autostart=true +autorestart=false +priority=10 +user=root +group=root +redirect_stderr=true +stdout_logfile=/var/log/supervisor/P01-padencoder.log + +# P01 +[program:P01-audioencoder] +command=odr-audioenc + --vlc-uri=http://radiomonaco.ice.infomaniak.ch/radiomonaco-128.mp3 + --drift-comp + --silence=60 + --bitrate=128 + --rate=48000 + --channels=2 + --sbr + --pad=34 + --pad-socket=P01 + --write-icy-text=/config/mot/P01/INFO.dls + --edi tcp://odr-dabmux:9001 + --stats=/var/tmp/P01.stats +autostart=true +autorestart=false +priority=10 +user=root +group=root +redirect_stderr=true +stdout_logfile=/var/log/supervisor/P01-audioencoder.log + +# P02 +[program:P02-padencoder] +command=odr-padenc + --dir=/config/mot/P02/slide + --sleep=0 + --dls=/config/mot/P02/INFO.dls + --output=P02 + --label=12 + --label-ins=1200 +autostart=true +autorestart=false +priority=10 +user=root +group=root +redirect_stderr=true +stdout_logfile=/var/log/supervisor/P02-padencoder.log + +# P02 +[program:P02-audioencoder] +command=odr-audioenc + --vlc-uri=http://media-ice.musicradio.com/CapitalMP3 + --drift-comp + --silence=60 + --bitrate=128 + --rate=48000 + --channels=2 + --sbr + --pad=34 + --pad-socket=P02 + --write-icy-text=/config/mot/P02/INFO.dls + --edi tcp://odr-dabmux:9002 + --stats=/var/tmp/P02.stats +autostart=true +autorestart=false +priority=10 +user=root +group=root +redirect_stderr=true +stdout_logfile=/var/log/supervisor/P02-audioencoder.log diff --git a/docker/odr.env b/docker/odr.env new file mode 100644 index 0000000..7168edf --- /dev/null +++ b/docker/odr.env @@ -0,0 +1,7 @@ +# Set variables +export TZ=Europe/Zurich +export SUPERVISOR_FLR=$(pwd)/../config/supervisor +export MUX_CONF_FILE=$(pwd)/../config/odr-dabmux.info +export MOD_CONF_FILE=$(pwd)/../config/odr-dabmod.ini +export MOD_DEV=/dev/bus/usb/001/004 + diff --git a/install/mmbtools-get b/install/mmbtools-get index 2dab049..365464e 100644 --- a/install/mmbtools-get +++ b/install/mmbtools-get @@ -39,10 +39,10 @@ EOF install_base () { # Install the essential tools and create the tools root directory sudo apt-get update - sudo apt-get install -y build-essential automake libtool supervisor + sudo apt-get install --yes build-essential automake libtool pkg-config supervisor - if [ ! -d ${DIR_MMB} ]; then - mkdir ${DIR_MMB} + if [ ! -d "${DIR_MMB}" ]; then + mkdir "${DIR_MMB}" fi if [ ! $(grep inet_http_server /etc/supervisor/supervisord.conf) ]; then @@ -58,117 +58,199 @@ EOF install_audioenc () { # Install mmb-tools: audio encoder - sudo apt-get install -y libzmq3-dev libzmq5 libvlc-dev vlc-data vlc-plugin-base libcurl4-openssl-dev pkg-config - if [ ! -d ${DIR_AUDIO} ]; then - pushd ${DIR_MMB} - git clone https://github.com/Opendigitalradio/ODR-AudioEnc.git --branch ${1} - popd + sudo apt-get install --yes \ + libasound2-dev \ + libcurl4-openssl-dev \ + libjack-jackd2-dev \ + libgstreamer1.0-dev \ + libgstreamer-plugins-base1.0-dev \ + libvlc-dev \ + libzmq3-dev + + if [ ! -d "${DIR_AUDIO}" ]; then + pushd "${DIR_MMB}" || return + git clone https://github.com/Opendigitalradio/ODR-AudioEnc.git --branch "${1}" + popd || return fi - pushd ${DIR_AUDIO} + + pushd "${DIR_AUDIO}" || return ./bootstrap - ./configure --enable-vlc + ./configure --enable-alsa --enable-jack --enable-vlc --enable-gst make sudo make install make clean - popd + popd || return + + sudo apt-get purge --yes \ + libasound2-dev \ + libcurl4-openssl-dev \ + libjack-jackd2-dev \ + libgstreamer1.0-dev \ + libgstreamer-plugins-base1.0-dev \ + libvlc-dev \ + libzmq3-dev + sudo apt-get install --yes \ + gstreamer1.0-plugins-good \ + libasound2 \ + libcurl4 \ + libgstreamer1.0 \ + libgstreamer-plugins-base1.0 \ + libjack0 \ + libvlc5 \ + libzmq5 \ + vlc-plugin-base } install_padenc () { # Install mmb-tools: PAD encoder - sudo apt-get install -y libmagickwand-dev - if [ ! -d ${DIR_PAD} ]; then - pushd ${DIR_MMB} - git clone https://github.com/Opendigitalradio/ODR-PadEnc.git --branch ${1} - popd + sudo apt-get install --yes libmagickwand-dev + + if [ ! -d "${DIR_PAD}" ]; then + pushd "${DIR_MMB}" || return + git clone https://github.com/Opendigitalradio/ODR-PadEnc.git --branch "${1}" + popd || return fi - pushd ${DIR_PAD} + + pushd "${DIR_PAD}" || return ./bootstrap ./configure make sudo make install make clean - popd + popd || return } install_dabmux () { # Install mmb-tools: dab multiplexer - sudo apt-get install -y libboost-system-dev libcurl4-openssl-dev python3-zmq - if [ ! -d ${DIR_MUX} ]; then - pushd ${DIR_MMB} - git clone https://github.com/Opendigitalradio/ODR-DabMux.git --branch ${1} - popd + sudo apt-get install --yes \ + libboost-system-dev \ + libcurl4-openssl-dev \ + libzmq3-dev + + if [ ! -d "${DIR_MUX}" ]; then + pushd "${DIR_MMB}" || return + git clone https://github.com/Opendigitalradio/ODR-DabMux.git --branch "${1}" + popd || return fi - pushd ${DIR_MUX} + + pushd "${DIR_MUX}" || return ./bootstrap.sh - ## Temporary, until ODR-DabMux configure is modified - arch=$(uname -m) - if [ "${arch}" = "armv7l" ]; then - ./configure --with-boost-libdir=/usr/lib/arm-linux-gnueabihf - else - ./configure - fi + ./configure make sudo make install make clean - popd + popd || return + + sudo apt-get purge --yes \ + libboost-system-dev \ + libcurl4-openssl-dev \ + python3-zmq + sudo apt-get install --yes + libboost-system1.74.0 \ + libcurl4 \ + libzmq5 } install_dabmod () { # Install mmb-tools: modulator - sudo apt-get install -y libfftw3-dev libzmq3-dev libuhd-dev libsoapysdr-dev libbladerf-dev liblimesuite-dev - if [ ! -d ${DIR_MOD} ]; then - pushd ${DIR_MMB} - git clone https://github.com/Opendigitalradio/ODR-DabMod.git --branch ${1} - popd + sudo apt-get install --yes \ + libbladerf-dev \ + libcurl4-openssl-dev \ + libfftw3-dev \ + liblimesuite-dev \ + libsoapysdr-dev \ + libuhd-dev \ + libzmq3-dev + + if [ ! -d "${DIR_MOD}" ]; then + pushd "${DIR_MMB}" || return + git clone https://github.com/Opendigitalradio/ODR-DabMod.git --branch "${1}" + popd || return fi - pushd ${DIR_MOD} + + pushd "${DIR_MOD}" || return ./bootstrap.sh - ./configure CFLAGS="-O3 -DNDEBUG" CXXFLAGS="-O3 -DNDEBUG" --enable-fast-math --disable-zeromq --enable-limesdr --enable-bladerf + ./configure CFLAGS="-O3 -DNDEBUG" CXXFLAGS="-O3 -DNDEBUG" --enable-fast-math --enable-limesdr --enable-bladerf make sudo make install make clean - popd + popd || return + + sudo apt-get purge --yes \ + libbladerf-dev \ + libcurl4-openssl-dev \ + libfftw3-dev \ + liblimesuite-dev \ + libsoapysdr-dev \ + libuhd-dev \ + libzmq3-dev + sudo apt-get install --yes \ + libbladerf2 \ + libcurl4 \ + libfftw3-3 \ + liblimesuite20.10-1 \ + libsoapysdr0.7 \ + libuhd3.15.0 \ + libzmq5 } install_fdkaac () { # Install mmb-tools: fdk-aac - if [ ! -d ${DIR_FDKAAC} ]; then - pushd ${DIR_MMB} + if [ ! -d "${DIR_FDKAAC}" ]; then + pushd "${DIR_MMB}" || return git clone https://github.com/Opendigitalradio/fdk-aac.git - popd + popd || return fi - pushd ${DIR_FDKAAC} + + pushd "${DIR_FDKAAC}" || return ./bootstrap ./configure make sudo make install make clean - popd + popd || return } install_srccmp () { # Install mmb-tools: source companion - if [ ! -d ${DIR_SRCCMP} ]; then - pushd ${DIR_MMB} - git clone https://github.com/Opendigitalradio/ODR-SourceCompanion.git --branch ${1} - popd + sudo apt-get install --yes \ + libzmq3-dev + + if [ ! -d "${DIR_SRCCMP}" ]; then + pushd "${DIR_MMB}" || return + git clone https://github.com/Opendigitalradio/ODR-SourceCompanion.git --branch "${1}" + popd || return fi - pushd ${DIR_SRCCMP} + + pushd "${DIR_SRCCMP}" || return ./bootstrap ./configure make sudo make install make clean - popd + popd || return + + sudo apt-get purge --yes \ + libzmq3-dev + sudo apt-get install --yes \ + libzmq5 + } install_encmgr () { # Install mmb-tools: encoder manager - sudo apt-get install -y python3-cherrypy3 python3-jinja2 python3-serial python3-yaml supervisor python3-pysnmp4 - if [ ! -d ${DIR_ENCMGR} ]; then - pushd ${DIR_MMB} - git clone https://github.com/Opendigitalradio/ODR-EncoderManager.git --branch ${1} - popd + sudo apt-get install --yes \ + python3-cherrypy3 \ + python3-jinja2 \ + python3-pysnmp4 \ + python3-serial \ + python3-yaml \ + supervisor + + if [ ! -d "${DIR_ENCMGR}" ]; then + pushd "${DIR_MMB}" || return + git clone https://github.com/Opendigitalradio/ODR-EncoderManager.git --branch "${1}" + popd || return fi ## Add the current user to the dialout and audio groups sudo usermod --append --group dialout $(id --user --name) @@ -177,24 +259,33 @@ install_encmgr () { install_config () { # Copy the configuration files - if [ -d ${DIR_CONFIG} ]; then - rm -r ${DIR_CONFIG} + if [ -d "${DIR_CONFIG}" ]; then + rm -r "${DIR_CONFIG}" fi - cp -r $(realpath $(dirname $0))/../${CONFIG_NAME} ${DIR_CONFIG} - sudo ln -s ${DIR_CONFIG}/supervisor/*.conf /etc/supervisor/conf.d/ + cp -r $(realpath $(dirname $0))/../${CONFIG_NAME} "${DIR_CONFIG}" + sudo ln -s "${DIR_CONFIG}"/supervisor/*.conf /etc/supervisor/conf.d/ ## Adapt the supervisor configuration files - sed -e "s;user=pi;user=$(id --user --name);g" -i ${DIR_CONFIG}/supervisor/*.conf - sed -e "s;group=pi;group=$(id --group --name);g" -i ${DIR_CONFIG}/supervisor/*.conf - sed -e "s;/home/pi;${HOME};g" -i ${HOME}/config/supervisor/*.conf + for file in "${DIR_CONFIG}"/supervisor/*.conf; do + [[ -e ${file} ]] || break + sed \ + -e "s;user=pi;user=$(id --user --name);g" \ + -e "s;group=pi;group=$(id --group --name);g" \ + -e "s;/home/pi;${HOME};g" \ + -i "${file}" + done ## Adapt the ODR-EncoderManager configuration file - sed -e "s;/home/pi;${HOME};g" -i ${DIR_CONFIG}/encodermanager.json - sed -e "s;\"user\": \"pi\";\"user\": \"$(id --user --name)\";g" -i ${DIR_CONFIG}/encodermanager.json - sed -e "s;\"group\": \"pi\";\"group\": \"$(id --group --name)\";g" -i ${DIR_CONFIG}/encodermanager.json + sed \ + -e "s;/home/pi;${HOME};g" \ + -e "s;\"user\": \"pi\";\"user\": \"$(id --user --name)\";g" \ + -e "s;\"group\": \"pi\";\"group\": \"$(id --group --name)\";g" \ + -i "${DIR_CONFIG}/encodermanager.json" ## Adapt the odr-misc.conf - sed -e "s;--host=raspberrypi.local;--host=$(hostname -I | awk '{print $1}');" -i ${DIR_CONFIG}/supervisor/ODR-misc.conf + sed \ + -e "s;--host=raspberrypi.local;--host=$(hostname -I | awk '{print $1}');" \ + -i "${DIR_CONFIG}/supervisor/ODR-misc.conf" ## Restart supervisor sudo supervisorctl reread @@ -205,41 +296,42 @@ install_config () { install () { # Clone the sources, build and install programs, clean-up - install_base ${1} - install_fdkaac ${1} - install_audioenc ${1} - install_padenc ${1} - install_dabmux ${1} - install_dabmod ${1} - install_srccmp ${1} - install_encmgr ${1} + install_base "${1}" + install_fdkaac "${1}" + install_audioenc "${1}" + install_padenc "${1}" + install_dabmux "${1}" + install_dabmod "${1}" + install_srccmp "${1}" + install_encmgr "${1}" install_config sudo ldconfig - sudo apt-get purge -y + sudo apt-get autoremove --yes sudo rm -rf /var/lib/apt/lists/* echo "ODR-mmbTools suite and configuration files installed" } remove () { + + # Update supervisor + sudo rm /etc/supervisor/conf.d/ODR-* + sudo supervisorctl reread + sudo supervisorctl reload + # Uninstall programs for makefile in $(ls ${DIR_MMB}/**/Makefile); do - pushd $(dirname ${makefile}) + pushd $(dirname ${makefile}) || return sudo make uninstall - popd + popd || return done # Delete sources - rm -rf ${DIR_MMB} + rm -rf "${DIR_MMB}" # Delete configuration files - rm -rf ${DIR_CONFIG} - - # Update supervisor - sudo rm /etc/supervisor/conf.d/ODR-* - sudo supervisorctl reread - sudo supervisorctl reload + rm -rf "${DIR_CONFIG}" echo "ODR-mmbTools suite and configuration files removed" } @@ -260,7 +352,7 @@ while [ "$#" -gt 0 ] ; do done if [ "${action}" == "install" ]; then - install ${branch} + install "${branch}" else remove fi \ No newline at end of file diff --git a/vagrant/README.md b/vagrant/README.md index 3f24c68..448610b 100644 --- a/vagrant/README.md +++ b/vagrant/README.md @@ -4,9 +4,9 @@ With Vagrant and Virtualbox, you can run the ODR-mmbTools regardless of the operating system you are using, such as Windows, MacOS, *BSD or any non-Debian Linux. # Setup -1. Install Virtualbox for your operating system +1. Install Virtualbox 1. Install the Virtualbox Extension pack -1. Install Vagrant for your operating system +1. Install Vagrant 1. Clone this repository or copy the Vagrantfile on your host 1. Create and start the virtual environment: ``` @@ -17,7 +17,7 @@ With Vagrant and Virtualbox, you can run the ODR-mmbTools regardless of the oper ``` vagrant ssh ``` -1. Follow the instructions of the **README.md** in the install folder to build the ODR-mmbTools suite +1. Install the odr-mmbTools suite by following [these instructions](../install/README.md) 1. Exit the virtual session with the command **exit** 1. Connect the SoapySDR transceiver device to your physical host where VirtualBox is running 1. Open VirtualBox and add a USB filter that relates to your SoapySDR device to the **odr-mmb** session