6af9fcad7e
Build Docker Image for Raspberry Pi / build-and-push (push) Failing after 4m42s
🆕 Funzionalità Auto-Discovery - Aggiunto metodo AutoDiscoverBufferSizes() per rilevamento automatico QPIGS/QPIRI/QMOD/QPIWS - Supporto variabili d'ambiente (INVERTER_DEVICE, MQTT_SERVER, etc.) - Caching persistente buffer sizes in /cache/inverter.conf.cache - Flag -a/--auto-discover per modalità auto-detection 🐛 Bug Fixes Critici - **Parsing interi**: Aggiunta attemptAddSettingInt() con stoi() invece di stof() - Fix: stof('98') = 98.0f → 97 (int), ora stoi('98') = 98 direttamente - Applicato a: qpiri, qpiws, qmod, qpigs - **Thread sync**: Aggiunto ups_qpiws_changed a main loop e condizione exit poll() - Fix: loop principale controllava solo 3 flag su 4, causava hang - Fix: thread poll() non usciva in runOnce perché mancava controllo QPIWS - **Config accuracy**: Corretti buffer sizes (qpiri: 98→103, qpiws: 36→40) - Rimosso sources/inverter-cli/inverter.conf che sovrascriveva config globale - Validato con test: inverter_poller -1 completa in 6s con JSON completo 📚 Documentazione Completa - Creato documentation/CODE_ARCHITECTURE.md (38KB) - Mappa logica variabili globali - Flusso esecuzione main() con diagrammi ASCII - Sequence diagram classe cInverter (poll, query, auto-discovery) - Thread synchronization diagrams - MQTT integration bash scripts flow - Mappa concettuale 5-layer system architecture - Error handling e performance optimizations - Organizzati file .md in documentation/ (AUTO_DISCOVERY, IMPLEMENTATION, QUICKSTART, DEBUG) - Aggiornato README.md con sezione v2.0 e indice documentazione - Aggiornato .github/copilot-instructions.md con novità v2.0 🔧 Miglioramenti Build & CI/CD - Gitea Actions per build multi-arch (arm/v6, arm/v7, arm64, amd64, 386) - Configurazione VS Code completa (tasks, launch, debug GDB) - Script test-autodiscovery.sh e test-device.sh ✅ Testing Validato - inverter_poller -1 completa in 6 secondi - Output JSON completo con tutte le metriche - Exit pulito senza timeout (exit code 0) - Tutte le 4 query QMOD/QPIGS/QPIRI/QPIWS funzionanti
64 lines
1.6 KiB
YAML
64 lines
1.6 KiB
YAML
version: '3'
|
|
|
|
services:
|
|
voltronic-mqtt:
|
|
|
|
# We're now (finally) supporting Multi-Arch builds (via Github actions) on Docker Hub!
|
|
image: bushrangers/ha-voltronic-mqtt
|
|
|
|
# Uncomment if you want to build your own local version.
|
|
#build:
|
|
# context: .
|
|
# dockerfile: Dockerfile.dev
|
|
|
|
|
|
container_name: voltronic-mqtt
|
|
|
|
privileged: true
|
|
restart: always
|
|
|
|
# Environment variables for auto-discovery
|
|
environment:
|
|
# Default device (can be ttyUSB0, ttyUSB1, ttyS0, hidraw0, etc.)
|
|
- INVERTER_DEVICE=/dev/ttyUSB1
|
|
|
|
# Force auto-discovery on every container start (default: false)
|
|
# Set to "true" to re-run discovery even if previous results exist
|
|
- FORCE_DISCOVERY=false
|
|
|
|
# Skip auto-discovery completely (default: false)
|
|
# Set to "true" to use only values from inverter.conf
|
|
- SKIP_DISCOVERY=false
|
|
|
|
volumes:
|
|
- ./config/:/etc/inverter/
|
|
|
|
devices:
|
|
# - "/dev/mem:/dev/mem"
|
|
|
|
# USB Port Mapping
|
|
- /dev/bus/usb:/dev/bus/usb:rwm
|
|
- /dev/ttyUSB0:/dev/ttyUSB0:rwm
|
|
- /dev/ttyUSB1:/dev/ttyUSB1:rwm
|
|
|
|
# Serial Port Mapping...
|
|
- /dev/ttyS0:/dev/ttyS0
|
|
- /dev/ttyS1:/dev/ttyS1
|
|
- /dev/ttyS2:/dev/ttyS2
|
|
|
|
# Used to auto-update images as we release new versions...
|
|
watchtower:
|
|
# Please see the following for configuration options:
|
|
# https://containrrr.github.io/watchtower/container-selection/
|
|
image: containrrr/watchtower
|
|
container_name: watchtower
|
|
|
|
restart: always
|
|
privileged: true
|
|
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
|
|
command: --interval 500
|
|
|