#!/bin/bash # Test suite per comandi Voltronic Axpert MKS IV # Basato su documentazione forum AEVA e manuale protocollo echo "╔══════════════════════════════════════════════════════╗" echo "║ TEST COMANDI PROTOCOLLO VOLTRONIC MKS IV ║" echo "╚══════════════════════════════════════════════════════╝" echo "" test_command() { local cmd=$1 local desc=$2 echo -n "Testing $cmd ($desc)... " result=$(sudo ./bin/inverter_poller -r "$cmd" 2>&1 | grep "Reply:" | sed 's/Reply://g' | xargs) if [ -z "$result" ]; then echo "❌ NO RESPONSE" elif [ "$result" = "NAK" ]; then echo "❌ NAK (comando non supportato)" else echo "✅ $result" fi } # Comandi che DOVREBBERO funzionare echo "=== COMANDI STANDARD P18 ===" test_command "QID" "Device Serial Number" test_command "QVFW" "Main CPU Firmware Version" test_command "QGMN" "General Model Name" test_command "QPI" "Protocol ID" test_command "QFLAG" "Device Flag Status" echo "" echo "=== COMANDI STATUS AVANZATI ===" test_command "QPGS0" "Parallel General Status" test_command "QPGS1" "Parallel General Status #1" test_command "QDI" "Default Settings Inquiry" test_command "QMCHGCR" "Max Charging Current Options" test_command "QMUCHGCR" "Max Utility Charging Current" test_command "QOPPT" "Output Power Type" echo "" echo "=== COMANDI BATTERIA ===" test_command "QBEQI" "Battery Equalization Info" test_command "QBMS" "BMS Info" echo "" echo "=== COMANDI DIAGNOSTICI ===" test_command "QBOOT" "Bootloader Version" test_command "QET" "Total Generated Energy" test_command "QEY" "Generated Energy This Year" test_command "QEM" "Generated Energy This Month" test_command "QED" "Generated Energy Today" echo "" echo "╔══════════════════════════════════════════════════════╗" echo "║ REPORT FINALE ║" echo "╚══════════════════════════════════════════════════════╝" echo "Comando FUNZIONANTE: QGMN (Model 054)" echo "Comandi STANDARD non funzionanti: QPIGS, QPIRI, QMOD, QPIWS" echo "Possibile causa: Protocollo proprietario MKS IV"