diff --git a/loop/SARA_send_data_v2.py b/loop/SARA_send_data_v2.py index 879e900..ed7915e 100755 --- a/loop/SARA_send_data_v2.py +++ b/loop/SARA_send_data_v2.py @@ -646,7 +646,7 @@ try: |_____\___/ \___/|_| ''' - print('
') - print(responseReconnect) - print("
", end="") + + #print("TRY TO RECONNECT:") + #command = f'AT+COPS=1,2,"{selected_networkID}"\r' + #ser_sara.write(command.encode('utf-8')) + #responseReconnect = read_complete_response(ser_sara, timeout=20, end_of_response_timeout=20, wait_for_lines=["OK", "+CME ERROR", "ERROR"], debug=True) + #print('') + #print(responseReconnect) + #print("
", end="") print('🛑STOP LOOP🛑') print("No error detected
', end="") + # N°4 INVALID SERVER HOSTNAME elif error_code == 4: print('Error 4: Invalid server Hostname
', end="") - send_error_notification(device_id, "UHTTPER (error n°4) -> Invalid Server Hostname", end="") + send_error_notification(device_id, "UHTTPER (error n°4) -> Invalid Server Hostname") server_hostname_resets = reset_server_hostname(aircarto_profile_id) if server_hostname_resets: print("✅server hostname reset successfully", end="") else: print("⛔There were issues with the modem server hostname reinitialize process") + # N°11 SERVER CONNECTION ERROR elif error_code == 11: - print('Error 11: Server connection error
') + print('Error 11: AirCarto - Server connection error
', end="") + hardware_reboot_success = modem_hardware_reboot() + if hardware_reboot_success: + print("✅Modem successfully rebooted and reinitialized") + else: + print("⛔There were issues with the modem reboot/reinitialize process") + # N°22 PSD CSD CONNECTION NOT ESTABLISHED elif error_code == 22: - print('⚠️Error 22: PSD or CSD connection not established (SARA-R5 need to reset PDP conection)⚠️
') + print('⚠️Error 22: PSD or CSD connection not established (SARA-R5 need to reset PDP conection)⚠️
', end="") send_error_notification(device_id, "UHTTPER (error n°22) -> PSD or CSD connection not established") psd_csd_resets = reset_PSD_CSD_connection() if psd_csd_resets: print("✅PSD CSD connection reset successfully", end="") else: print("⛔There were issues with the modem CSD PSD reinitialize process", end="") + # N°26 CONNECTION TIMED OUT elif error_code == 26: print('Error 26: Connection timed out
', end="") - send_error_notification(device_id, "UHTTPER (error n°26) -> Connection timed out", end="") + send_error_notification(device_id, "UHTTPER (error n°26) -> Connection timed out") + # N°26 CONNECTION LOST elif error_code == 44: print('Error 44: Connection lost
') - send_error_notification(device_id, "UHTTPER (error n°44) -> Connection lost", end="") + send_error_notification(device_id, "UHTTPER (error n°44) -> Connection lost") elif error_code == 73: print('Error 73: Secure socket connect error
', end="") else: @@ -1173,7 +1183,7 @@ try: #5. empty json - print("Empty SARA memory:") + print("Empty SARA memory:", end="") ser_sara.write(b'AT+UDELFILE="sensordata_csv.json"\r') response_SARA_5 = read_complete_response(ser_sara, wait_for_lines=["OK"], debug=False) print('') @@ -1282,7 +1292,7 @@ try: print("⛔There were issues with the modem server hostname reinitialize process") # SERVER CONNECTION ERROR elif error_code == 11: - print('
Error 11: Server connection error
', end="") + print('Error 11: uSpot - Server connection error
', end="") elif error_code == 22: print('Error 22: PSD or CSD connection not established
', end="") elif error_code == 26: @@ -1354,7 +1364,7 @@ try: #5. empty json - print("Empty SARA memory:") + print("Empty SARA memory:", end="") command = f'AT+UDELFILE="sensordata_json.json"\r' ser_sara.write((command + '\r').encode('utf-8')) response_SARA_9t = read_complete_response(ser_sara, wait_for_lines=["OK"], debug=False) @@ -1366,7 +1376,8 @@ try: # Calculate and print the elapsed time elapsed_time = time.time() - start_time_script print(f"Elapsed time: {elapsed_time:.2f} seconds") - print("