update
This commit is contained in:
@@ -527,7 +527,7 @@ try:
|
|||||||
# 2.1 code 0 (HTTP failed) ⛔⛔⛔
|
# 2.1 code 0 (HTTP failed) ⛔⛔⛔
|
||||||
if len(parts) == 3 and parts[-1] == '0': # The third value indicates success
|
if len(parts) == 3 and parts[-1] == '0': # The third value indicates success
|
||||||
print("*****")
|
print("*****")
|
||||||
print('<span style="color: red;font-weight: bold;">ATTENTION: HTTP operation failed</span>')
|
print('<span style="color: red;font-weight: bold;">⛔ATTENTION: HTTP operation failed</span>')
|
||||||
update_json_key(config_file, "SARA_R4_network_status", "disconnected")
|
update_json_key(config_file, "SARA_R4_network_status", "disconnected")
|
||||||
print("*****")
|
print("*****")
|
||||||
print("Blink red LED")
|
print("Blink red LED")
|
||||||
@@ -567,8 +567,8 @@ try:
|
|||||||
|
|
||||||
# 2.2 code 1 (HHTP succeded)
|
# 2.2 code 1 (HHTP 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 style="font-weight: bold;">✅✅HTTP operation successful.</span>')
|
||||||
update_json_key(config_file, "SARA_R4_network_status", "connected")
|
update_json_key(config_file, "SARA_R4_network_status", "connected")
|
||||||
print("Blink blue LED")
|
print("Blink blue LED")
|
||||||
led_thread = Thread(target=blink_led, args=(23, 5, 0.5))
|
led_thread = Thread(target=blink_led, args=(23, 5, 0.5))
|
||||||
@@ -671,11 +671,11 @@ try:
|
|||||||
# 1.Vérifier si la réponse contient un message d'erreur CME
|
# 1.Vérifier si la réponse contient un message d'erreur CME
|
||||||
if "+CME ERROR" in lines[-1]:
|
if "+CME ERROR" in lines[-1]:
|
||||||
print("*****")
|
print("*****")
|
||||||
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 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]:
|
||||||
@@ -700,7 +700,7 @@ try:
|
|||||||
# 2.1 code 0 (HTTP failed)
|
# 2.1 code 0 (HTTP failed)
|
||||||
if len(parts) == 3 and parts[-1] == '0': # The third value indicates success
|
if len(parts) == 3 and parts[-1] == '0': # The third value indicates success
|
||||||
print("*****")
|
print("*****")
|
||||||
print('<span style="color: red;font-weight: bold;">ATTENTION: HTTP operation failed</span>')
|
print('<span style="color: red;font-weight: bold;">⛔ATTENTION: HTTP operation failed</span>')
|
||||||
update_json_key(config_file, "SARA_R4_network_status", "disconnected")
|
update_json_key(config_file, "SARA_R4_network_status", "disconnected")
|
||||||
print("*****")
|
print("*****")
|
||||||
print("Blink red LED")
|
print("Blink red LED")
|
||||||
@@ -710,7 +710,7 @@ try:
|
|||||||
|
|
||||||
# Get error code
|
# Get error code
|
||||||
print("Getting error code (11->Server connection error, 73->Secure socket connect error)")
|
print("Getting error code (11->Server connection error, 73->Secure socket connect error)")
|
||||||
command = f'AT+UHTTPER={aircarto_profile_id}\r'
|
command = f'AT+UHTTPER={uSpot_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"], debug=False)
|
||||||
print('<p class="text-danger-emphasis">')
|
print('<p class="text-danger-emphasis">')
|
||||||
@@ -735,8 +735,8 @@ try:
|
|||||||
|
|
||||||
# 2.2 code 1 (HHTP succeded)
|
# 2.2 code 1 (HHTP 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 style="font-weight: bold;">✅✅HTTP operation successful.</span>')
|
||||||
update_json_key(config_file, "SARA_R4_network_status", "connected")
|
update_json_key(config_file, "SARA_R4_network_status", "connected")
|
||||||
print("Blink blue LED")
|
print("Blink blue LED")
|
||||||
led_thread = Thread(target=blink_led, args=(23, 5, 0.5))
|
led_thread = Thread(target=blink_led, args=(23, 5, 0.5))
|
||||||
|
|||||||
Reference in New Issue
Block a user