{"id":30092710,"url":"https://github.com/daudo/weewx-compose-stack","last_synced_at":"2025-08-09T08:04:53.065Z","repository":{"id":308452122,"uuid":"1032866586","full_name":"daudo/weewx-compose-stack","owner":"daudo","description":"Docker Compose stack for WeeWX weather stations with EcoWitt GW1000 driver integration, nginx web server, and Portainer support. Built on felddy/weewx-docker.","archived":false,"fork":false,"pushed_at":"2025-08-06T01:22:43.000Z","size":97,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-06T02:40:49.624Z","etag":null,"topics":["docker-compose","ecowitt","gw1000","portainer","weather-station","weewx","ws3800","ws90"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daudo.png","metadata":{"files":{"readme":"README-PORTAINER.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-06T00:38:31.000Z","updated_at":"2025-08-06T01:22:46.000Z","dependencies_parsed_at":"2025-08-06T02:40:53.112Z","dependency_job_id":"66d8e090-456a-4d27-a7e1-2401e20fcc00","html_url":"https://github.com/daudo/weewx-compose-stack","commit_stats":null,"previous_names":["daudo/weewx-compose-stack"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/daudo/weewx-compose-stack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daudo%2Fweewx-compose-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daudo%2Fweewx-compose-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daudo%2Fweewx-compose-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daudo%2Fweewx-compose-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daudo","download_url":"https://codeload.github.com/daudo/weewx-compose-stack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daudo%2Fweewx-compose-stack/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269548500,"owners_count":24436113,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-compose","ecowitt","gw1000","portainer","weather-station","weewx","ws3800","ws90"],"created_at":"2025-08-09T08:03:20.069Z","updated_at":"2025-08-09T08:04:53.056Z","avatar_url":"https://github.com/daudo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WeeWX Docker Stack - Portainer Deployment Guide\n\nThis Docker Compose stack provides a complete WeeWX weather station setup with EcoWitt GW1000 driver, nginx web server, and environment variable configuration - optimized for Portainer deployment.\n\nBuilt on [felddy/weewx-docker](https://github.com/felddy/weewx-docker) container with orchestration and additional services.\n\n**Note**: nginx serves HTTP only - intended to run behind a reverse proxy/load balancer for HTTPS.\n\n## Quick Start\n\n### 1. Prepare Environment Variables\n\nIn Portainer, when creating the stack, set these environment variables:\n\n| Variable | Description | Default Value | Required |\n|----------|-------------|---------------|----------|\n| `GW1000_IP` | IP address of your GW1000 gateway | `192.168.1.10` | Yes |\n| `NGINX_PORT` | External port for web interface | `8080` | Yes |\n| `WEEWX_LOCATION` | Weather station location description | `Home Weather Station` | Yes |\n| `WEEWX_LATITUDE` | Station latitude in decimal degrees | `40.7128` (NYC) | Yes |\n| `WEEWX_LONGITUDE` | Station longitude in decimal degrees | `-74.0060` (NYC) | Yes |\n| `WEEWX_ALTITUDE` | Station altitude with unit | `100, foot` | Yes |\n| `WEEWX_STATION_URL` | Website URL for your station | _(empty)_ | No |\n| `WEEWX_RAIN_YEAR_START` | Month when rain year starts (1-12) | `1` (January) | Yes |\n| `WEEWX_WEEK_START` | First day of week (0=Mon, 6=Sun) | `6` (Sunday) | Yes |\n| `WEEWX_UNIT_SYSTEM` | Unit system for web interface | `metric` | Yes |\n\n**Important Notes:**\n\n- **Latitude/Longitude**: Use decimal degrees, negative for south/west hemispheres\n- **Altitude**: Format must be \"number, unit\" where unit is either \"foot\" or \"meter\"\n- **Station URL**: Must start with `http://` or `https://` if provided\n- **Rain Year Start**: 1=January, 10=October, etc.\n- **Week Start**: 0=Monday, 1=Tuesday, ..., 6=Sunday\n- **Unit System**: `us` (Fahrenheit, inches), `metric` (Celsius, mm), or `metricwx` (meteorological metric)\n\n### 2. Deploy Stack\n\n1. In Portainer, go to **Stacks** → **Add stack**\n2. Give it a reasonable name, eg `weewx5`\n3. In Build Method, choose \"Repository\"\n   1. Repository URL: https://github.com/daudo/weewx-compose-stack\n   2. Repository Reference: refs/heads/main\n   3. Compose path: **docker-compose.yml**\n4. Scroll down to **Environment variables** and add:\n   - `GW1000_IP=192.168.1.10` (adjust to your device's IP)\n   - `NGINX_PORT=8080` (adjust to desired port)\n   - `WEEWX_LOCATION=My Cosy Weather Station` (describe your location)\n   - `WEEWX_LATITUDE=47.2626` (your latitude in decimal degrees)\n   - `WEEWX_LONGITUDE=11.3945` (your longitude in decimal degrees)\n   - `WEEWX_ALTITUDE=587, meter` (your altitude with unit)\n   - `WEEWX_STATION_URL=https://myweather.example.com` (optional)\n   - `WEEWX_RAIN_YEAR_START=10` (optional, eg. 10 = October starts the rain year)\n   - `WEEWX_WEEK_START=0` (optional, 0=Monday, 6=Sunday)\n   - `WEEWX_UNIT_SYSTEM=metric` (optional, metric for Celsius/mm, us for Fahrenheit/inches)\n5. Click **Deploy the stack**\n\n**Note**: The docker-compose.yml file uses volume-based configuration copying to ensure compatibility with both local Docker Compose and Portainer deployments.\n\n### 3. First Run Setup\n\nOn first deployment, the stack runs in two stages:\n\n1. **weewx-init** container runs once to:\n   - Generate initial WeeWX configuration (`weewx.conf`)\n   - Apply environment variable configuration to station settings\n   - Install the GW1000 driver to shared volume\n   - Install nginx configuration to shared volume  \n   - Configure WeeWX for your GW1000 device\n   - Set up sensor data collection\n   - Exit successfully (code 0)\n\n2. **weewx** container starts normally and:\n   - Begins collecting weather data from GW1000\n   - Generates web reports every 5 minutes\n   - Runs continuously\n\n3. **nginx** container serves the web interface at `http://your-server:8080`\n\n## Architecture\n\n```\n┌─────────────────┐     ┌──────────────┐     ┌─────────────────┐\n│   weewx-init    │───▶│    weewx     │───▶│     nginx       │\n│ (unified setup: │     │  (data gen)  │     │  (web server)   │\n│  conf + drivers │     │              │     │                 │\n│   + nginx.conf) │     │              │     │                 │\n└─────────────────┘     └──────────────┘     └─────────────────┘\n         │                      │                      │\n         ▼                      ▼                      ▼\n┌──────────────────────────────────────────────────────────────────────────────────────┐\n│                              weewx_data volume                                       │\n│  /data/weewx.conf  /data/bin/user/gw1000.py  /data/nginx/nginx.conf  /data/archive/  │\n└──────────────────────────────────────────────────────────────────────────────────────┘\n```\n\n## Services\n\n### weewx-init\n\n- **Purpose**: Unified one-time setup container\n- **Function**: Creates WeeWX configuration, installs GW1000 driver, sets up nginx config\n- **Lifecycle**: Runs once per stack deployment\n- **Dependencies**: None\n\n### weewx\n\n- **Purpose**: Main weather data collection and processing\n- **Function**: Collects data from GW1000 compatible devices, generates web reports\n- **Lifecycle**: Runs continuously, restarts on failure\n- **Dependencies**: weewx-init (must complete successfully)\n\n### nginx\n\n- **Purpose**: Web server for weather station interface\n- **Function**: Serves static HTML/CSS/images from WeeWX\n- **Lifecycle**: Runs continuously, restarts on failure\n- **Dependencies**: weewx (for shared volume)\n\n## Configuration\n\n### GW1000 Network Setup\n\nEnsure your GW1000 or compatible device is:\n\n1. Accessible from your Docker host\n2. Has a static IP address (recommended)\n3. API is accessible (test with: `curl http://GW1000_IP/get_livedata_info`)\n\n### Port Configuration\n\n- **Default nginx port**: 8080\n- **To change**: Update `NGINX_PORT` environment variable\n- **Load balancer**: Point to `http://docker-host:NGINX_PORT`\n\n### Data Persistence\n\n- **Volume**: `weewx_data` (managed by Docker)\n- **Location**: Contains WeeWX config, database, and web files\n- **Backup**: Back up this volume for data persistence\n\n## Updating Configuration\n\nIf you need to change your environment variables after initial deployment:\n\n### Method 1: Restart the Stack (Recommended)\n\n1. Update your environment variables in Portainer (Stack → weewx5 → Environment variables)\n2. Click **Pull and redeploy**\n3. The weewx-init container will run again and apply the new settings\n\n### Method 2: Manual Configuration Update (Docker Compose only)\n\nIf using Docker Compose locally, you can update configuration without full restart:\n\n```bash\n# Edit your .env file with new values\nvi .env\n\n# Run the update script\n./update-config.sh\n```\n\n## Troubleshooting\n\n### Check Container Status\n\n```bash\ndocker compose ps\n```\n\n### View Logs\n\n```bash\n# WeeWX logs (data collection)\ndocker compose logs weewx\n\n# Init container logs (setup)\ndocker compose logs weewx-init\n\n# Web server logs\ndocker compose logs nginx\n```\n\n### Manual Configuration\n\nIf needed, you can access and modify configuration:\n\n```bash\n# Access WeeWX container\ndocker compose exec weewx bash\n\n# Edit configuration\nvi /data/weewx.conf\n\n# Restart to apply changes\ndocker compose restart weewx\n```\n\n## GW1000 Driver Setup\n\nThe GW1000 driver (`gw1000/gw1000.py`) was obtained from the backup repository:\n\n- **Original Source**: https://github.com/gjr80/weewx-gw1000 (no longer available)\n- **Backup Repository**: https://github.com/hoetzgit/weewx-gw1000\n- **Version**: v0.6.3 (2 August 2024)\n\n### How the driver was obtained:\n\n```bash\n# Clone the backup repository\ngit clone https://github.com/hoetzgit/weewx-gw1000.git\n\n# Copy the driver file\ncp weewx-gw1000/bin/user/gw1000.py /path/to/weewx-compose-stack/gw1000/\n```\n\nThe driver is automatically installed by the `weewx-init` container during stack deployment.\n\nUnfortunately, the future of the driver is more than uncertain, so future WeeWX version might be incompatible with the latest official version of the GW1000 driver.\n\n## Updates\n\nTo update the GW1000 driver:\n\n1. Download latest `gw1000.py` from the backup repository\n2. Replace `gw1000/gw1000.py` in the project directory\n3. Rebuild the init container: `docker compose build weewx-init`\n4. Restart the stack: `docker compose up -d`\n\n## Support\n\n- WeeWX Documentation: https://weewx.com/docs/\n- GW1000 Driver: https://github.com/hoetzgit/weewx-gw1000\n- Issues: Check container logs first, then consult WeeWX forums\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaudo%2Fweewx-compose-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaudo%2Fweewx-compose-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaudo%2Fweewx-compose-stack/lists"}