v1.7.2: Detection SIM aussi dans la branche CSQ=99
Sans SIM, le modem retourne CSQ=99 systematique et le script sortait avant d'atteindre le check SIM ajoute en v1.7.1. - Branche CSQ=99: appelle aussi check_sim_status() - Si SIM absente: alerte rouge + notification WiFi - Si SIM OK: message vert (coupure reseau temporaire) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,21 @@
|
|||||||
{
|
{
|
||||||
"versions": [
|
"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",
|
"version": "1.7.1",
|
||||||
"date": "2026-05-12",
|
"date": "2026-05-12",
|
||||||
|
|||||||
@@ -1155,20 +1155,36 @@ try:
|
|||||||
# si c'est le cas on essaie de se reconnecter
|
# si c'est le cas on essaie de se reconnecter
|
||||||
if signal_quality == 99:
|
if signal_quality == 99:
|
||||||
print('<span style="color: red;font-weight: bold;">⚠️ATTENTION: Signal Quality indicates no signal (99)⚠️</span>')
|
print('<span style="color: red;font-weight: bold;">⚠️ATTENTION: Signal Quality indicates no signal (99)⚠️</span>')
|
||||||
|
|
||||||
#Pas besoin d'essayer de se reconnecter car reconnection automatique
|
# Diagnostic : signal 99 peut etre du a une SIM absente OU une coupure reseau temporaire
|
||||||
#print("TRY TO RECONNECT:")
|
sim_ok = check_sim_status()
|
||||||
#command = f'AT+COPS=1,2,{selected_networkID}\r'
|
|
||||||
#command = f'AT+COPS=0\r'
|
if not sim_ok:
|
||||||
#ser_sara.write(command.encode('utf-8'))
|
# SIM injoignable -> alerte tres visible, pas la peine d'attendre une reconnexion
|
||||||
#responseReconnect = read_complete_response(ser_sara, timeout=20, end_of_response_timeout=20, wait_for_lines=["OK", "+CME ERROR", "ERROR"], debug=True)
|
print('<hr>')
|
||||||
#print('<p class="text-danger-emphasis">')
|
print('<div style="border: 3px solid red; background-color: #ffe5e5; padding: 10px; margin: 10px 0;">')
|
||||||
#print(responseReconnect)
|
print('<span style="color: red;font-weight: bold;font-size: 1.4em;">🚨🚨🚨 SIM CARD NOT DETECTED 🚨🚨🚨</span><br>')
|
||||||
#print("</p>", end="")
|
print('<span style="color: red;font-weight: bold;">⛔ Signal a 99 + SIM injoignable : la carte SIM est absente ou mal inseree.</span><br>')
|
||||||
|
print('<span style="color: red;font-weight: bold;">⛔ AT+CPIN? et AT+CCID ont tous les deux echoue.</span><br>')
|
||||||
|
print('<span style="color: red;font-weight: bold;">👉 Action requise : verifier physiquement la carte SIM (sortir/reinserer, nettoyer les contacts).</span>')
|
||||||
|
print('</div>')
|
||||||
|
print('<hr>')
|
||||||
|
|
||||||
|
# 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("<hr>")
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
# SIM OK -> juste une coupure reseau temporaire, reconnexion auto
|
||||||
|
print('<span style="color: green;font-weight: bold;">✅ SIM card detected — temporary network signal loss, will retry next cycle</span>')
|
||||||
print('🛑STOP LOOP🛑')
|
print('🛑STOP LOOP🛑')
|
||||||
print("<hr>")
|
print("<hr>")
|
||||||
#on arrete le script pas besoin de continuer
|
|
||||||
sys.exit()
|
sys.exit()
|
||||||
else:
|
else:
|
||||||
#print("Signal Quality:", signal_quality)
|
#print("Signal Quality:", signal_quality)
|
||||||
|
|||||||
Reference in New Issue
Block a user