Pages: [1]   Go Down
Author Topic: Request URL from Arduino  (Read 718 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 48
Bald-Headed, Middle-Aged Nerd
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9634
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your example is a GET request, so that is what you probably need to send from the arduino.  
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

0
Offline Offline
Newbie
*
Karma: 0
Posts: 48
Bald-Headed, Middle-Aged Nerd
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9634
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Thanks

Tyler
Logged

Pages: [1]   Go Up
Jump to: