547537e761
Build Docker Image for Raspberry Pi / build-and-push (push) Failing after 1m15s
- Aggiunto supporto lettura inverter paralleli tramite comandi QPGS0-QPGS9 - Implementato discovery automatico inverter con filtro duplicati e serial invalidi - Risolti bug critici comunicazione seriale: * Fix buffer ExecuteCmd da 7 a 200 bytes * Supporto terminatori CR e LF * Modalità blocking con delay 500ms * Lettura byte-by-byte per terminatore affidabile - Implementato script MQTT per pubblicazione dati multi-inverter: * mqtt-push-parallel.sh con topic separati per ogni inverter * Fix autenticazione MQTT con username/password * Aggiunto flag retain (-r) per persistenza dati - Creato test-loop-parallel.sh per simulazione completa container - Aggiornata documentazione con compatibilità MKS IV e guida test loop - Aggiornati profili debug VS Code per bash e parallel discovery - Configurazione MQTT completa con server reale (192.168.1.37:1883) Sistema testato e funzionante con 2 inverter Voltronic Axpert MKS IV
23 lines
490 B
Python
23 lines
490 B
Python
import serial
|
|
import time
|
|
|
|
port = '/dev/ttyUSB1'
|
|
ser = serial.Serial(port, 2400, bytesize=8, parity='N', stopbits=1, timeout=2)
|
|
|
|
# Costruisci comando QPIGS manualmente
|
|
cmd = b'QPIGS'
|
|
crc = 0xB7A9
|
|
cmd_full = cmd + bytes([crc >> 8, crc & 0xFF, 0x0D])
|
|
|
|
print(f"Invio comando: {cmd_full.hex(' ')}")
|
|
print(f"Lunghezza: {len(cmd_full)} bytes")
|
|
|
|
ser.write(cmd_full)
|
|
time.sleep(0.5)
|
|
|
|
resp = ser.read(100)
|
|
print(f"Ricevuto ({len(resp)} bytes): {resp.hex(' ')}")
|
|
print(f"ASCII: {resp}")
|
|
|
|
ser.close()
|