From 8018b0caf962414ed8b946d7372f3f4ccd50ec12 Mon Sep 17 00:00:00 2001 From: Michael Gillett <51103663+migillett@users.noreply.github.com> Date: Wed, 4 Mar 2026 09:58:35 -0500 Subject: [PATCH] feat: updated readme plus docker usb support --- .gitignore | 5 ++++- README.md | 27 ++++++++++++++++++++++----- docker-compose.yml | 7 +++++++ dockerfile | 3 +++ 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 0f6aeca..9d511b3 100644 --- a/.gitignore +++ b/.gitignore @@ -57,4 +57,7 @@ identity.json # Logs *.log .DS_Store -syncpi.sh \ No newline at end of file +syncpi.sh + +# Docker +/data diff --git a/README.md b/README.md index 17c10a6..72562d8 100644 --- a/README.md +++ b/README.md @@ -316,17 +316,34 @@ This script will: The script will prompt you for each optional removal step. -## Docker +## Docker Compose -You can now run PyMC Repeater from within a [Docker Container](https://www.docker.com/). Checkout the example [Docker Compose](./docker-compose.yml) file before you get started. +You can now run PyMC Repeater from within a [Docker Container](https://www.docker.com/). Checkout the example [Docker Compose](./docker-compose.yml) file before you get started. It will need some configuration changes based on what hardware you're using (USB vs SPI). Look at the commented out lines to see which hardware requires what lines and only enable what you need. + +Here is what you'll need to do in order to get the container running: + +1. Copy the `config.yaml.example` to `config.yaml` + +```bash +cp ./config.yaml.example ./config.yaml +``` + +2. Run the configuration script and follow the prompts for the configuration you want to use. + +```bash +sudo bash ./setup-radio-config.sh +``` + +3. Modify the `config.yaml` file with a unique web UI password. This allows you to bypass the `/setup` page when logging for the first time. You can find the value under `repeater.security.admin_password`. Change to _anything_ besides the default of `admin123`. + +4. Configure the [docker compose](./docker-compose.yml) to your specific hardware and file paths. + +5. Build and start the container. ```bash docker compose up -d --force-recreate --build ``` -Just note that you will have to pass in a `config.yaml` into the container. You can create a new config by following the instructions in the [Configuration section](#configuration). - - ## Roadmap / Planned Features - [ ] **Public Map Integration** - Submit repeater location and details to public map for discovery diff --git a/docker-compose.yml b/docker-compose.yml index f65a1de..1048993 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,10 +6,17 @@ services: ports: - 8000:8000 devices: + # SPI DEVICES (Your path may differ) - /dev/spidev0.0 - /dev/gpiochip0 + # USB DEVICES (Your path may differ) + - /dev/bus/usb/002:/dev/bus/usb/002 + # SPI DEVICES PERMISSIONS cap_add: - SYS_RAWIO + # USB DEVICSE PERMISSIONS + group_add: + - plugdev volumes: - ./config.yaml:/etc/pymc_repeater/config.yaml - ./data:/var/lib/pymc_repeater diff --git a/dockerfile b/dockerfile index 8d3689f..2dfee91 100644 --- a/dockerfile +++ b/dockerfile @@ -12,6 +12,7 @@ RUN apt-get update && apt-get install -y \ python3-rrdtool \ jq \ wget \ + libusb-1.0-0 \ swig \ git \ build-essential \ @@ -26,6 +27,8 @@ WORKDIR ${INSTALL_DIR} # Copy source COPY repeater ./repeater COPY pyproject.toml . +COPY radio-presets.json . +COPY radio-settings.json . # Install package RUN pip install --no-cache-dir .