diff --git a/config.json.dist b/config.json.dist index 17b1cae..f90683f 100755 --- a/config.json.dist +++ b/config.json.dist @@ -13,6 +13,7 @@ "SARA_R4_general_status": "connected", "SARA_R4_SIM_status": "connected", "SARA_R4_network_status": "connected", + "SARA_R4_neworkID": 0, "WIFI_status": "connected", "MQTT_GUI": false, "envea_sondes": [ diff --git a/loop/1_NPM/send_data.py b/loop/1_NPM/send_data.py index b3e5cb7..8bd8306 100755 --- a/loop/1_NPM/send_data.py +++ b/loop/1_NPM/send_data.py @@ -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('ATTENTION: CME ERROR') 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