Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

volod/coop-pilot

Repository files navigation

Stack A Pilot: Cooperative Hub on a Single amd64 Nettop

This project bootstraps a pilot deployment of Stack A, a complete IoT infrastructure platform.

Components

  • OpenRemote - IoT management platform (proxy + manager + Keycloak + PostgreSQL)
  • Mosquitto - MQTT message broker with TLS (port 8883)
  • ChirpStack v4 - LoRaWAN Network Server (+ Gateway Bridge + Redis + PostgreSQL + REST API)
  • Frigate - Network Video Recorder with object detection (events → MQTT)
  • Prometheus - Metrics and monitoring (optional profile)

Pilot Scale Assumptions

  • Single amd64 nettop runs the entire hub
  • 3–5 strongholds (installation sites)
  • 5–10 LoRaWAN devices
  • 2–6 RTSP cameras
  • LoRaWAN region: EU868

Quick Start

# 1. Generate .env from the production template (random secrets injected)
./scripts/gen-env.sh # prod | or: gen-env.sh dev | gen-env.sh test
# 2. Start the stack (creates data dirs, TLS certs, and MQTT users when missing)
./scripts/bootstrap.sh # prod | or: APP_ENV=dev ./scripts/bootstrap.sh
# 3. Configure cameras (optional)
python scripts/add_camera.py --name front_door --rtsp rtsp://user:pass@ip:554/stream1
# 4. Verify services
docker ps --format "table {{.Names}}\t{{.Status}}"

Documentation

Document Description
Getting Started Installation and initial setup
Configuration Detailed configuration options
Architecture System design and data flows
Sensor Integration Cameras, LoRaWAN, MQTT sensors
Testing Running tests and load testing
Analytics Log aggregation and reporting
Troubleshooting Common issues and solutions

Service Access

Service URL Description
OpenRemote https://localhost Main management UI
ChirpStack http://localhost:8080 LoRaWAN server UI
ChirpStack REST http://localhost:8090 REST API
Frigate http://localhost:8971 NVR interface
Prometheus http://localhost:9090 Monitoring (if enabled)

Testing

# Setup Python environment
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements/dev.txt
# Run all tests
pytest tests/ -v
# Run load tests
locust -f tests/locustfile.py --headless -u 10 -t 60s

Analytics

Generate statistics reports for monitoring and debugging:

source .venv/bin/activate
# Console report
python -m coop_stack_analytics.cli --since 1h
# Export JSON
python -m coop_stack_analytics.cli --format json --output reports/report.json
# Quick health check
python -m coop_stack_analytics.cli --health-only

Project Structure

├── config/
│ ├── chirpstack/ # ChirpStack configuration
│ ├── frigate/ # Frigate NVR configuration
│ ├── keycloak/ # Keycloak realm import
│ ├── mosquitto/ # MQTT broker configuration
│ ├── postgresql/ # Database init scripts
│ └── prometheus/ # Monitoring configuration
├── docker/
│ ├── docker-compose.yml # Base (production)
│ ├── docker-compose.dev.yml # Development overrides
│ └── docker-compose.test.yml # Test / CI overrides
├── env/
│ ├── prod.env # Production template (default)
│ ├── dev.env # Development template
│ └── test.env # Test / CI template
├── config/ # Service configuration files
├── data/ # Bind-mounted volumes (gitignored)
├── docs/ # Documentation
├── scripts/ # Lifecycle and setup scripts
├── coop_stack_analytics/ # Log analytics module
├── tests/ # Test suite
└── requirements/ # Python dependencies (base / test / dev)

Notes

  • Use ./scripts/clean_data.sh to reset data (fixes ownership of container-owned files before removal)
  • Frigate publishes only port 8971 to localhost; port 5000 is intentionally not exposed
  • Mosquitto expects TLS files in config/mosquitto/certs/
  • ChirpStack config is split into chirpstack.toml and region_eu868.toml
  • scripts/package.sh creates a sanitized archive (excludes secrets and certificates)

License

See LICENSE file for details.

About

a complete IoT infrastructure platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /