This commit is contained in:
PaulVua
2025-01-09 17:51:53 +01:00
parent 4df29fc157
commit c95bc3d987
2 changed files with 7 additions and 1 deletions

View File

@@ -106,7 +106,7 @@ def update_json_key(file_path, key, value):
with open(file_path, "w") as file:
json.dump(data, file, indent=2) # Use indent for pretty printing
print(f"Successfully updated '{key}' to '{value}'.")
print(f"updating '{key}' to '{value}'.")
except Exception as e:
print(f"Error updating the JSON file: {e}")
@@ -318,12 +318,17 @@ try:
print('<span style="color: red;font-weight: bold;">ATTENTION: CME ERROR</span>')
print("error:", lines[-1])
print("*****")
#update status
update_json_key(config_file, "SARA_R4_network_status", "disconnected")
# Gestion de l'erreur spécifique
if "No connection to phone" in lines[-1]:
print("No connection to the phone. Retrying or reset may be required.")
# Actions spécifiques pour ce type d'erreur (par exemple, réinitialiser ou tenter de reconnecter)
# need to reconnect to network
# and reset HTTP profile (AT+UHTTP=0) -> ne fonctionne pas..
# tester un reset avec CFUN 15
elif "Operation not allowed" in lines[-1]:
print("Operation not allowed. This may require a different configuration.")
# Actions spécifiques pour ce type d'erreur