update
This commit is contained in:
@@ -356,16 +356,22 @@ try:
|
||||
print(response_SARA_2)
|
||||
|
||||
#3. Send to endpoint (with device ID)
|
||||
print("Send data:")
|
||||
print("Send data (POST REQUEST):")
|
||||
command= f'AT+UHTTPC=0,4,"/pro_4G/data.php?sensor_id={device_id}","server_response.txt","sensordata_csv.json",4\r'
|
||||
ser_sara.write(command.encode('utf-8'))
|
||||
|
||||
# Wait for the +UUHTTPCR response
|
||||
print("Waiting for +UUHTTPCR response...")
|
||||
response_received = False
|
||||
while not response_received:
|
||||
response_SARA_3 = read_complete_response(ser_sara, timeout=5)
|
||||
print(response_SARA_3)
|
||||
if "+UUHTTPCR" in response_SARA_3:
|
||||
print("Received +UUHTTPCR response.")
|
||||
response_received = True
|
||||
|
||||
if "+UUHTTPCR" in response_SARA_3:
|
||||
print("Received +UUHTTPCR response.")
|
||||
|
||||
# Les types de réponse
|
||||
|
||||
# 1.La commande n'a pas fonctionné
|
||||
@@ -468,12 +474,9 @@ try:
|
||||
print('</p>')
|
||||
|
||||
#5. empty json
|
||||
print("Empty SARA memory:")
|
||||
ser_sara.write(b'AT+UDELFILE="sensordata_csv.json"\r')
|
||||
response_SARA_5 = read_complete_response(ser_sara)
|
||||
if need_to_log:
|
||||
print("Empty JSON:")
|
||||
print(response_SARA_5)
|
||||
|
||||
|
||||
'''
|
||||
SEND TO MICRO SPOT
|
||||
|
||||
Reference in New Issue
Block a user