This commit is contained in:
Your Name
2025-01-20 12:28:08 +01:00
parent cb600df2ef
commit 4d45e34a21
2 changed files with 73 additions and 34 deletions

View File

@@ -360,14 +360,17 @@ try:
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:
response_received = True
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.strip())
# if "+UUHTTPCR" in response_SARA_3:
# response_received = True
if "+UUHTTPCR" in response_SARA_3:
print("Received +UUHTTPCR response.")