This commit is contained in:
PaulVua
2025-01-23 14:19:46 +01:00
parent 838d6d7357
commit aa3b4d238b
7 changed files with 25 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
'''
Script to set the URL for a HTTP request
Ex:
/usr/bin/python3 /var/www/nebuleair_pro_4g/SARA/sara_setURL.py ttyAMA2 data.nebuleair.fr
/usr/bin/python3 /var/www/nebuleair_pro_4g/SARA/sara_setURL.py ttyAMA2 data.nebuleair.fr 0
To do: need to add profile id as parameter
First profile id:
@@ -19,6 +19,7 @@ parameter = sys.argv[1:] # Exclude the script name
#print("Parameters received:")
port='/dev/'+parameter[0] # ex: ttyAMA2
url = parameter[1] # ex: data.mobileair.fr
profile_id = parameter[2] #ex: 0
#get baudrate
@@ -47,7 +48,7 @@ ser = serial.Serial(
timeout = 2
)
command = f'AT+UHTTP=0,1,"{url}"\r'
command = f'AT+UHTTP={profile_id},1,"{url}"\r'
ser.write((command + '\r').encode('utf-8'))
print("****")