update
This commit is contained in:
@@ -982,7 +982,7 @@ try:
|
|||||||
print("Getting error code")
|
print("Getting error code")
|
||||||
command = f'AT+UHTTPER={aircarto_profile_id}\r'
|
command = f'AT+UHTTPER={aircarto_profile_id}\r'
|
||||||
ser_sara.write(command.encode('utf-8'))
|
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('<p class="text-danger-emphasis">')
|
||||||
print(response_SARA_9)
|
print(response_SARA_9)
|
||||||
print("</p>", end="")
|
print("</p>", end="")
|
||||||
@@ -993,13 +993,13 @@ try:
|
|||||||
if error_code is not None:
|
if error_code is not None:
|
||||||
# Display interpretation based on error code
|
# Display interpretation based on error code
|
||||||
if error_code == 0:
|
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:
|
elif error_code == 4:
|
||||||
print('<p class="text-danger">Error 4: Invalid server Hostname</p>')
|
print('<p class="text-danger">Error 4: Invalid server Hostname</p>', end="")
|
||||||
send_error_notification(device_id, "UHTTPER (error n°4) -> Invalid Server Hostname")
|
send_error_notification(device_id, "UHTTPER (error n°4) -> Invalid Server Hostname", end="")
|
||||||
server_hostname_resets = reset_server_hostname(aircarto_profile_id)
|
server_hostname_resets = reset_server_hostname(aircarto_profile_id)
|
||||||
if server_hostname_resets:
|
if server_hostname_resets:
|
||||||
print("✅server hostname reset successfully")
|
print("✅server hostname reset successfully", end="")
|
||||||
else:
|
else:
|
||||||
print("⛔There were issues with the modem server hostname reinitialize process")
|
print("⛔There were issues with the modem server hostname reinitialize process")
|
||||||
elif error_code == 11:
|
elif error_code == 11:
|
||||||
@@ -1009,34 +1009,31 @@ try:
|
|||||||
send_error_notification(device_id, "UHTTPER (error n°22) -> PSD or CSD connection not established")
|
send_error_notification(device_id, "UHTTPER (error n°22) -> PSD or CSD connection not established")
|
||||||
psd_csd_resets = reset_PSD_CSD_connection()
|
psd_csd_resets = reset_PSD_CSD_connection()
|
||||||
if psd_csd_resets:
|
if psd_csd_resets:
|
||||||
print("✅PSD CSD connection reset successfully")
|
print("✅PSD CSD connection reset successfully", end="")
|
||||||
else:
|
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:
|
elif error_code == 26:
|
||||||
print('<p class="text-danger">Error 26: Connection timed out</p>')
|
print('<p class="text-danger">Error 26: Connection timed out</p>', end="")
|
||||||
send_error_notification(device_id, "UHTTPER (error n°26) -> Connection timed out")
|
send_error_notification(device_id, "UHTTPER (error n°26) -> Connection timed out", end="")
|
||||||
elif error_code == 44:
|
elif error_code == 44:
|
||||||
print('<p class="text-danger">Error 44: Connection lost</p>')
|
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:
|
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:
|
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:
|
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✅✅)
|
# 2.2 code 1 (✅✅HHTP / UUHTTPCR succeded✅✅)
|
||||||
else:
|
else:
|
||||||
# Si la commande HTTP a réussi
|
# 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 SARA_network_status
|
||||||
update_config_sqlite('SARA_network_status', 'connected')
|
update_config_sqlite('SARA_network_status', 'connected')
|
||||||
|
|||||||
Reference in New Issue
Block a user