This commit is contained in:
PaulVua
2025-01-14 14:36:20 +01:00
parent b411d37d01
commit 44e6c6fa50
3 changed files with 7 additions and 2 deletions

View File

@@ -4,6 +4,8 @@ ex:
python3 /var/www/nebuleair_pro_4g/SARA/sara.py ttyAMA2 AT+CCID? 2 python3 /var/www/nebuleair_pro_4g/SARA/sara.py ttyAMA2 AT+CCID? 2
ex 2 (turn on blue light): ex 2 (turn on blue light):
python3 /var/www/nebuleair_pro_4g/SARA/sara.py ttyAMA2 AT+UGPIOC=16,2 2 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
''' '''

View File

@@ -1,5 +1,7 @@
''' '''
Script to connect SARA-R410 to network SARA-R410 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 AT+COPS=1,2,20801
mode->1 pour manual mode->1 pour manual
format->2 pour numeric format->2 pour numeric

View File

@@ -331,11 +331,12 @@ try:
# and reset HTTP profile (AT+UHTTP=0) -> ne fonctionne pas.. # and reset HTTP profile (AT+UHTTP=0) -> ne fonctionne pas..
# tester un reset avec CFUN 15 # tester un reset avec CFUN 15
# 1.Reconnexion au réseau (AT+COPS) # 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')) ser_sara.write((command + '\r').encode('utf-8'))
responseReconnect = read_complete_response(ser_sara) responseReconnect = read_complete_response(ser_sara)
print("Response:") print("Response reconnect:")
print(responseReconnect) print(responseReconnect)
print("End response reconnect")
elif "Operation not allowed" in lines[-1]: elif "Operation not allowed" in lines[-1]:
print("Operation not allowed. This may require a different configuration.") print("Operation not allowed. This may require a different configuration.")