improve pdp reconnect

This commit is contained in:
PaulVua
2026-01-15 10:39:08 +01:00
parent c571bbd408
commit d593449171

View File

@@ -522,6 +522,15 @@ def reset_PSD_CSD_connection():
ser_sara.write(command.encode('utf-8'))
response_check = read_complete_response(ser_sara, wait_for_lines=["OK"])
print(response_check, end="")
# 2. Parser la réponse
if '+CGACT: 1,1' in response:
print("✅ Contexte PDP déjà actif")
return True
elif '+CGACT: 1,0' in response:
print("➡️ ⚠️ Contexte PDP inactif")
else:
print("⚠️ État PDP inconnu, reset nécessaire")
return False
time.sleep(1)
# Activate PDP context 1