From 5742cc7e49064fb4ebad28379a09d07272b2b578 Mon Sep 17 00:00:00 2001 From: PaulVua Date: Thu, 15 Jan 2026 10:16:29 +0100 Subject: [PATCH] reboot when udp send error --- loop/SARA_send_data_v2.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/loop/SARA_send_data_v2.py b/loop/SARA_send_data_v2.py index 0dd2c48..48cadf3 100755 --- a/loop/SARA_send_data_v2.py +++ b/loop/SARA_send_data_v2.py @@ -1136,6 +1136,20 @@ try: #parfois ici on peut avoir une erreur ERROR if "+CME ERROR" in response_SARA_2 or "ERROR" in response_SARA_2: print('⚠️ATTENTION: Error while sending data⚠️') + print('🛑STOP LOOP🛑') + print("
") + + #Send notification (WIFI) + send_error_notification(device_id, "UDP sending issue") + #Hardware Reboot + hardware_reboot_success = modem_hardware_reboot() + if hardware_reboot_success: + print("✅Modem successfully rebooted and reinitialized") + else: + print("⛔There were issues with the modem reboot/reinitialize process") + + #end loop + sys.exit() #Read reply from server (USORD)