shajen / rtl-sdr-scanner-cpp

GNU General Public License v3.0
604 stars 61 forks source link

Question: The path to recorded audio files? #49

Closed atlex closed 8 months ago

atlex commented 1 year ago

Hi @shajen,

How can i configure the path to recorded audio files? Or how can i get recorded audio files?

Old setting from config.json doesn't work.

"output": { "recordings": "/home/pi/recs",

tomevans80 commented 1 year ago

Not sure how to configure it but mine are in /var/snap/docker/common/var-lib-docker/volumes/

shajen commented 1 year ago

You can not configure path of recordings. The are 3 ways to access recordings:

atlex commented 1 year ago

@shajen thank you.

I found recorded files (.bin) in the sdr_sdr-monitor-reader_1 container. But it's not useful for me :(

Is it possible to have recorded audio files (.mp3/.wav) available for other applications outside of the container?

atlex commented 1 year ago

@shajen Now i have recorded files in my local folder /home/den/rtl-sdr-scanner-cpp/data/device_2/transmission/2023-02-22/

My solution:

docker-compose.yml

services:
  sdr-broker:
    image: eclipse-mosquitto:latest
    restart: on-failure
    command:
      - /bin/sh
      - -c
      - |
        echo "listener 1883" > /mosquitto/config/mosquitto.conf
        echo "allow_anonymous false" >> /mosquitto/config/mosquitto.conf
        echo "password_file /mosquitto/config/password.txt" >> /mosquitto/config/mosquitto.conf
        echo "admin:password" > /mosquitto/config/password.txt
        mosquitto_passwd -U /mosquitto/config/password.txt
        mosquitto -c /mosquitto/config/mosquitto.conf
  sdr-scanner:
    image: shajen/sdr-scanner:latest
    restart: on-failure
    depends_on:
      - sdr-broker
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - ./config.json:/config.json
    devices:
      - /dev/bus/usb:/dev/bus/usb
  sdr-monitor-setup:
    image: shajen/sdr-monitor:latest
    restart: on-failure
    depends_on:
      - sdr-broker
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /home/den/rtl-sdr-scanner-cpp/db:/usr/src/sdr-panel/db
      - /home/den/rtl-sdr-scanner-cpp/data:/usr/src/sdr-panel/public/media
    command: bash -c "python3 manage.py migrate && DJANGO_SUPERUSER_PASSWORD=password python3 manage.py createsuperuser --noinput --username admin --email admin@local.local &> /dev/null || true"
  sdr-monitor-server:
    image: shajen/sdr-monitor:latest
    restart: on-failure
    depends_on:
      sdr-monitor-setup:
        condition: service_completed_successfully
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /home/den/rtl-sdr-scanner-cpp/db:/usr/src/sdr-panel/db
      - /home/den/rtl-sdr-scanner-cpp/data:/usr/src/sdr-panel/public/media
    command: python3 manage.py runserver 0.0.0.0:8000
    ports:
      - 8001:8000
  sdr-monitor-reader:
    image: shajen/sdr-monitor:latest
    restart: on-failure
    depends_on:
      sdr-monitor-setup:
        condition: service_completed_successfully
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /home/den/rtl-sdr-scanner-cpp/db:/usr/src/sdr-panel/db
      - /home/den/rtl-sdr-scanner-cpp/data:/usr/src/sdr-panel/public/media
    command: python3 manage.py runscript mqtt_reader
abdellahaski commented 9 months ago

@shajen Now i have recorded files in my local folder /home/den/rtl-sdr-scanner-cpp/data/device_2/transmission/2023-02-22/

My solution:

docker-compose.yml

services:
  sdr-broker:
    image: eclipse-mosquitto:latest
    restart: on-failure
    command:
      - /bin/sh
      - -c
      - |
        echo "listener 1883" > /mosquitto/config/mosquitto.conf
        echo "allow_anonymous false" >> /mosquitto/config/mosquitto.conf
        echo "password_file /mosquitto/config/password.txt" >> /mosquitto/config/mosquitto.conf
        echo "admin:password" > /mosquitto/config/password.txt
        mosquitto_passwd -U /mosquitto/config/password.txt
        mosquitto -c /mosquitto/config/mosquitto.conf
  sdr-scanner:
    image: shajen/sdr-scanner:latest
    restart: on-failure
    depends_on:
      - sdr-broker
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - ./config.json:/config.json
    devices:
      - /dev/bus/usb:/dev/bus/usb
  sdr-monitor-setup:
    image: shajen/sdr-monitor:latest
    restart: on-failure
    depends_on:
      - sdr-broker
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /home/den/rtl-sdr-scanner-cpp/db:/usr/src/sdr-panel/db
      - /home/den/rtl-sdr-scanner-cpp/data:/usr/src/sdr-panel/public/media
    command: bash -c "python3 manage.py migrate && DJANGO_SUPERUSER_PASSWORD=password python3 manage.py createsuperuser --noinput --username admin --email admin@local.local &> /dev/null || true"
  sdr-monitor-server:
    image: shajen/sdr-monitor:latest
    restart: on-failure
    depends_on:
      sdr-monitor-setup:
        condition: service_completed_successfully
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /home/den/rtl-sdr-scanner-cpp/db:/usr/src/sdr-panel/db
      - /home/den/rtl-sdr-scanner-cpp/data:/usr/src/sdr-panel/public/media
    command: python3 manage.py runserver 0.0.0.0:8000
    ports:
      - 8001:8000
  sdr-monitor-reader:
    image: shajen/sdr-monitor:latest
    restart: on-failure
    depends_on:
      sdr-monitor-setup:
        condition: service_completed_successfully
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
      - /home/den/rtl-sdr-scanner-cpp/db:/usr/src/sdr-panel/db
      - /home/den/rtl-sdr-scanner-cpp/data:/usr/src/sdr-panel/public/media
    command: python3 manage.py runscript mqtt_reader

But how do you read the bin files

GarryCZ commented 8 months ago

If anyone needs to pull MP3s from the server, I've written a primitive script that downloads the last file and saves it to the sounds folder when a new recording is made. I'm sure there are other ways to do this, but this is sufficient for me and works well.

code : https://pastebin.com/raw/sD67WXcp