diff --git a/loop/SARA_send_data_v2.py b/loop/SARA_send_data_v2.py index 93ad5f9..b7e9ba0 100755 --- a/loop/SARA_send_data_v2.py +++ b/loop/SARA_send_data_v2.py @@ -774,7 +774,7 @@ try: # Getting the LTE Signal print("➡️Getting LTE signal") ser_sara.write(b'AT+CSQ\r') - response2 = read_complete_response(ser_sara, wait_for_lines=["OK", "ERROR", "+CME ERROR"]) + response2 = read_complete_response(ser_sara, wait_for_lines=["OK", "ERROR", "+CME ERROR","Socket:bind"]) print('

') print(response2) print("

", end="") @@ -797,12 +797,25 @@ try: #end loop sys.exit() - #2. si on a une erreur + #2. si on a une reponse du SARA mais c'est une erreur elif "+CME ERROR" in response2: print(f"SARA module returned error: {response2}") print("The CSQ command is not supported by this module or in its current state") print("⚠️ATTENTION: SARA is connected over serial but CSQ command not supported") print('🛑STOP LOOP🛑') + print("
") + + #end loop + sys.exit() + + #3. On peut avoir une erreur de type "Socket:bind: Treck error 222 : Invalid argument" + elif "Socket:bind: Treck error" in response2: + print(f"SARA module returned error: {response2}") + print("⚠️ATTENTION: low-level error from the Treck TCP/IP stack") + print('🛑STOP LOOP🛑') + print("
") + #Send notification (WIFI) + send_error_notification(device_id, "Treck TCP/IP stack error") #end loop sys.exit()