Hi Makers!
I have been working on a project for a while and I'm stuck. Would love your expert help getting unstuck so I can keep moving this forward.
I need this done quickly so I am happy to pay $20 Paypal to the first person to fix this for me.
I know it's not a ton but I'm pretty sure this is a quick fix
Anyway...
Here's what I need to accomplish is:
- Send a GET request to a webpage that contains sensor data from the Arduino
- Receive the response string from the webpage and parse out the name-value pairs into variables which will be used by the Arduino sketch
So basically just send some data and receive some data.
Here's my setup:
I'm using an Arduino Mega 2560 R3 with an ESP 2866 (ESP-01). The Arduino is sending AT commands to the ESP-01 via a Serial 1 connection (pins 18 and 19 on the Mega).
The webpage that I want to receive the Arduino's request is:
http://mywebgeeks.com/test/testServerPage.php.
Right now that page just responds with string of dummy name-value pairs but later that page will dynamically generate a string with useful data which the Arduino will then use in its program.
Here's where I'm stuck:
I can successfully send GET requests to the ThingSpeak api for testing. So I know that the Arduino is able to send GET requests out to webpages.
However, when I try to send the GET request to my webpage above, it looks like the server doesn't like my request. It must be something with formatting. I can't figure it out.
Attached is the sketch that I am using to successfully send values into ThingSpeak's API. The api key for the test channel I'm using is already in there. You can use that or your own.
You can edit the wifi credentials so you can test it out. On lines 29 and 47 you will find the website and webpage that I want to send GET requests to. They are commented out right now but you can use those for final testing to verify the GET requests are working. You can view the url in a web browser to see what the response should be.
Please help me get unstuck and I will send you lunch money!
Thanks
John
sketch_testGetRequest.ino (4.18 KB)