This commit is contained in:
PaulVua
2025-01-15 17:35:24 +01:00
parent e2c522af13
commit 75c839a2a3

View File

@@ -356,15 +356,21 @@ 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'))
response_SARA_3 = read_complete_response(ser_sara, timeout=5)
print(response_SARA_3)
# 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:
response_received = True
if "+UUHTTPCR" in response_SARA_3:
print("Received +UUHTTPCR response.")
response_received = True
# Les types de réponse
@@ -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