Go Down

Topic: regular http requests (Read 773 times) previous topic - next topic

stephan2307

Hi,

just a quick question.

how difficult would if be to set up the arduino with the ethernet shield and program it so that it will send a http request in specific intervals.

So for example send every hour a request to http://www.domain.com/page.php?id=27364

There would be no return data.

Thanks.


florinc

The WebClient example coming with Arduino 1.0  shows you how to send a get request to a site.

SurferTim

Here is client code that does almost what you want. It loads Google every 10 seconds.
http://arduino.cc/forum/index.php/topic,99629.msg754629.html#msg754629

Change the server ip to yours.

stephan2307

great thanks.

and which board would be the best one to use? all it will do is to send the http request.

stephan2307


Here is client code that does almost what you want. It loads Google every 10 seconds.
http://arduino.cc/forum/index.php/topic,99629.msg754629.html#msg754629

Change the server ip to yours.



Just had a look at the example and it takes only an IP but I will need to send also some GET parameters and send it to a domain not to a IP.

any chance how to change this?

florinc

Function connect can also take the host name:
Code: [Select]
  virtual int connect(IPAddress ip, uint16_t port);
  virtual int connect(const char *host, uint16_t port);

stephan2307


great thanks.

and which board would be the best one to use? all it will do is to send the http request.

florinc

Quote
and which board would be the best one to use? all it will do is to send the http request.

You said you already have the ethernet shield. You don't need any extra board.

stephan2307

I am completely new to this and I was planning on using the arduino and the ethernet shield but I have also seen that there are some boards with ethernet already on. Really unsure of what board is best to get for this project.

thanks a lot for all the help

florinc

The boards with ethernet already on them are basically the equivalent of Arduino + ethernet shield. They just take less space. They may also be cheaper.

Go Up