From 44e6c6fa50aaf00ef06f1930b6b6a6eb251bb867 Mon Sep 17 00:00:00 2001 From: PaulVua Date: Tue, 14 Jan 2025 14:36:20 +0100 Subject: [PATCH] update --- SARA/sara.py | 2 ++ SARA/sara_connectNetwork.py | 2 ++ loop/1_NPM/send_data.py | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/SARA/sara.py b/SARA/sara.py index c4cc291..06a0f43 100755 --- a/SARA/sara.py +++ b/SARA/sara.py @@ -4,6 +4,8 @@ ex: python3 /var/www/nebuleair_pro_4g/SARA/sara.py ttyAMA2 AT+CCID? 2 ex 2 (turn on blue light): python3 /var/www/nebuleair_pro_4g/SARA/sara.py ttyAMA2 AT+UGPIOC=16,2 2 +ex 3 (reconnect network) +python3 /var/www/nebuleair_pro_4g/SARA/sara.py ttyAMA2 AT+COPS=1,2,20801 20 ''' diff --git a/SARA/sara_connectNetwork.py b/SARA/sara_connectNetwork.py index 7a18cca..430f885 100755 --- a/SARA/sara_connectNetwork.py +++ b/SARA/sara_connectNetwork.py @@ -1,5 +1,7 @@ ''' Script to connect SARA-R410 to network SARA-R410 +python3 /var/www/nebuleair_pro_4g/SARA/sara_connectNetwork.py ttyAMA2 20801 10 + AT+COPS=1,2,20801 mode->1 pour manual format->2 pour numeric diff --git a/loop/1_NPM/send_data.py b/loop/1_NPM/send_data.py index fa4d7af..53b3d76 100755 --- a/loop/1_NPM/send_data.py +++ b/loop/1_NPM/send_data.py @@ -331,11 +331,12 @@ try: # and reset HTTP profile (AT+UHTTP=0) -> ne fonctionne pas.. # tester un reset avec CFUN 15 # 1.Reconnexion au réseau (AT+COPS) - command = f'AT+COPS=1,2,{selected_networkID}\r' + command = f'AT+COPS=1,2,"{selected_networkID}"\r' ser_sara.write((command + '\r').encode('utf-8')) responseReconnect = read_complete_response(ser_sara) - print("Response:") + print("Response reconnect:") print(responseReconnect) + print("End response reconnect") elif "Operation not allowed" in lines[-1]: print("Operation not allowed. This may require a different configuration.")