Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
519 views
in Technique[技术] by (71.8m points)

http - Problem using ArduinoHTTPClient sending GET requests with ESP32

Board : ESP32 T-Call SIM800L

Code Functioning

Collect Data from phone -> Put Into URL -> Send to Server

CollectQualitativeData() -> AppendQueryParameters() -> http.get(resource)

My code allows me to enter 4 different strings in my android app which my ESP32 receives via bluetooth and stores as an array of char arrays QualArray[4][30] (eg. {"string1","string2"....) . It then adds these strings in the URL query parameters for which I send data to my google sheets web app with a GET request (I know i'm posting data but the get request is what is used for the google apps script when posting data).

Problem

The code works when I pre-define the URL to be sent, although the issue seems to be that adding the strings obtained from the android app to the URL returns an HTTP response of -3 and doesn't upload to the google sheets server. This confuses me as the strings are stored okay because I print them out and they are correct, and then adding them to the URL and printing the URL it looks correct (and identical to the pre-defined URL that works) but for some reason it doesn't work. I thought it could be memory related so I pre-defined all the char arrays with set buffers but still didn't work

Code

https://github.com/Conwon99/4th-Year-Project/blob/main/ESP32_HTTP_REQUEST

The functions to look at are CollectQualitativeData() which is called in setup and AppendQueryParameters() which is called in the loop, then http.get(resource) is called afterwards in the loop which makes the GET request.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...