update
This commit is contained in:
@@ -356,15 +356,21 @@ try:
|
|||||||
print(response_SARA_2)
|
print(response_SARA_2)
|
||||||
|
|
||||||
#3. Send to endpoint (with device ID)
|
#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'
|
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'))
|
ser_sara.write(command.encode('utf-8'))
|
||||||
|
|
||||||
response_SARA_3 = read_complete_response(ser_sara, timeout=5)
|
# Wait for the +UUHTTPCR response
|
||||||
print(response_SARA_3)
|
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:
|
||||||
|
response_received = True
|
||||||
|
|
||||||
if "+UUHTTPCR" in response_SARA_3:
|
if "+UUHTTPCR" in response_SARA_3:
|
||||||
print("Received +UUHTTPCR response.")
|
print("Received +UUHTTPCR response.")
|
||||||
response_received = True
|
|
||||||
|
|
||||||
# Les types de réponse
|
# Les types de réponse
|
||||||
|
|
||||||
@@ -468,12 +474,9 @@ try:
|
|||||||
print('</p>')
|
print('</p>')
|
||||||
|
|
||||||
#5. empty json
|
#5. empty json
|
||||||
|
print("Empty SARA memory:")
|
||||||
ser_sara.write(b'AT+UDELFILE="sensordata_csv.json"\r')
|
ser_sara.write(b'AT+UDELFILE="sensordata_csv.json"\r')
|
||||||
response_SARA_5 = read_complete_response(ser_sara)
|
response_SARA_5 = read_complete_response(ser_sara)
|
||||||
if need_to_log:
|
|
||||||
print("Empty JSON:")
|
|
||||||
print(response_SARA_5)
|
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
SEND TO MICRO SPOT
|
SEND TO MICRO SPOT
|
||||||
|
|||||||
Reference in New Issue
Block a user