Commit Graph

13 Commits

Author SHA1 Message Date
Pi Developer 6af9fcad7e feat(v2.0): Auto-discovery, correzione bug critici, e documentazione completa
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
2026-01-25 15:00:48 +01:00
David a7f161b9d6 update readme 2020-09-19 12:42:49 +10:00
David Nedved e517950a87 update readme 2020-04-01 12:06:00 +10:00
David Nedved b8e9d8ad33 include healthcheck in default actions 2020-04-01 11:42:35 +10:00
David ebd3bbe2bc include support for MQTT username/password 2019-08-12 15:17:54 +10:00
David 293f487ef2 update readme screenshots 2019-08-09 16:34:43 +10:00
David 0c2c945a96 update readme with more info around charging VLRA batteries 2019-08-09 16:17:37 +10:00
David ccb999b8dc refactor for better support with ch341 and other unreliable rs232 adapters 2019-07-27 22:34:34 +10:00
David c9ba895410 update readme 2019-06-14 09:59:49 +10:00
David 5edafe0ddc update readme & add example HA config files 2019-05-29 11:37:38 +10:00
David f6c8d92f5e merge license 2019-05-28 15:01:14 +10:00
David 24fcc1addd update readme 2019-05-28 14:58:01 +10:00
David 7a6b39bf18 initial docker support on x86 2019-05-28 14:27:57 +10:00