Fix: Vider le buffer série avant chaque commande AT dans sara.py

Évite de lire des URCs résiduelles (ex: +USECMNG, AT+USECPRF) émises
par le modem SARA pendant son initialisation au démarrage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
PaulVua
2026-03-10 16:12:53 +01:00
parent 7a7d1c0c3f
commit 1298e79688

View File

@@ -46,6 +46,9 @@ try:
timeout = timeout timeout = timeout
) )
# Flush any leftover data from previous commands or modem boot URCs
ser.reset_input_buffer()
ser.write((command + '\r').encode('utf-8')) ser.write((command + '\r').encode('utf-8'))
#ser.write(b'ATI\r') #General Information #ser.write(b'ATI\r') #General Information