From c571bbd408b65b0a3694de2b72ef8623f1e1ff8c Mon Sep 17 00:00:00 2001 From: PaulVua Date: Thu, 15 Jan 2026 10:35:46 +0100 Subject: [PATCH] improve pdp reconnect --- loop/SARA_send_data_v2.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/loop/SARA_send_data_v2.py b/loop/SARA_send_data_v2.py index 48cadf3..1afdab8 100755 --- a/loop/SARA_send_data_v2.py +++ b/loop/SARA_send_data_v2.py @@ -515,6 +515,15 @@ def reset_PSD_CSD_connection(): """ print("⚠️Reseting PDP connection ") pdp_reset_success = True + + #check if PDP context is already active + print('➡️ Check if PDP context is already active') + command = f'AT+CGACT?\r' + ser_sara.write(command.encode('utf-8')) + response_check = read_complete_response(ser_sara, wait_for_lines=["OK"]) + print(response_check, end="") + time.sleep(1) + # Activate PDP context 1 print('➡️ Activate PDP context 1') command = f'AT+CGACT=1,1\r'