diff --git a/VERSION b/VERSION index 943f9cb..f8a696c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.7.1 +1.7.2 diff --git a/changelog.json b/changelog.json index b689a93..9620675 100644 --- a/changelog.json +++ b/changelog.json @@ -1,5 +1,21 @@ { "versions": [ + { + "version": "1.7.2", + "date": "2026-05-12", + "changes": { + "features": [], + "improvements": [ + "Loop SARA: detection SIM injoignable etendue au cas 'signal CSQ=99' (sans SIM, le modem ne peut pas s'enregistrer donc CSQ=99 systematique)", + "Distinction claire entre 'SIM absente' (alerte rouge + notification) et 'coupure reseau temporaire' (message vert, retry au prochain cycle)" + ], + "fixes": [ + "v1.7.1 ne detectait pas la SIM absente quand CSQ=99 (le script sortait avant d'atteindre le check SIM dans la branche USOCR)" + ], + "compatibility": [] + }, + "notes": "Complement v1.7.1: le check SIM est maintenant appele dans les deux branches d'echec (CSQ=99 et USOCR ERROR). Couvre tous les cas de SIM injoignable." + }, { "version": "1.7.1", "date": "2026-05-12", diff --git a/loop/SARA_send_data_v2.py b/loop/SARA_send_data_v2.py index 57872fc..08b6ea3 100755 --- a/loop/SARA_send_data_v2.py +++ b/loop/SARA_send_data_v2.py @@ -1155,20 +1155,36 @@ try: # si c'est le cas on essaie de se reconnecter if signal_quality == 99: print('⚠️ATTENTION: Signal Quality indicates no signal (99)⚠️') - - #Pas besoin d'essayer de se reconnecter car reconnection automatique - #print("TRY TO RECONNECT:") - #command = f'AT+COPS=1,2,{selected_networkID}\r' - #command = f'AT+COPS=0\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="") - + + # Diagnostic : signal 99 peut etre du a une SIM absente OU une coupure reseau temporaire + sim_ok = check_sim_status() + + if not sim_ok: + # SIM injoignable -> alerte tres visible, pas la peine d'attendre une reconnexion + print('
') + print('
') + print('🚨🚨🚨 SIM CARD NOT DETECTED 🚨🚨🚨
') + print('⛔ Signal a 99 + SIM injoignable : la carte SIM est absente ou mal inseree.
') + print('⛔ AT+CPIN? et AT+CCID ont tous les deux echoue.
') + print('👉 Action requise : verifier physiquement la carte SIM (sortir/reinserer, nettoyer les contacts).') + print('
') + print('
') + + # LED rouge clignotante + led_thread = Thread(target=blink_led, args=(24, 5, 0.5)) + led_thread.start() + + # Notification WIFI explicite + send_error_notification(device_id, "SIM NOT DETECTED -> physical check required (signal 99 + SIM unreachable)") + + print('🛑STOP LOOP🛑') + print("
") + sys.exit() + + # SIM OK -> juste une coupure reseau temporaire, reconnexion auto + print('✅ SIM card detected — temporary network signal loss, will retry next cycle') print('🛑STOP LOOP🛑') print("
") - #on arrete le script pas besoin de continuer sys.exit() else: #print("Signal Quality:", signal_quality)