improve pdp reconnect

This commit is contained in:
PaulVua
2026-01-15 10:35:46 +01:00
parent 5742cc7e49
commit c571bbd408

View File

@@ -515,6 +515,15 @@ def reset_PSD_CSD_connection():
""" """
print("Reseting PDP connection ") print("Reseting PDP connection ")
pdp_reset_success = True 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 # Activate PDP context 1
print('➡️ Activate PDP context 1') print('➡️ Activate PDP context 1')
command = f'AT+CGACT=1,1\r' command = f'AT+CGACT=1,1\r'