update
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
"SARA_R4_general_status": "connected",
|
"SARA_R4_general_status": "connected",
|
||||||
"SARA_R4_SIM_status": "connected",
|
"SARA_R4_SIM_status": "connected",
|
||||||
"SARA_R4_network_status": "connected",
|
"SARA_R4_network_status": "connected",
|
||||||
|
"SARA_R4_neworkID": 0,
|
||||||
"WIFI_status": "connected",
|
"WIFI_status": "connected",
|
||||||
"MQTT_GUI": false,
|
"MQTT_GUI": false,
|
||||||
"envea_sondes": [
|
"envea_sondes": [
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ def update_json_key(file_path, key, value):
|
|||||||
with open(file_path, "w") as file:
|
with open(file_path, "w") as file:
|
||||||
json.dump(data, file, indent=2) # Use indent for pretty printing
|
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:
|
except Exception as e:
|
||||||
print(f"Error updating the JSON file: {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('<span style="color: red;font-weight: bold;">ATTENTION: CME ERROR</span>')
|
||||||
print("error:", lines[-1])
|
print("error:", lines[-1])
|
||||||
print("*****")
|
print("*****")
|
||||||
|
#update status
|
||||||
update_json_key(config_file, "SARA_R4_network_status", "disconnected")
|
update_json_key(config_file, "SARA_R4_network_status", "disconnected")
|
||||||
|
|
||||||
# Gestion de l'erreur spécifique
|
# Gestion de l'erreur spécifique
|
||||||
if "No connection to phone" in lines[-1]:
|
if "No connection to phone" in lines[-1]:
|
||||||
print("No connection to the phone. Retrying or reset may be required.")
|
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)
|
# 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]:
|
elif "Operation not allowed" in lines[-1]:
|
||||||
print("Operation not allowed. This may require a different configuration.")
|
print("Operation not allowed. This may require a different configuration.")
|
||||||
# Actions spécifiques pour ce type d'erreur
|
# Actions spécifiques pour ce type d'erreur
|
||||||
|
|||||||
Reference in New Issue
Block a user