Go Down

Topic: Request URL from Arduino (Read 808 times) previous topic - next topic

BobW

I have placed a php file in a folder on a web server that will send an email based on the contents of the text used to call it.

For example: if (in a web browser) I put in the address box:

http://mywebsite.com/myfolder/myphp.php?TO=joe@w.com&FROM=bob@v.com&SUBJECT=TestSubject&MESSAGE=TestMessage

and hit "Enter", an email will be sent to joe@w.com from bob@v.com without any futher action by the user.

QUESTION:

How do I make my Arduino and Ethernet Shield accomplish the same task that I can so easily do from a web browser on my computer?
That is how do I request to go to a new URL once I am connected to a server.  My real goal is to cause a sensed input on the Arduino to generate an email alert.

Thank you so much (mille grazie)
BobW

zoomkat

Your example is a GET request, so that is what you probably need to send from the arduino.  
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

BobW

OK.
Thank you.
Very good.
Using GET I made it work.
I can get email notification now of a button press on my Arduino.
""It's *good" !!"

Followup question:
Am I limited to "GET" URLs only on the server specified at the beginning of my Arduino sketch?  That seems to be the situation.

Thanks.
BobW

zoomkat

Quote
Followup question:
Am I limited to "GET" URLs only on the server specified at the beginning of my Arduino sketch?  That seems to be the situation.

It probably depends on the PHP script on the server. The GET method can only send a limited length string of info with some character limitations. The POST method can send a large amount of data. If your PHP script on the server is written to handle POST request, then the POST method should work (depending on any limitations on what you are allowed to do on the server). It would be helpful to me and probably many others if you posted your working arduino code for future reference. Down the road I want to do something similar to have the arduino send text messages to my cell phone.
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

TylerW

Bob, do you think you could post the Arduino part of your code as I am trying to right the same program.

Thanks

Tyler

Go Up