update
This commit is contained in:
@@ -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("****")
|
||||
|
||||
Reference in New Issue
Block a user