This commit is contained in:
root
2025-07-02 13:52:03 +02:00
parent 3b8b51172c
commit 29458c4841

View File

@@ -982,7 +982,7 @@ try:
print("Getting error code")
command = f'AT+UHTTPER={aircarto_profile_id}\r'
ser_sara.write(command.encode('utf-8'))
response_SARA_9 = read_complete_response(ser_sara, wait_for_lines=["OK"], debug=False)
response_SARA_9 = read_complete_response(ser_sara, wait_for_lines=["OK","ERROR"], debug=False)
print('<p class="text-danger-emphasis">')
print(response_SARA_9)
print("</p>", end="")
@@ -993,13 +993,13 @@ try:
if error_code is not None:
# Display interpretation based on error code
if error_code == 0:
print('<p class="text-success">No error detected</p>')
print('<p class="text-success">No error detected</p>', end="")
elif error_code == 4:
print('<p class="text-danger">Error 4: Invalid server Hostname</p>')
send_error_notification(device_id, "UHTTPER (error n°4) -> Invalid Server Hostname")
print('<p class="text-danger">Error 4: Invalid server Hostname</p>', end="")
send_error_notification(device_id, "UHTTPER (error n°4) -> Invalid Server Hostname", end="")
server_hostname_resets = reset_server_hostname(aircarto_profile_id)
if server_hostname_resets:
print("✅server hostname reset successfully")
print("✅server hostname reset successfully", end="")
else:
print("⛔There were issues with the modem server hostname reinitialize process")
elif error_code == 11:
@@ -1009,34 +1009,31 @@ try:
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")
print("✅PSD CSD connection reset successfully", end="")
else:
print("⛔There were issues with the modem CSD PSD reinitialize process")
print("⛔There were issues with the modem CSD PSD reinitialize process", end="")
elif error_code == 26:
print('<p class="text-danger">Error 26: Connection timed out</p>')
send_error_notification(device_id, "UHTTPER (error n°26) -> Connection timed out")
print('<p class="text-danger">Error 26: Connection timed out</p>', end="")
send_error_notification(device_id, "UHTTPER (error n°26) -> Connection timed out", end="")
elif error_code == 44:
print('<p class="text-danger">Error 44: Connection lost</p>')
send_error_notification(device_id, "UHTTPER (error n°44) -> Connection lost")
send_error_notification(device_id, "UHTTPER (error n°44) -> Connection lost", end="")
elif error_code == 73:
print('<p class="text-danger">Error 73: Secure socket connect error</p>')
print('<p class="text-danger">Error 73: Secure socket connect error</p>', end="")
else:
print(f'<p class="text-danger">Unknown error code: {error_code}</p>')
print(f'<p class="text-danger">Unknown error code: {error_code}</p>', end="")
else:
print('<p class="text-danger">Could not extract error code from response</p>')
print('<p class="text-danger">Could not extract error code from response</p>',end="")
if "ERROR" in response_SARA_9:
print('<p class="text-danger">⚠Sara Module returned an error</p>',end="")
print('<p class="text-warning">⚠set up hardware reboot here???</p>',end="")
#Software Reboot
#software_reboot_success = modem_complete_reboot_and_reinitialize(modem_version, aircarto_profile_id)
#if software_reboot_success:
# print("Modem successfully rebooted and reinitialized")
#else:
# print("There were issues with the modem reboot/reinitialize process")
# 2.2 code 1 (✅✅HHTP / UUHTTPCR succeded✅✅)
else:
# Si la commande HTTP a réussi
print('<span class="badge text-bg-success">✅✅HTTP operation successful.</span>')
print('<span class="badge text-bg-success">✅✅HTTP operation successful.</span>',end="")
#update SARA_network_status
update_config_sqlite('SARA_network_status', 'connected')